Use of tag() binding in expressions is bad?

hi,

I wanted to get a little clarification on the use of the Tag() binding. I understand it’s bad for performance. What is the appropriate way to structure expressions? For example, say I have:

Analog Indicator view
- Vertical indicator
- Label

The “Analog Indicator” has a Param, DataTag for the root tag.

The Vertical Indicator has an indirect binding to the “DataTag/Value”. it also has an expression checking for limits that uses something like “Tag(DataTag +”/HiLimit”), Tag(DataTag +”/LoLimit”) for several tags., sometimes an extensive list if somebody weas trying to get fancy.

What would be the proper way to accomplish this? Do I create Custom Properties in the “Analog Indicator” view? Can I use the tag() bindings in the custom property? Then reference the result in the Vertical Indicator? Use a reference to the custom property, “view.custom.value” for example.

Most of our template make extensive use of the tag() binding. all of them have at least a couple and some have a dozen or more. This is due to inexperience in house and by an inexperienced integrator.

Now I get to fix it….

Add a custom property for each value you are looking at. Populate those properties with tag or indirect tag bindings (fast). Reference those properties in your expression.

If you’re looking at the same values on multiple expressions across your screen you can benefit from having the properties live at the form or view level so they only get looked up once and propagate changes down through the screen.

3 Likes

Also, the tag() expression is acceptable to use in a tag (e.g an expression tag).