How to interact with asset in Mesh with mouse click event?

Aug 2, 2010 at 6:10 PM


       Is there a way to interact with the asset (basically a ASE file) in a Mesh. For example user click some part of the asset for example like car's tires, doors, hood...etc by clicking (uses's input) I want to handle that event by displaying a pop-up message. Here I wanted to know where exactly/which part of the asset the user clicks.  

Is there a way to achieve this by any means?

Help or suggestion in this regard is highly appreciated.


Thank you very much,




Aug 2, 2010 at 6:22 PM


Any object, like a Geometry has for Silverlight, the mouse events (MouseEnter, MouseLeave, MouseMove, MouseLeftButtonDown, MouseLeftButtonUp) and then there are something called ManipulationEvents that will give you more details. You have ManipulationStarted, ManipulationStopped and ManipulationDelta.

If you have an ASE file with multiple objects in it, you can't for now attach an event in Xaml to a sub object in the hierarchy, you would have to do it in code-behind by walking the Children collection and hooking the events manually.

Also worth mentioning. All Nodes has a property called Tooltip - so setting in Xaml for instance the Tooltip property to a text - any time the mouse is over - after a small period the tooltip will show up. 

Aug 2, 2010 at 7:05 PM
Edited Aug 2, 2010 at 7:07 PM

Thanks Adept for quick replay.

I am not able to find any events (Click/MouseEnter/Leave/LeftButtonDown/Up) in Mesh.Children property. Can you please guide me in this regard.

Can you post some sample?

I have an asset (ASE file) with many Parts. I wanted to attach click/MouseLeftButtonDown event to each part of my asset. Please help.

Thanks again.

Aug 2, 2010 at 7:31 PM

I'll see what I can do tomorrow and create a tutorial for you. I'm in a tutorial mode these days. :) 


Aug 2, 2010 at 7:34 PM

Thank you for your effort, I will be waiting for this. But can you quickly give some hint on this so that I can proceed, as it is very critical.


Aug 2, 2010 at 8:35 PM

Actually, if you add an event handler to the first node, the mesh - you'll still receive the events from the underlying objects in it. The reason for this is that Balder has a bubbling event mechanism - its not quite like the RoutedEvent, but it will bubble from the node that receives the event and up through the hierarchy. So your toplevel node should receive the event, even though its happening to a child of it. 

So in fact, disregard my previous comment - as I must have been confusing myself.. :)