I had an insulting problem ... Maybe someone can (please!) Help. I use a model that has and enumerates types and a property that should contain user interface models for each selected type from the enumeration: let it be defined as:
class ViewModel
{
Types selectedType{get;set;}
UiModelBase editedModel{get;set;}
}
I want to have a content control that uses a datatemplateselector to change its appearance every time I change the selected type.
<ListBox x:Name="RuleTypeList" ItemsSource="{Binding Source={StaticResource Types}}" SelectedItem="{Binding Path=selectedType}"/>
<ContentControl ContentTemplateSelector="{StaticResource ruleEditTemplateSelector}"
Content="{Binding SelectedItem, ElementName=RuleTypeList}"/>
PROBLEM: in the DataTemplates that I create to return using ruleEditTemplateSelector
DataContext - Type (I agree with this), but I need access to the Model editor to create my DataTemplate ... I donβt know how to deal with it
Thanks in advance!