Windowから継承するCustomPageという単純なクラスがあります。
public class CustomPage : Window
{
public string PageProperty { get; set; }
}
次のように、MainWindow の分離コードを CustomPage から継承する必要があります。
public partial class MainWindow : CustomPage
{
public MainWindow()
{
InitializeComponent();
}
}
残念ながら、次のエラーが表示されます。
Partial declarations of 'WpfApplication1.MainWindow' must not specify different base classes
MainWindow.xaml で x:Class を "WpfApplication1.CustomPage" に設定できますが、MainWindow.xaml で定義されている UI 要素にアクセスできないようです...