Sunday, May 13, 2007 6:30 AM
by
wpfedevcon
Using Silverlight Pad to Test XAML Content
Silverlight Pad is a Silverlight 1.0 Beta application that gives you a simple way to experiment with creating XAML content--the XAML you enter can be instantly rendered as Silverlight content. For example, I use Silverlight Pad to test features such as brushes and transforms. I see the results immediately!

Silverlight Pad Features
The Silverlight Pad application has three major areas:
- Sample XAML content Click the item in the scrollable list to load the sample and render it.
- XAML input edit box Enter the XAML syntax to test; then, click the Load button.
- Rendered XAML output Renders the XAML content contained in the input edit box.

Note: You do not need to specify a root object in the XAML input edit box, since you are dynamically adding content to an already existing Canvas object.
The Silverlight Pad application provides Zoom In and Zoom Out features that allow you to resize the rendered content:

Copying and Pasting XAML Content
The Silverlight Pad application allows you to easily test content by copying and pasting XAML content. First, remove the existing XAML content from the edit box. Next, paste the desired content, such as the XAML below, directly into the XAML input edit box. Finally, click the Load button to load and render the XAML content.
<!--
Linear gradient brush applied to text -->
<TextBlock
FontFamily="Verdana"
FontSize="32"
FontWeight="Bold">
LINEAR GRADIENT BRUSH
<TextBlock.Foreground>
<LinearGradientBrush
StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="Red" Offset="0.0" />
<GradientStop Color="Orange" Offset="0.2" />
<GradientStop Color="Yellow" Offset="0.4" />
<GradientStop Color="Green" Offset="0.6" />
<GradientStop Color="Blue" Offset="0.8" />
<GradientStop Color="Violet" Offset="1.0" />
</LinearGradientBrush>
</TextBlock.Foreground>
<!-- Scale height of TextBlock -->
<TextBlock.RenderTransform>
<ScaleTransform ScaleY="3.0" />
</TextBlock.RenderTransform>
</TextBlock>
For more information on creating interesting effects with text, see Text and Fonts Overview.
Downloading Silverlight Pad
You may want to download the Silverlight Pad application and run it locally on your machine, especially if you want to reference content, such as media files, in your text XAML content. The Silverlight Pad application can be downloaded from the Silverlight Gallery.
Enjoy,
Lorin
Silverlight SDK Team