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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:48:04+00:00 2026-06-05T02:48:04+00:00

I would like to redefine a class of the core wpf API (UIElement), I

  • 0

I would like to redefine a class of the core wpf API (UIElement), I don’t want to inherit a class.

In have a project on the MS Kinect, I’ve re-implemented cursors mapped with the user’s skeleton’s hand. I’ve implemented similar event to those that the mouse raised (enter an elements, leave an element…). I want that all elements inheriting from UIElement to get some attached properties:

  KinectCursorEnter, KinectCursorMove...

and some Properties:

    public bool IsKinectLeftCursorOver { get; set; }
    public bool IsKinectLeftCursorDirectlyOver { get; set; }
    public bool IsKinectRightCursorOver { get; set; }
    public bool IsKinectRightCursorDirectlyOver { get; set; }
    public bool IsKinectLeftCursorCaptured { get; set; }
        ...

I know there’s a lot ways to mess things up if I change such a class, but that’s at this level that I want to add thoses properties. (UIElement already implement stuff such as MouseEnter, StylusEnter…). The Kinect is an input device as any other (mouse, stylus, keyboard…)

I’ve try:

  • To inherit UIElement and add the feature , but then I would have to
    reimplement all the Classes.

I’ve take a look:

  • If there’s such a thing as Ruby’s open classes
  • If I can use extension (link)
  • If I can use in any way Adapter pattern

So far I’m using use:

  • An interface and I redefine all element: I have a KinectButton that
    inherit from Button and implements IKinectInputElement but I can’t do that for some class which are sealed (Rectangle, Ellipse…)

I thing I a few months (years?) MSFT will implement those kind a Properties and method in Wpf API. But for now I need a way around.

PS: I don’t want to control the mouse with one of the hand of the user. there is one mouse, I want to have two cursors. and I have events such as : KinectLeftCursorEnter, KinectRightCursorEnter and so on..

  • 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-05T02:48:06+00:00Added an answer on June 5, 2026 at 2:48 am

    You can use Extension Methods to extend the class.

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

Sidebar

Related Questions

I have this C# class structure that I would like to refactor to use
I would like to redefine a class in c++ (non clr). Here's the reason
I would like a class B not to be able to redefine one of
I have some objects which have been created automatically by linq2SQL. I would like
Before you start reading I would like to clarify: I have already thought of
I would like to redefine some functions in my program on startup according to
I would like to add some code inside the function authenticate() of the Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager.
Would like to sort the following XML by joining the fsxml/formula/ingrrow where itemcode =
Would like to get a list of all packages available on CRAN to the
Would like to be able to set colors of headings and such, different font

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.