Partial declarations must not specify different base classes Partial declarations must not specify different base classes wpf wpf

Partial declarations must not specify different base classes


You have to change your CountryStandards XAML to:

<src:StandardsDefault x:Class="namespace.CountryStandards"     xmlns:src="NamespaceOfStandardsDefault" ... />

There is a good article about inheriting from a custom Window/Page in WPF.


Bit of an odd one, and it hasn't been listed here yet... But since none of the above answers applied because I had both my xaml and cs files declared correctly, I did the following and it seemed to work:

Go into the solution folder or click the show all files buton within Visual Studio and delete both the obj and bin folders, this causes Visual Studio to regenerate all of its files for the project.

Your project should now build/run correctly.

Hope that helps someone - or perhaps myself in the future.

Edit: This fix usually works if you get this problem after changing the page type from for example a ContentPage to a CarouselPage.


In your CountryStandards.xaml you should write

<StandardsDefault x:Class="namespace.CountryStandards"...