Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

how to select easily a DataTemplate from App.Xaml

$
0
0

Dear all,

I have the following DataTemplate in my App.Xaml

<DataTemplate DataType="{x:Type vmodels:FilterViewModel}" ><!--<v:FilterView DataContext="{Binding}"/>--><v:NewFilterView DataContext="{Binding}"/></DataTemplate>

For the time being as you can see I have a commented FilterView but in my final app, I need to be able to select either the FilterView or the NewFilter view based on a Setting in my app.config

What woul be the best way to make this selection ?

IN orther control I have used TemplateSelector but here it is a bit different as I am dynamically instanciate proper control based on the same ViewModel

Thnaks for tips


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>