That would be in the declaration of myWindow
itself - 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 Window
subclass:
using System.Windows;
namespace WpfApplication
{
public class EnhancedWindow : Window
{
}
}
My XAML:
<y:EnhancedWindow x:Class="WpfApplication.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:y="clr-namespace:WpfApplication"
Title="MainWindow" Height="350" Width="525">
</y:EnhancedWindow>
My partial type:
namespace WpfApplication
{
public partial class MainWindow : EnhancedWindow
{
public MainWindow()
{
InitializeComponent();
}
}
}
It all builds with no problem. I think that's what you wanted to do, right?
Jon Skeet
2010-07-07 18:47:56