• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4568
  • Last Modified:

C# WPF Partial declaration must not specify different base class


I am trying to learn how to make a WPF application. I am having a few issues one of them being the error message "Partil declaration of WPF_Test.MainWindow must not specify different base classes".

The code below is an example of a very quick WPF application that gives this error message. My application has more code in but even this simple application is being a pain! Please see the code below.

Any help would be great!


<RibbonWindow x:Class="WPF_Test.MainWindow"
        Title="MainWindow" Height="350" Width="525">

Open in new window

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Ribbon;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WPF_Test
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
        public MainWindow()

Open in new window

1 Solution
Gautham JanardhanCommented:
if u see ur xaml it inherits from RibbonWindow , while ur code behind is from Window, change that to RibbonWindow

public partial class MainWindow : RibbonWindow
        public MainWindow()

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now