WPF: Reapply DataTemplateSelector when a certain value changes
问题 So here is the XAML that I have: <ItemsControl ItemsSource="{Binding Path=Groups}" ItemTemplateSelector="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=ListTemplateSelector}"/> Here is my ListTemplateSelector class: public class ListTemplateSelector : DataTemplateSelector { public DataTemplate GroupTemplate { get; set; } public DataTemplate ItemTemplate { get; set; } public override DataTemplate SelectTemplate(object item, DependencyObject container) { GroupList<Person>