Reputation: 13
Image of the main window with the 3D objects
I have imported two 3D models as you can see in the image from the link above in to my WPF project and i would like to ask how i could add trigger that would open another window from this main window based on a mouse clicking on one of those 3D objects that would have a trigger applied to it
Upvotes: 0
Views: 86
Reputation: 242
What type is the 3D Model ? If you are using a ModelUIElement3D, you can attach a mousedown event to both of the models like such.
model1.MouseDown += (sender,e) => CreateNewWindow("First");
model2.MouseDown += (sender,e) => CreateNewWindow("Second");
Then you can open a new window according to the parameter sent using this CreateNewWindow(string windowToOpen) function
Upvotes: 1