Is there any event fired when a DataTemplate has been initiated in WPF?
- by Shimmy
Hello!
Take a look at the following xaml:
<ListBox ItemsSource="{Binding}">
<ListBox.Resources>
<CollectionViewSource x:Key="CVS"/>
</ListBox.Resources>
<ListBox.DataTemplate>
<DataTemplate OnBinding="myBinding">
<ListBox DataContext="{StaticResource CVS}" ItemsSource="{Binding}" />
</DataTemplate>
</ListBox.DataTemplate>
</ListBox>
So I can handle the binding and manually retrieve the CVS and set its Source property to my custom stuff according to the DataTemplate's DataContext.
Or else there is a different way in doing it.
Any ideas are welcommed!