In WPF model binding could be achieved by placing a DataTemplate with the viewmodel and view types in your app.xaml. You could then just bind a viewmodel to a contentpresenter and your view would change if you changed your view model through some kind of event.
Here's the old code:
App.xaml (AView and BView are just user controls)
<Application.Resources>
<DataTemplate DataType="{x:Type viewModels:AViewModel}">
<views:ViewA/>
</DataTemplate>
<DataTemplate DataType="{x:Type viewModels:BViewModel}">
<views:ViewB/>
</DataTemplate>
</Application.Resources>
Then on some kind of child view that contained the current context:
<ContentPresenter Content="{Binding CurrentViewModel}" />
(Much like https://stackoverflow.com/a/22376718/82333)
However datatemplate syntax no longer works. I've read up on x:bind, but doing a basic replace to the viewmodel type doesn't fix it.
Using this syntax:
<Application.Resources>
<DataTemplate x:Key="ViewAKey" x:DataType="viewModels:AViewModel">
<views:ViewA/>
</DataTemplate>
<DataTemplate x:Key="ViewBKey" x:DataType="viewModels:BViewModel">
<views:ViewB/>
</DataTemplate>
</Application.Resources>
Causes several errors:
Visual studio complains that the view models are not in the namespaces I supplied.
XBF generation error code 0x09c4.
What is the equivalent syntax for this operation in Windows 10 Universal Apps?
Application.Resourceswas no longer valid and I was receiving strange error messages. - C Bauer