CollectionViewSource in CodeBehind with Template Bindings
I'm creating a lookless control based on Selector
in WPF with a Dependency Property named ListItems
. When SelectedItems
is changed, I do:
// CollectionViewSource ListItems = ...
ListItems.Source = newSelectedItems;
ListItems.Refresh();
And in my ControlTemplate
I bind it to a ListBox
like this:
<ListBox ItemsSource="{TemplateBinding ListItems}"/>
But no开发者_开发技巧 items appear in my ListBox
.
I have also tried:
<ListBox ItemsSource="{Binding Source={TemplateBinding ListItems}}"/>
What am I missing here?
精彩评论