Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

WPF: Reapply DataTemplateSelector when a certain value changes

$
0
0

The original question was asked here: http://stackoverflow.com/questions/3543515/wpf-reapply-datatemplateselector-when-a-certain-value-changes. There hasn't been posted an answer to this.

My situation is worse, than described in the link above, for I generate the data template at runtime, based on a property value. So for me DataTemplate triggers won't work.

The question is, what do I need to do (.NET 4.0) to make the following XAML create and propagate a new DataTemplate:

<ItemsControl ItemTemplateSelector="{StaticResource ItemTemplateCreator}" .../>

Here I issue an InvalidateProperty on ItemTempalteSelectorProperty, when the property I'm listening to changes. It issues allright, the new template is being generated, but nothing changes in the UI.

Any help? What hooks am I missing?


Mikhail


Viewing all articles
Browse latest Browse all 18858

Trending Articles