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 8503413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:45:08+00:00 2026-06-11T01:45:08+00:00

Is it possible to extend the Page-class in C#’s WPF-toolkit (or, respectively, any other

  • 0

Is it possible to extend the “Page”-class in C#’s WPF-toolkit (or, respectively, any other WPF-class)?
What i tried to do:

public class ExtendedPage : Page{
   protected void doStuff(){
      // lots of joy n pleasure
   }
}

public partial class RandomWindow : ExtendedPage{
   private void randomMethod(){
      doStuff(); // causes error
   }
}

The reason I’m asking is pretty obvious: After extending the Page-class (ExtendedPage), the subclass (RandomWindow) has no acces to the methods of its base.
This (at least it’s my guess) caused by the circumstance of RandomWindow being partial. Since this class unfortunately is generated by WPF (links to the corresponding *.xaml), I’m unable to locate the other part of the partial-class.

This question might lead to a pretty obvious answer that makes me look like a total moron, but apprently I’m unable to figure it out. I might add that I’ve just started working with C#, my programming origin is Java.

The exact error-message is “Partial declarations of ‘type’ must not specify different base classes” (CS0263).

As response to one of the comments: The declaration of “Page” in the *.xaml seems to generate an code-behind-file whose base-class is “Page” (and not ExtendedPage). Changing this seems not to work either, the compiler complains about the type ExtendedPage not being found.

<Page x:Class="...RandomWindow" ... />
// to
<src:ExtendedPage x:class="...RandomWindow" 
xlmns:src="...ExtendedPage" />
  • 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-06-11T01:45:09+00:00Added an answer on June 11, 2026 at 1:45 am

    Partial declarations of ‘type’ must not specify different base classes

    Well, that one’s a no-brainer, you probably have a XAML somewhere which looks like this:

    <Page x:Class="MyApp.MyNamespace.RandomWindow" ....>
    

    Implicitly specifying a Page as the base, you need however:

    <local:ExtendedPage x:Class="MyApp.MyNamespace.RandomWindow"
                        xmlns:local="clr-namespace:MyApp.NSContainingExtendedPage"
                        ...>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to extend the rich-text editor to add and other HTML5 elements?
Is it possible to extend dynamically javascript function scope? I tried without success the
Given two objects which extend a class: object PageDAO extends SalatDAO[Page, Long](collection=Config.getMongoDB(db_development)(pages)) object BookDAO
I have the following: <p>This is a test</p> <pre>public class Car { protected Car()
I want to be able to extend the System.Web.UI.Page class and then easily access
Would be possible to extend this kind of layout so that I can have
Is it possible to extend a base template with another template in Smarty? I
Is it possible to extend user's session expiration time in CI. What I want
Is it possible to extend multiple classes in Scala. For example if I have
Clojure structs can be arbitrarily extended, adding new fields. Is it possible to extend

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.