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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:30:10+00:00 2026-06-03T03:30:10+00:00

What I want to do is to know if the user click the red

  • 0

What I want to do is to know if the user click the red button of my joystick. (for the purpose, I draw over the real joystick graphic to keep our drawing private)
Our XAML 3D joystick

This joystick is a XAML 3D.

The red button is a GeometryModel3D object, with the x:Name “Geo_Btn_CSS_TAKE”. When I click on the joystick, I can do a HitTest, he gives me all the GeometryModel3D object but I can’t access to the x:Name, so I cannot know witch one is the good one…

Visual tree of my object

And this is how I do my HitTest:

private void OnTouchMouseDown(EventArgs e)
{
    Viewport3D viewport3D = WtoHitTest((Grid)Parent, e) as Viewport3D; // My own HitTest works well, I get my viewport3D

    Point mouseposition = WtoHelper.GetPositionFromEvent(e, viewport3D); // Get the point if it's a mouse event or touch event
    Point3D testpoint3D = new Point3D(mouseposition.X, mouseposition.Y, 0);
    Vector3D testdirection = new Vector3D(mouseposition.X, mouseposition.Y, 10);
    PointHitTestParameters pointparams = new PointHitTestParameters(mouseposition);
    RayHitTestParameters rayparams = new RayHitTestParameters(testpoint3D, testdirection);

    VisualTreeHelper.HitTest(viewport3D, null, HTResult, pointparams);
}

public HitTestResultBehavior HTResult(System.Windows.Media.HitTestResult rawresult)
{
    RayHitTestResult rayResult = rawresult as RayHitTestResult;

    if (rayResult != null)
    {
        RayMeshGeometry3DHitTestResult rayMeshResult = rayResult as RayMeshGeometry3DHitTestResult;

        if (rayMeshResult != null)
        {
            GeometryModel3D hitgeo = rayMeshResult.ModelHit as GeometryModel3D;

            **// HERE I NEED TO KNOW WHAT IS MY GEOMETRYMODEL3D'S X:NAME**
            // ANY IDEA???
        }
    }
    return HitTestResultBehavior.Continue;
}

What else I know:

  • My 3D object does not have a position (x,y) that I can bind to
  • I cannot insert non-3D element in the Viewport3D
  • I cannot access to the x:Name of a 3D object
  • 3D object or not FrameworkElement or Visual. They are Media3D

The way I did it, I only need to know the x:name to complete my implementation… if someone have a tips or an other way to go, let me know.

Thank you

EDIT: this is the properties of my 3D object:
enter image description here

  • 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-03T03:30:12+00:00Added an answer on June 3, 2026 at 3:30 am

    The one thing that I can think of that will work and is XAML friendly is to define your own attached property on GeometryModel3D. Look here for how to create custom attached properties.

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

Sidebar

Related Questions

I want to add a feature to our application that let's a user know
I want to know how many user click the ads on my application.Because of
I want to know column index of header in AdvancedDataGrid when a user clicks
I want to know when a user is touching the screen but not moving.
I want to know that Filename1, provided by the user is the same as
I'm using Google App Engine python. I want to know what browser the user
I want to know when the user clicks the menu item he should be
i want to set strikethough in text when user click the checkbox inside the
Goal: When a user click a exit button in the file > exit or
I'm making website that have notification 'button'. When user click this button, notification div

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.