O'Reilly logo

XAML Unleashed by Adam Nathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Viewport2DVisual3D

The Viewport2DVisual3D class allows live interactive 2D content to be directly mapped to a 3D surface. A Button mapped onto a 3D sphere actually responds to mouse clicks in 3D. A TextBox drawn on the face of a cube can be edited with the mouse and keyboard, just as you would expect. Touch input can be used to manipulate 2D elements mapped into 3D space. Even context menus for features such as spelling correction on a TextBox work!

Listing 8.7 demonstrates how Viewport2DVisual3D is used with a simple Button. You provide the Viewport2DVisual3D with a MeshGeometry3D, a Material, and a target Visual. The interactive Material needs the Viewport2DVisual3D.IsVisualHostMaterial attached property set to true. If a Brush is associated ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required