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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T10:49:40+00:00 2026-05-19T10:49:40+00:00

My (Surface)UserControls share a big amount of code. So I’d like to define an

  • 0

My (Surface)UserControls share a big amount of code. So I’d like to define an abstract super class where I can define this common code and behaviour.

But how do I define an abstract super class for a (Surface)UserControl? I tried to just subclass the code-behind file of a SurfaceUserControl, but then I get the following error:

Partial declarations of 'Prototype_Concept_2.views.DependencyExpander' must not specify different base classes  C:\Users\Roflcoptr\Documents\Visual Studio 2008\Projects\Prototype_Concept_2\Prototype_Concept_2\views\DependencyExpander.xaml.cs
  • 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-19T10:49:40+00:00Added an answer on May 19, 2026 at 10:49 am

    Deriving from SurfaceUserControl (or SurfaceControl or SurfaceContentControl or SurfaceItemsControl as appropriate) is definitely a good thing because it will make it easier for consumers of your control to work with Surface events on them. You are right though that this results in a lot of duplication of code.

    When we were building the Surface SDK, a lot of automated code generation was employed to mitigate this issue. If you use Reflector to look at how the Surface controls are implemented, you will see that there is very little logic built into the controls themselve
    are a few helper classes which contain a ton of logic that gets leveraged by each of the individual controls.

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

Sidebar

Related Questions

Whilst on the surface this question looks like it should be on serverfault.com I
I have a 3D surface, (think about the xy plane). The plane can be
Imagine that HTML page is a game surface (see picture). User can have n
I'm doing a Microsoft Surface Application and I have this problem: I use the
I have a surface project and I would like to use controls designed in
I'm doing a Surface Application. And there I have something like a bulletin board
On the surface, this is pretty simple, and I could implement it myself easily.
I know I can create a 3D surface plot in MATLAB by doing: x
I'm working on a class that is derived from the UserControl class. This class
Here is my surface-changed event handling code: public void surfaceChanged(SurfaceHolder holder, int format, int

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.