Steps to implement DataTemplateSelector in ContentControl.
1. Create a class that inherits DataTemplateSelector.
2. Implement method SelectTemplate.
public override DataTemplate SelectTemplate(object item, DependencyObject container)
{
code here
}
3. In your XAML under resource, declare all data templates you wish to as example below.
4. Initialize your datatemplate selector class in reference to step number 1.
5. Under ContentControl:
No comments:
Post a Comment