开发者

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜