Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 931397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:29:39+00:00 2026-05-15T20:29:39+00:00

I created a WPF Window than i modified its class definition to: public partial

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T20:29:39+00:00Added an answer on May 15, 2026 at 8:29 pm

    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?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created the WPF user control and WPF window in class library project.
I've created a dependency property like this: public partial class MyControl: UserControl { //...
I created a WPF Window and made it a MEF Export. I can do
I've created a WPF Window with a lot of buttons, each of them run
I have the following grid in my WPF Window (yes the class Window); <Grid
I have a WPF Window defined in XAML like this: <Window x:Class=com.some.company.window xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
I am trying to create a child window in WPF.this child window should open
I have created a wpf application into which I have added a user control
I have created a wpf vb.net project and am trying to set a simple
I've created a WPF UserControl which contains a Button. I now want any consumer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.