Click here to Skip to main content
15,885,925 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created four 3D cubes(something that looks like cube) using C# as codebehind in WPF and I would like to add a tooltip (or a tag) to them when they appear on the screen. When I move my mouse over the cube, the tooltip should display "cube1" or "cube2"

this is just a part of a method i've written to create a cube in C#.

meshgeometry = new GeometryModel3D(mesh, diffmaterial);
ModelUIElement3D m = new ModelUIElement3D();
m.Model = meshgeometry;
visual.Children.Add(m);

This method is called four times with in the constructor. I would like to address (or access) individual cubes and give them a tag ? How can i do this ? please help.I am stuck. Can i do something like Children[0]."something" to access every cube ? I am a beginner and please go easy on me.
Posted

1 solution

To give them a Tag property, you might be able to use an attached property[^].
 
Share this answer
 
Comments
steersteer 31-Aug-11 10:03am    
thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900