Question about working with ContentTemplates
Posted: 26 Sep 2026, 17:56
Hello,
I am newer to MVVM than i previously thought (classic Dunning-Kruger effect). As such, I'd like some help wrapping my head around some concepts for what I am trying to achieve. What I am trying to do is to have switchable HUDs that belong to a ContentControl in my Root xaml. More specifically, hud designs that are in their own xaml file. For clarity, I'm working in Unity, but based on this post (viewtopic.php?p=19685&hilit=multiple+xaml#p19685), it was noted that one can "...'switch screen' by simply changing the Template used by the ContentControl's 'Content Template' Property".
I understand this & have created a couple test content templates which easily switch out in run-time design. That is fun, but how do I achieve this at run time, through code? Is this a regular binding where I create a C# property and invoke the PropertyChanged event? If so, what should Noesis's data structure look like for that? Because I have been unsuccessful at any template being rendered on screen (unless i've specifically set it in Noesis Studio). If no, what is the recommended MVVM approach to do this?
Thanks for your help & sorry if this Q has been asked before!
I am newer to MVVM than i previously thought (classic Dunning-Kruger effect). As such, I'd like some help wrapping my head around some concepts for what I am trying to achieve. What I am trying to do is to have switchable HUDs that belong to a ContentControl in my Root xaml. More specifically, hud designs that are in their own xaml file. For clarity, I'm working in Unity, but based on this post (viewtopic.php?p=19685&hilit=multiple+xaml#p19685), it was noted that one can "...'switch screen' by simply changing the Template used by the ContentControl's 'Content Template' Property".
I understand this & have created a couple test content templates which easily switch out in run-time design. That is fun, but how do I achieve this at run time, through code? Is this a regular binding where I create a C# property and invoke the PropertyChanged event? If so, what should Noesis's data structure look like for that? Because I have been unsuccessful at any template being rendered on screen (unless i've specifically set it in Noesis Studio). If no, what is the recommended MVVM approach to do this?
Thanks for your help & sorry if this Q has been asked before!