Template Visibility Control

Is it possible to control template visibility from within the template? I do not see access to a property from within the template designer.

Kurt

Add a vis template parameter. On the main screen, bind the vis parameter to the template’s visible property (bidirectional)

I need to access the visibility property from within the template which doesn’t appear to be possible.

Create a boolean property on the template i.e. TemplateVisible. Manipulate the TemplateVisible value in your template as needed. When you drop the template on a window, go to the template’s Visible property and bind it to the template’s TemplateVisible property.

It’s not immediately apparent when you are working with templates (at least not to me using 7.5.1) that you can make custom properties on the template that will be available as custom properties on instances.

It took me a while to figure out that when editing a template you can click on the template name (not any of the components being used) and press Ctrl + U to access these parameters and properties. The right-click context menu is no help in this case.

This might be the part of the solution that you are missing.

Having to manipulate after dropping the template onto a window kind of defeats the purpose of having the template to begin with.

Ok, I went a step further. From within the template you can use event.source.parent.parent.visible = 0

That works. Interestingly that property doesn’t show up in the property explorer. I will say if you make the template disappear in the template designer it’s a little tricky getting it back.

Under what circumstances are you trying to hide and unhide the template?