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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:37:56+00:00 2026-06-03T09:37:56+00:00

I know the question sound somewhat stupid, but i have this scenario. Context I

  • 0

I know the question sound somewhat stupid, but i have this scenario.

Context

I am creating 2 background tasks (METRO apps, winRT) which have much parts in common.
Now what i want is, a common base class defining common functionality, and 2 task to be derived from base class.

Problem: Background task should be targetted WinMD, and in this mode, it is not possible to create non sealed public class. If i create sealed, i cannot derive from it, and if i create private, i cannot expose the derived types because base is private.

Concern: What are the ways to achieve the desired functionality. (derived public types from private base). One way could be use of Composition (instead of inheritance)

  • 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-03T09:37:57+00:00Added an answer on June 3, 2026 at 9:37 am

    You simply can’t. .NET doesn’t allow you to make a derived type more accessible than the base type. You’ll have to expose the base type.

    Note that if you only give it internal constructors, then other code won’t be able to instantiate it or create their own derived types… what’s the problem with exposing it at that point?

    EDIT: Okay, I’ve just reread the question, and seen this:

    it is not possible to create non sealed public class

    So:

    • Could you make all the types involved internal?
    • Could you make it a public abstract class? (Does WinMD allow that?)

    (If you have any other documentation around what’s allowed in WinMD, that would be useful.)

    If you’re allowed to export interfaces, perhaps you could have your base class and derived classes internal, but make them implement public interfaces. Then have public static methods in a public static class to create instances of these internal types and return them via the interface. Again, I don’t know if this is allowed – if you have any links to documentation around what’s allowed in WinMD, that would be useful for those of us who haven’t done any WinRT development.

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

Sidebar

Related Questions

I know this question is going to sound very stupid but here goes nonetheless.
I know this question might sound quite stupid, but I've tried my best and
i know this question may sound stupid to you guys, but i am a
This question may sound stupid but I wana know When do we put activity
This question might sound a bit stupid but here it goes. I have two
I know this question might sound quite silly, but I somehow found myself stuck
This might sound a bit of an odd question but I know what I
I know the question sounds silly, but consider this: I have an array of
I know this question will sound like a from the past thing but I
I know that my this question may sound pathetic to you but as a

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.