Explicitly refresh DataTemplate from a DataTemplateSelector?

Shimmy Weitzhandler picture Shimmy Weitzhandler · Jan 18, 2010 · Viewed 12.2k times · Source

I set up a ContentControl.DataTemplateSelector to my desired one.
I want that according to a command or whatever, call the ContentControl to reselect the template from the selector by either xaml or code.

Thank

Answer

Jens picture Jens · Jun 16, 2011

Late to the party, I know. =)

When faced with this problem, I found it easiest to explicitly set a new TemplateSelector like

MyContentControl.ContentTemplateSelector =
     new MyDataTemplateSelector();