Moving from WPF 3.5 to 4.0 results in the error "Unable to put the page in style",

Now I am moving my application from .NET 3.5 to .NET 4.0, and I get the following error message: "Unable to put the page in style." I applied the MVVM template for this application and used data templates to tell the application how to display my various view models ... for example below.

<DataTemplate DataType="{x:Type vm:ConfigureAxViewModel}">
    <vw:ConfigureAxPage />
</DataTemplate>

Is there any way around this error? Should I manage my pages?

Thanks Roy

+5
source share
2 answers

Documents for 3.5 and 4.0:

Window, NavigationWindow, Frame .

, , - UserControls. ...

+1

Visual Studio 2010. , , App.xaml

<DataTemplate DataType="{x:Type vm:LoginViewModel}">
     <views:Login />
</DataTemplate>

(, "", ?) , , Login - . , . DataContext xaml:

DataContext="{Binding LoginPage,Source={StaticResource Locator}}

MVVM Light, Locator.

0

All Articles