O'Reilly logo

Pro Silverlight 5 in VB by Matthew MacDonald

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

Basic 3D Drawing

In Silverlight, all 3D drawing takes place inside a control called DrawingSurface, which is found in the System.Windows.Controls namespace. DrawingSurface is an ordinary Silverlight control, which means you don't need any to add any assembly references or import any namespaces to use it. Usually, you'll place the DrawingSurface in a container with a black background, so the content can be drawn overtop:

<Grid x:Name="LayoutRoot" Background="Black">   <DrawingSurface Width="400" Height="300"></DrawingSurface> </Grid>

When you add the DrawingSurface control to a page, you can give it fixed dimensions (as in this example), which allows you to write the simplest drawing code. Or, you can let the drawing surface expand to fill its ...

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