I created a WPF Window
than i modified its class definition to:
public partial class myWindow : mySubclassedWindow
compiler throws:
"Partial declarations of ‘myWindow’ must not specify different base classes"
myWindow.Xaml:
x:Class="WpfGridtest.myWindow"
so somewhere, there is another partial class, that inherits from "Window" but i cannot find it. How can i override my case to use subclassed window?
thanks Jon, that was the problem.
also found this helpful article:
Link
That would be in the declaration of
myWindowitself – the designer will be generating the other half of the partial type based on the XAML, based on your element type.You can use an element of
<mySubclassedWindow>instead, so long as you give it the appropriate namespace and assembly references.EDIT: Okay, so here’s a short example, in a project called WpfApplication. My
Windowsubclass:My XAML:
My partial type:
It all builds with no problem. I think that’s what you wanted to do, right?