In the previous document, create a Silverlight project, you added a Silverlight control to an HTML page and created a blank XAML file. This document shows you how to begin creating Silverlight content inside your XAML file. step 1: create a Canvas and namespace declarationsOpen the [hide XAML] <Canvas xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> </Canvas> Each Silverlight XAML file begins with a step 2: draw something!Copy and paste the following code into your XAML file, between the
<Ellipse
Height="200" Width="200"
Stroke="Black" StrokeThickness="10" Fill="SlateBlue" />
step 3: view your XAML contentTo view your XAML content, double-click the hosting HTML file. You should see a slate-blue colored circle with a black border. [hide XAML] <Canvas xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Ellipse Height="200" Width="200" Stroke="Black" StrokeThickness="10" Fill="SlateBlue" /> </Canvas> [hide] [restart] Note that, if you have WPF installed, double-clicking on a XAML file will launch WPF, not Silverlight. Congratulations! You just created your first Silverlight project! Copyright © 2007 Microsoft Corporation. All rights reserved. Legal Notices. |