<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jesse Liberty &#187; Search Results  &#187;  tour</title>
	<atom:link href="http://jesseliberty.com/search/tour/feed/rss2/" rel="self" type="application/rss+xml" />
	<link>http://jesseliberty.com</link>
	<description>Code To Live. Live To Code.</description>
	<lastBuildDate>Tue, 31 Jan 2012 17:18:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Yet Another Podcast #14 &#8211; Shawn Wildermuth</title>
		<link>http://jesseliberty.com/2010/11/15/yet-another-podcast-14-shawn-wildermuth/</link>
		<comments>http://jesseliberty.com/2010/11/15/yet-another-podcast-14-shawn-wildermuth/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 14:52:26 +0000</pubDate>
		<dc:creator>Jesse Liberty</dc:creator>
				<category><![CDATA[Patterns & Skills]]></category>
		<category><![CDATA[YapCast]]></category>

		<guid isPermaLink="false">http://jesseliberty.com/2010/11/15/yet-another-podcast-14-shawn-wildermuth/</guid>
		<description><![CDATA[Talking with Shawn Wildermuth about Silverlight, Windows Phone, Data and more.  http://wildermuth.com http://silverlight-tour.com http://agilitrain.com Listen &#124; Return to Yet Another Podcast Call in comments:  1-347-YAP-CAST]]></description>
			<content:encoded><![CDATA[<p>Talking with Shawn Wildermuth about Silverlight, Windows Phone, Data and more.  <a href="http://jesseliberty.com/wp-content/uploads/2010/11/stwhead_640.png"><img class="alignright size-medium wp-image-4034" title="stwhead_640" src="http://jesseliberty.com/wp-content/uploads/2010/11/stwhead_640-240x300.png" alt="Shawn Wildermuth" width="240" height="300" /></a></p>
<ul>
<li><a href="http://wildermuth.com">http://wildermuth.com</a></li>
<li><a href="http://silverlight-tour.com">http://silverlight-tour.com</a></li>
<li><a href="http://agilitrain.com">http://agilitrain.com</a></li>
</ul>
<p><a href="http://jesseliberty.com/wp-content/media/Show14.mp3" target="_blank">Listen</a> | Return to <a href="http://jesseliberty.com/podcast" target="_blank">Yet Another Podcast</a></p>
<p>Call in comments:  <strong>1-347-YAP-CAST</strong></p>
<table style="border-color: white;">
<tbody>
<tr>
<td style="border-color: white;"><a href="http://feeds.feedburner.com/JesseLibertyYapcast"><img style="margin: 10px 0px; display: inline; border-width: 0px;" title="rss" src="http://jesseliberty.com/wp-content/uploads/2010/10/rss_thumb.jpg" border="0" alt="rss" width="29" height="26" align="right" /></a></td>
<td style="border-color: white;"><a href="http://itunes.apple.com/us/podcast/id393751871"><img style="margin: 10px 0px; display: inline; border-width: 0px;" title="iTunes" src="http://jesseliberty.com/wp-content/uploads/2010/10/iTunes_thumb.jpg" border="0" alt="iTunes" width="94" height="31" align="right" /></a></td>
<td style="border-color: white;"><a href="http://social.zune.net/redirect?type=podcastseries&amp;id=00c3fa7b-0fdf-4936-a1cf-92caacb08775"><img class="alignnone size-full wp-image-3967" title="zune" src="http://jesseliberty.com/wp-content/uploads/2010/11/zune.jpg" alt="" width="87" height="38" /></a></td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://jesseliberty.com/2010/11/15/yet-another-podcast-14-shawn-wildermuth/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
<enclosure url="http://jesseliberty.com/wp-content/media/Show14.mp3" length="21034389" type="audio/mpeg" />
		</item>
		<item>
		<title>i2W: An iPhone Developer’s First Windows Phone 7 Application</title>
		<link>http://jesseliberty.com/2010/08/27/i2w-an-iphone-developers-first-windows-phone-7-application/</link>
		<comments>http://jesseliberty.com/2010/08/27/i2w-an-iphone-developers-first-windows-phone-7-application/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 16:26:57 +0000</pubDate>
		<dc:creator>Jesse Liberty</dc:creator>
				<category><![CDATA[iPhoneToWP7]]></category>
		<category><![CDATA[Mini-Tutorial]]></category>
		<category><![CDATA[Tools and Utilities]]></category>
		<category><![CDATA[WindowsPhone]]></category>
		<category><![CDATA[convert]]></category>
		<category><![CDATA[i2WTutorial]]></category>
		<category><![CDATA[migrate]]></category>
		<category><![CDATA[wp7Tutorial]]></category>

		<guid isPermaLink="false">http://jesseliberty.com/2010/08/27/i2w-an-iphone-developers-first-windows-phone-7-application/</guid>
		<description><![CDATA[Go to first Tutorial In this tutorial we will build a meaningful, and nontrivial Windows phone 7 application. This will give us the opportunity to explore layout controls, interactive controls, Visual Studio and a good bit more. [Updated 8/30/2010] Let&#8217;s &#8230; <a href="http://jesseliberty.com/2010/08/27/i2w-an-iphone-developers-first-windows-phone-7-application/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://jesseliberty.com/wp-content/uploads/2010/08/i2WLogo21.jpg"><img style="margin: 10px 0px; display: inline; border-width: 0px;" title="i2WLogo2" src="http://jesseliberty.com/wp-content/uploads/2010/08/i2WLogo2_thumb1.jpg" border="0" alt="i2WLogo2" width="320" height="63" /></a></p>
<p><a href="http://jesseliberty.com/2010/08/23/i2w-an-iphone-developers-guide-to-creating-windows-phone-7-applications-tutorial/" target="_blank">Go to first Tutorial</a></p>
<p>In this tutorial we will build a meaningful, and nontrivial Windows phone 7 application. This will give us the opportunity to explore layout controls, interactive controls, Visual Studio and a good bit more.</p>
<p>[Updated 8/30/2010]</p>
<p><span id="more-3315"></span><a href="http://jesseliberty.com/wp-content/uploads/2010/08/form.jpg"><img style="border-width: 0px; margin: 10px 25px 10px 0px; float: left; display: inline;" title="form" src="http://jesseliberty.com/wp-content/uploads/2010/08/form_thumb.jpg" border="0" alt="form" width="177" height="240" /></a> <strong>Let&#8217;s start by taking a look at the application were going to build.</strong></p>
<p>The application <strong>opens with a form</strong>, and that form is <strong>populated by data binding</strong>.</p>
<table border="2" cellspacing="0" cellpadding="2" width="500">
<tbody>
<tr>
<td width="500" valign="top">Note: All images are cropped. To see the full size (but still cropped) version, double click on the image</td>
</tr>
</tbody>
</table>
<p>Let’s walk through the creation of this first demo program step by step.</p>
<table border="2" cellspacing="0" cellpadding="2" width="500">
<tbody>
<tr>
<td width="500" valign="top">
<h3>A Word On The Development Environment</h3>
<p>Before we begin, let me note that I make the assumption that you are a professional iPhone developer, and thus are not afraid to invest in purchasing the right tools.</p>
<p>While, as noted in the previous tutorial, it is possible to write Windows Phone 7 applications using Visual Studio Express, I will demonstrate using Visual Studio 2010 Ultimate.</p>
<p>In addition, as a practical matter, MVVM (the principle design pattern for Windows Phone 7) is easiest when supported by a library, and so I will use the <em>free</em> <a href="http://mvvmlight.codeplex.com/" target="_blank">MVVM Light Toolkit</a>.</p>
<p>Additionally, you’ll notice that my screen shots include a menu member <a href="http://jesseliberty.com/2010/05/28/code-rush-vs-resharper/" target="_blank">Resharper and/or Code Rush</a>; using one of these two supplements to Visual Studio is not required, but they do provide a far more efficient programming experience.</td>
</tr>
</tbody>
</table>
<h3>Visual Studio, Expression Blend, XCode and Interface Builder</h3>
<p>It is tempting to draw a <strong>parallel</strong> in which<strong> Visual Studio maps to XCode</strong> and <strong>Expression Blend maps to Interface Builder</strong>.  This isn’t wrong so much as incomplete, because you <strong><em>can</em> create your entire interface in Visual Studio</strong> (and many folks do) but <strong>for more</strong> <strong>advanced UI development, Blend is the tool of choice</strong>.  We <em>could </em>start off by creating the form itself in Blend (and some would argue we should) but we’ll keep things simple by doing all our work for now in Visual Studio, introducing Blend in a following tutorial.</p>
<h3>Solutions, Projects and Files, Oh My</h3>
<p><a href="http://jesseliberty.com/wp-content/uploads/2010/08/MVVMForPhone.jpg"><img style="margin: 10px 20px 10px 0px; display: inline; border-width: 0px;" title="MVVM For Phone" src="http://jesseliberty.com/wp-content/uploads/2010/08/MVVMForPhone_thumb.jpg" border="0" alt="MVVM For Phone" width="240" height="128" align="left" /></a> To begin, <strong>open Visual Studio</strong>, click on <em>New Project</em> and in the left pane (Templates) choose <em>Visual C#</em> and then <strong><em>Silverlight For Windows Phone 7</em>.</strong> In the right hand side, choose the MVVM Light Toolkit. Give Visual Studio 2010 a few minutes to settle down and you’ll find that Visual Studio 2010 and the MVVM Light Toolkit have cooperated to create a project with numerous files and folders.  You can see these in Solution Explorer window, which is typically on the upper left hand side of your development environment and which you can open either from the menu (View-&gt;Solution Explorer) or with the hot keys that are shown on the menu.</p>
<p>Because<strong> all such windows can be opened from a menu</strong>, I will eschew walking you through each, and will only point out those menu choices which may be otherwise confusing.</p>
<p>For now, we’ll ignore the Properties and Reference items (though feel free to explore on your own, just take a compass and plenty of rope and you’ll be fine).</p>
<p>The key files we care about right now are MainPage.xaml and, under the ViewModel folder MainViewModel.cs.  The former, MainPage.xaml has an associated <em>code behind</em> file which you can expose with the very familiar turn down.</p>
<p><strong>Double click on MainViewModel.cs</strong> to populate the edit windows. Your initial view will be a split pane with the <strong><em>design view</em> on one side and the <em>code view</em> on the other</strong>.  The code view, in this case, will be populated with a good bit o<strong>f</strong> Xaml.  We’ll close the Xaml window for now to focus on the Design view.</p>
<h3>A Very Quick Tour of Visual Studio</h3>
<p>To close the Code View make sure the Design View it is on the left (you can switch it with the double arrow button <a href="http://jesseliberty.com/wp-content/uploads/2010/08/DoubleArrow.jpg"><img style="margin: 10px 0px; display: inline; border-width: 0px;" title="DoubleArrow" src="http://jesseliberty.com/wp-content/uploads/2010/08/DoubleArrow_thumb.jpg" border="0" alt="DoubleArrow" width="21" height="24" /></a> between the panes) and then click the double-arrowhead <a href="http://jesseliberty.com/wp-content/uploads/2010/08/DoubleArrowHead.jpg"><img style="margin: 10px 0px; display: inline; border-width: 0px;" title="DoubleArrowHead" src="http://jesseliberty.com/wp-content/uploads/2010/08/DoubleArrowHead_thumb.jpg" border="0" alt="DoubleArrowHead" width="19" height="16" /></a> to close the code view. Finally, make sure that the Properties window is  visible on the right (F4) and the toolbox is pinned open on the left ( Control-Alt-X).  In the illustration below, I’ve labeled 7 areas. Let’s go over them one by one:</p>
<p><a href="http://jesseliberty.com/wp-content/uploads/2010/08/VisualStudio.jpg"><img style="margin: 10px auto; display: block; float: none; border-width: 0px;" title="Visual Studio" src="http://jesseliberty.com/wp-content/uploads/2010/08/VisualStudio_thumb.jpg" border="0" alt="Visual Studio" width="640" height="449" /></a></p>
<p>Area 1 is the <strong>toolbox</strong>. Note that at the upper right hand corner (circled) are three symbols. The first allows you to</p>
<p>Area 2 is the <strong>Application String</strong> and Area 3 is the <strong>Page Title</strong> string; we’ll return to these shortly.</p>
<p>Area 4 is the ContentPanel  and we’ll be doing most of our design work here.</p>
<p>Area 5 is the <strong>Solution Explorer</strong>, which is above the Properties window by convention (you can of course move any window to any position)</p>
<p>The <strong>properties window</strong> is divided into area 6, where the name of the selected object is set and where you can switch the properties window from Properties view to Events view (more on events later in this tutorial).  Area 7 is where the properties are set (you can see some of the Text properties exposed in this illustration).</p>
<p>Note the arrows emanating from the design panel.  The upper two are used to switch between Code and Design when one of the windows is hidden.  The lower three split the window vertically or horizontally, and reveal (or hide) the right hand (or lower) window respectively.</p>
<p><a href="http://jesseliberty.com/wp-content/uploads/2010/08/OnlineHelp.jpg"><img style="margin: 10px 25px 10px 0px; display: inline; border-width: 0px;" title="Online Help'" src="http://jesseliberty.com/wp-content/uploads/2010/08/OnlineHelp_thumb.jpg" border="0" alt="Online Help'" width="219" height="240" align="left" /></a> Above all of this is the menu and of course the most important menu entry is Help, which offers a variety of ways to receive help. To see one of its most powerful features at work, place the cursor anywhere in the RowDefinition keyword (approximately line 47) and press F1.  The first time you press F1 you’ll be asked if you want to use local or internet help. If you have an internet connection, by all means ask for online help. A browser window will open with help on the RowDefinition keyword. Sweet.</p>
<p>As of this writing the on-line help file has tabs for each supported language. We’ll use the C# tab (which will set the C# tab for the entire page and which is sticky and thus persists to the next time you open the window).</p>
<p>Each entry follows the pattern of identifying the class, the namespace and assembly (we’ll cover both as we go). Syntax is demonstrated by language, and the <em>Remarks </em>section provides detailed information and links to related topics.</p>
<p>The examples section follows the Remarks section and provides copyable code to get you started.</p>
<p>After the Examples come the Inheritance Hierarchy, showing where your class fits in, and notes on Thread Safety, Platform, Versions and, finally a See Also section for related topics.</p>
<p>You also have much of this information locally in Silverlight.chm – a Windows Help file that was loaded when you installed Silverlight.</p>
<h3>Creating The Form</h3>
<p>Let’s return to the project and begin to create the form. <strong>For now we’re going to do all the work in the design view</strong>, though you’ll see later that everything done in Design view instantly updates the Xaml view, and vice versa.</p>
<h4>Layout Controls</h4>
<p><strong>It is common to distinguish those controls used for layout from those used for interacting with the user</strong>, though the distinction is, in truth arbitrary.  In any case, there are quite a few layout controls, though <strong>the two we care most about are the Grid and the StackPanel</strong>.</p>
<p>The Grid is the most powerful and (nearly) ubiquitous layout control – something of a UITableView on steroids. Click in the Content Panel (area 4 above) and the edges of the Grid that was placed there for you will light up.   Move your cursor in the margin and lines will appear. Click and horizontal lines become rows, vertical lines become columns.  You’ll want to create two columns (the left taking about 1/3 of the grid) and 8 rows of approximately equal size.</p>
<p>Click in the Grid and notice that the properties window has a ColumnDefinitions property and a RowDefinitions Property.  Here you can make the spacing more exact.  You can do so with precise sizes (e.g., 25px) or with percentages, or with relative sizing (e.g., 2* and 3* will create two columns with the first taking 2/5 of the available space.).  I chose 1* (which you can shorten to *) and 2* for the columns, and seven rows of 1*.</p>
<p>You can of course open these instead of creating the rows and columns first in the designer.</p>
<h3>Setting the Application Name and the Page Title</h3>
<p>Click on the Application Title or the Page Title (areas 2 and 3 above)</p>
<p><a href="http://jesseliberty.com/wp-content/uploads/2010/08/PropertiesForFirstTextBlock.jpg"><img style="margin: 10px 30px 10px 0px; display: inline; border-width: 0px;" title="Properties For First TextBlock" src="http://jesseliberty.com/wp-content/uploads/2010/08/PropertiesForFirstTextBlock_thumb.jpg" border="0" alt="Properties For First TextBlock" width="240" height="162" align="left" /></a> <strong>We’ll use the left column for the prompts</strong>. Drag a <strong>TextBlock</strong> (used for displaying text) into the first row (row offset 0), first column and place it more or less in the center. Then switch over to the properties window and set the following properties:</p>
<ul>
<li>Name=NamePrompt  (In area 6 above)</li>
<li>Common::Text=Full Name</li>
<li>Layout::Width=auto</li>
<li>Layout::Height=30</li>
<li>Layout::HorizontalAlignment=Right</li>
<li>Layout::VerticalAlignment=Center</li>
<li>Margin=5</li>
<li>Layout::Padding=0</li>
<li>Layout::MinWidth=30</li>
<li>Layout::MinHeight=30</li>
<li>Layout::MaxWidth=0</li>
<li>Layout::MaxHeight=0</li>
<li>Layout::Grid.Column=0</li>
<li>Layout::Grid.Columnspan=1</li>
<li>Layout::Grid.Row=0</li>
<li>Layout::Grid.Rowspn=1</li>
</ul>
<h4>Adding the Remaining Prompts</h4>
<p>Drag six more prompts onto the form, setting them identically, except for the Text and the Row.  The rows will be 1,2,3,4,5 and 7 and the Text will be</p>
<ul>
<li>Street Address</li>
<li>City, State, Zip</li>
<li>Phone</li>
<li>Fax</li>
<li>Email</li>
<li>Notes</li>
</ul>
<p>You can leave all the rest alone except that under Text you’ll want to <strong>click the Bold button</strong> and you’ll want to set the prompt names (or use the default as the only reason to have meaningful names is when you need to address the objects programmatically, which we won’t do with these labels) and don’t forget to set the Grid.Row appropriately.</p>
<p>The row you skipped will be used for the Male &amp; Female RadioButtons without a prompt.</p>
<table border="2" cellspacing="0" cellpadding="2" width="500">
<tbody>
<tr>
<td width="500" valign="top">The fact that so many of the properties are identical may be giving you the willies. Not to worry, we can fix this with Styles, a topic taken up in a future tutorial.  The complete Xaml is below, to facilitate cut and paste.</td>
</tr>
</tbody>
</table>
<h4>Adding the Input Controls</h4>
<p>Next, you’ll want to<strong> add the input controls</strong>. Add <strong>TextBox</strong> objects to rows 0,1,3,4,5 and 7 . Set the following properties:</p>
<ul>
<li>Name=Name (or StreetAddress, etc.)</li>
<li>Common::Text=Full Name (or street address, etc.)</li>
<li>Layout::Width=300</li>
<li>Layout::Height=70</li>
<li>Layout::HorizontalAlignment=Left</li>
<li>Layout::VerticalAlignment=Center</li>
<li>Margin=5</li>
<li>Layout::Padding=0</li>
<li>Layout::MinWidth=30</li>
<li>Layout::MinHeight=30</li>
<li>Layout::MaxWidth=0</li>
<li>Layout::MaxHeight=0</li>
<li>Layout::Grid.Column=0</li>
<li>Layout::Grid.Columnspan=1</li>
<li>Layout::Grid.Row=0</li>
<li>Layout::Grid.Rowspn=1</li>
</ul>
<h3>Using the Stack Panel</h3>
<p>You skipped over the input control for row 2 (the third from the top) because you want to place three text boxes in that row (for city, state and zip, respectively).  If you just set all three to the same row and column they will appear on top of one another. What you want is to “stack” them, but in this case not one on top of the other, rather one next to the other.</p>
<p>Drag a StackPanel onto the form and set its properties as follows:</p>
<li>Common:Orientation = Horizontal</li>
<li>Layout::HorizontalAlignment=Stretch</li>
<li>Layout::VerticalAlignment=Stretch</li>
<li>Margin=0</li>
<li>Layout::Padding=0</li>
<li>Layout::MinWidth=0</li>
<li>Layout::MinHeight=0</li>
<li>Layout::MaxWidth=Infinity</li>
<li>Layout::MaxHeight=Infinity</li>
<li>Layout::Grid.Column=0</li>
<li>Layout::Grid.Columnspan=1</li>
<li>Layout::Grid.Row=0</li>
<li>Layout::Grid.Rowspn=1Setting the Horizontal and vertical Alignments to stretch with no margin causes the StackPanel to expand to fill the cell. Next, place three TextBox controls within the StackPanel (on top) and set their properties as follows:
<ul>
<li>Name=City</li>
<li>Width=150</li>
<li>Height=70</li>
<li>HorizontalAlignment=Left</li>
<li>VerticalAlignment=Bottom</li>
<li>Margin=0,0,0,5</li>
<li>Text=City</li>
<li>Name=State</li>
<li>Width=74</li>
<li>Height=70</li>
<li>Margin=0,0,0,5</li>
<li>Text= State</li>
<li>Name=Zip</li>
<li>Width=93</li>
<li>Height=70</li>
<li>Margin=0,0,0,5</li>
<li>Text= Zip</li>
</ul>
<p>Notice that controls within the StackPanel do <em>not </em>need Grid coordinates.</p>
<p>Finally, you’ll want to add the two RadioButtons in row offset 6.  Again create a StackPanel, and within the StackPanel place two RadioButton controls:</p>
<ul>
<li>Name=Male</li>
<li>Content=Male</li>
<li>GroupName=Sex</li>
<li>IsChecked=True</li>
<li>Name=Female</li>
<li>Content=Female</li>
<li>GroupName=Sex</li>
<li>IsChecked=False</li>
</ul>
<p>The GroupName creates a Radio Button Group allowing the buttons to be mutually exclusive.</p>
<p>That is your UI.</p>
<h3>Running the Application</h3>
<p>Before we go any further, if you haven’t yet done so, <strong>run the application</strong>.  You can do this by clicking Build-&gt;Rebuild Your First Application (or control-shift-B) and then clicking Debug-&gt;Run (F5) or you can skip the first step and just run, as that will force a rebuild.  Your application will come up in the emulator, with populated fields!  Hoo ha!</p>
<p>When you are done enjoying the first version of your app, stop debugging (press the stop debugging button on the toolbar or Debug-&gt;Stop Debugging) but do not close the emulator.  The emulator takes a while to “boot up” and you can leave it running; it will attach to your program each time you rebuild and re-run.</p>
<h3>Data Binding</h3>
<p>Unfortunately, we are rarely called upon to populate a form with known values. <strong>Somewhat more common is to populate the form from data, often data retrieved from a database, possibly via a web service</strong>.  We won’t worry about how to retrieve the data in this tutorial, but let’s take the plunge into Data Binding – the technology of telling the View how to obtain the data it needs.  Since we are doing this with MVVM, we’ll have the ViewModel obtain the data from the Model, message it as required by business rules and then use binding to allow the View to have no code in the MainPage.xaml.cs file. (This greatly assists with testing).</p>
<p>To make this work we need to do two things:</p>
<ul>
<li>Create data in the Model</li>
<li>Create the View Model with public properties to which each control can bind</li>
<li>Update the View…</li>
</ul>
<p>Ok, Three Things, we need to</p>
<ul>
<li>Create data in the Model</li>
<li>Create the View Model with public properties to which each control can bind</li>
<li>Update the View setting each control’s binding</li>
<li>Set the data…</li>
</ul>
<p>Four things! Yes! Four things…</p>
<ul>
<li>Create data in the Model</li>
<li>Create the View Model with public properties to which each control can bind</li>
<li>Update the View setting each control’s binding</li>
<li>Set the data context</li>
<li><a href="http://en.wikipedia.org/wiki/The_Spanish_Inquisition_(Monty_Python)" target="_blank">Pretty Red Uniforms</a></li>
</ul>
<h3>Create Data In The Model</h3>
<p>While in a “real” application you’ll get your data from a data source such as a web service (which may in turn get the data from a database) for now we’ll create an instance of a “Customer” class right in local code. Create a Customer.cs class in the Model folder that looks like this:</p>
<pre class="brush: xml;">using System;

namespace Your_First_Application.Model
{
    public class Customer
    {

        public string First { get; set; }
        public string Last { get; set;  }
        public string Address { get; set; }
        public string City { get; set; }
        public string State { get; set; }
        public string Zip { get; set; }
        public string HomePhone { get; set; }
        public string WorkPhone { get; set; }
        public string Fax { get; set; }
        public string WorkEmail { get; set; }
        public string HomeEmail { get; set; }
        public bool IsMale { get; set; }
        public string Notes { get; set; }
        public int CreditRating { get; set;  }
        public DateTime FirstContact { get; set; }
        public DateTime LastContact { get; set; }

    }
}</pre>
<h4>C# For Objective-C Programmers</h4>
<p>These are called “automatic” properties.  When you write</p>
<pre class="brush: xml;">public string First { get; set; }</pre>
<p>the compiler treats it exactly as if you had written</p>
<pre class="brush: xml;">private string _secretvariable
public string First
{
   get { return _secretVariable; }
   set { _secretVariable = value; }
}</pre>
<p>That is, it is as if you had created a <em>backing store</em> for the value (in this case the string _secretVariable) and the get accessor returned that value. The set accessor sets the value of the backing store to the value passed in to the set accessor. Here’s how you use either form</p>
<pre class="brush: xml;">First = "Mary";        // call the setter
//....
string fn = First;     // call the getter</pre>
<p>The first line calls the setter and the string Mary is passed in as <em>value</em>.</p>
<p>The second line represents intervening code.</p>
<p>The third line uses the getter to retrieve “Mary” and assign it to the local string variable <em>fn</em>.</p>
<h3>Why Not Use Fields?</h3>
<p>If we’re using automatic properties, why not use public fields? <a href="http://weblogs.asp.net/jgalloway" target="_blank">Jon Galloway</a> points out that this is a common question and that one of the better answers was given by <a href="http://weblogs.asp.net/scottgu/archive/2007/03/08/new-c-orcas-language-features-automatic-properties-object-initializers-and-collection-initializers.aspx" target="_blank">Scott Guthrie</a>:</p>
<blockquote><p><em>Note about that we aren&#8217;t actually adding any logic in the getters/setters of our properties &#8211; instead we just get/set the value directly to a field.  This begs the question &#8211; then why not just use fields instead of properties?  Well &#8211; there are a lot of downsides to exposing public fields. Two of the big problems are: 1) you can&#8217;t easily databind against fields, and 2) if you expose public fields from your classes you can&#8217;t later change them to properties (for example: to add validation logic to the setters) without recompiling any assemblies compiled against the old class. </em></p></blockquote>
<h3>Finishing the Customer Class</h3>
<p>With the properties in place we need a way to generate an instance. <strong>Best would be if we didn’t have to have an instance to create one, and so we’ll add a static method</strong> that returns a pre-filled instance.  <strong>Static methods can be called on the <em>class</em></strong> rather than on an instance (as you’ll see in just a moment).</p>
<pre class="brush: xml;">public static Customer GetCustomer()
{
    var newCust = new Customer(
        "Martha",
        "Washington",
        "1640 Pennsylvania Avenue",
        "New York",
        "NY",
        "11214",
        "617-555-4663",
        "781-555-9675",
        "212-555-5353",
        "jesseliberty@jesseliberty.com",
        "none",
        false,
        "VIP - Treat nicely",
        700,
        new DateTime(1955,07,10),
        new DateTime(2010,06,06));
    return newCust;
}</pre>
<p>This method does nothing more than to <strong>create an instance of the class, populate its fields and then return that instance</strong>.  <em>You would never do this in production code</em>, but it does give us an instance of the Customer class <em>as if</em> we had obtained it from a web service.  All that is missing is the constructor that we’re calling (that takes a value for each property),</p>
<pre class="brush: csharp;">public Customer(
    string first,
    string last,
    string address,
    string city,
    string state,
    string zip,
    string homePhone,
    string workPhone,
    string fax,
    string workEmail,
    string homeEmail,
    bool isMale,
    string notes,
    Int16 creditRating,
        DateTime firstContact,
        DateTime lastContact )
{
    First = first;
    Last = last;
    Address = address;
    City = city;
    State = state;
    Zip = zip;
    HomePhone = homePhone;
    WorkPhone = workPhone;
    Fax = fax;
    HomeEmail = homeEmail;
    WorkEmail = workEmail;
    IsMale = isMale;
    Notes = notes;
    CreditRating = creditRating;
    FirstContact = firstContact;
    LastContact = lastContact;

}</pre>
<p>That’s the model.</p>
<h3>The ViewModel</h3>
<p>The job of the ViewModel is to manage this data, bind it to the view and handle user input and user actions. We’ll postpone a discussion of user input and user actions until a future tutorial, but let’s create the view model with public properties for each of the values in the Customer that we want to display in the view. Here’s the complete MainViewModel.cs file</p>
<pre class="brush: csharp;">using GalaSoft.MvvmLight;
using Your_First_Application.Model;

namespace Your_First_Application.ViewModel
{
    public class MainViewModel : ViewModelBase
    {
        public string ApplicationTitle
        {
            get { return "Your First Application"; }
        }

        public string PageName
        {
            get { return "Customer"; }
        }

        private readonly Customer cust = Customer.GetCustomer();

        public string Name { get { return cust.First + " " + cust.Last; } }
        public string Street { get { return cust.Address; } }
        public string City { get { return cust.City; } }
        public string State { get { return cust.State; } }
        public string Zip { get { return cust.Zip; } }
        public string Phone { get { return cust.WorkPhone; } }
        public string Fax { get { return cust.Fax; } }
        public string Email { get { return cust.WorkEmail; } }
        public bool IsMale { get { return cust.IsMale == true; } }
        public bool IsFemale { get { return !IsMale; } }
        public string Notes { get { return cust.Notes; } }
    }
}</pre>
<p>The first two public properties are put in place by the MVVM Light Toolkit, the 11 at the bottom are the properties to which we’ll bind the 11 user controls.</p>
<h3>Setting the Data Context</h3>
<p>Notice that the values that <strong>we’re binding to are values on the customer object</strong>. How will the UI elements know what object has these properties?  That is handled by the <strong>Data Context property</strong> of the control, or its container (grid) or the container’s container (the page).  With MVVM Light Toolkit this work is done with the DAtaContext Locator object, which you’ll find was declared in the Xaml file,</p>
<pre class="brush: csharp;">DataContext="{Binding Main, Source={StaticResource Locator}}"&gt;</pre>
<p>This declaration was <strong>created for you by the MVVM Light Toolkit</strong> and so you do not have to worry about it; it just works.</p>
<h3>Binding at the UI Level</h3>
<p><a href="http://jesseliberty.com/wp-content/uploads/2010/08/Binding.jpg"><img style="margin: 10px 20px 10px 0px; display: inline; border-width: 0px;" title="Binding" src="http://jesseliberty.com/wp-content/uploads/2010/08/Binding_thumb.jpg" border="0" alt="Binding" width="240" height="170" align="left" /></a> It is time to <strong>bind the controls to the properties in the ViewModel</strong>.  Return to the View and click on one of the TextBox controls.  Delete the content and select binding. The dialog that opens will ask which public property you wish to bind to.</p>
<p>The tiny gold barrel on the line with the Text property indicates that you have a known data source.  The dialog box that opens has four tabs:</p>
<ul>
<li>Source</li>
<li>Path</li>
<li>Converter</li>
<li>Options</li>
</ul>
<p>Source is the data context (though you can have other sources, a topic for a later tutorial)</p>
<p>Path is the property to which you’ll bind</p>
<p>Converter allows the binding object to convert the type and/or to format the data</p>
<p>Options is where you pick one of the three types of binding:</p>
<ol>
<li>One Time</li>
<li>One Way</li>
<li>Two Way</li>
</ol>
<p>OneTime binding sets the binding and shuts down the binding connection.</p>
<p>OneWay binding is for read-only data</p>
<p>TwoWay binding allows the user to update the data you are displaying.  We’ll look at TwoWay binding in an early upcoming tutorial.</p>
<h3>Creating the UI in Xaml</h3>
<p>While drag and drop and setting properties works very well, you may find that your friends who do Silverlight programming do not take advantage of this. Rather they write these<strong> simple UI designs directly in the Xaml</strong>.  This is very much an artifact of the days in which coding the Xaml directly was the only option, but you may be interested in how to do such a thing.  Easy, peasy.  Return to the split screen and examine the Xaml that was generated.  Change the Xaml and see how the UI changes. Change the UI and see how the Xaml changes.  Here is the complete Xaml for our page,</p>
<pre class="brush: xml; collapse: true;">&lt;phone:PhoneApplicationPage x:Class="Your_First_Application.MainPage"
                            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                            xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
                            xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
                            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                            FontFamily="{StaticResource PhoneFontFamilyNormal}"
                            FontSize="{StaticResource PhoneFontSizeNormal}"
                            Foreground="{StaticResource PhoneForegroundBrush}"
                            SupportedOrientations="Portrait"
                            Orientation="Portrait"
                            mc:Ignorable="d"
                            d:DesignWidth="480"
                            d:DesignHeight="768"
                            shell:SystemTray.IsVisible="True"
                            DataContext="{Binding Main, Source={StaticResource Locator}}"&gt;

   &lt;!--LayoutRoot contains the root grid where all other page content is placed--&gt;
   &lt;Grid x:Name="LayoutRoot"
         Background="Transparent"&gt;
      &lt;Grid.RowDefinitions&gt;
         &lt;RowDefinition Height="Auto" /&gt;
         &lt;RowDefinition Height="*" /&gt;
      &lt;/Grid.RowDefinitions&gt;

      &lt;!--TitlePanel contains the name of the application and page title--&gt;
      &lt;StackPanel x:Name="TitlePanel"
                  Grid.Row="0"
                  Margin="24,24,0,12"&gt;
         &lt;TextBlock x:Name="ApplicationTitle"
                    Text="{Binding ApplicationTitle}"
                    Style="{StaticResource PhoneTextNormalStyle}" /&gt;
         &lt;TextBlock x:Name="PageTitle"
                    Text="{Binding PageName}"
                    Margin="-3,-8,0,0"
                    Style="{StaticResource PhoneTextTitle1Style}" /&gt;
      &lt;/StackPanel&gt;

      &lt;!--ContentPanel - place additional content here--&gt;
      &lt;Grid x:Name="ContentGrid"
            Grid.Row="1"
            Height="617"
            VerticalAlignment="Bottom"&gt;
         &lt;Grid.RowDefinitions&gt;
            &lt;RowDefinition Height="1*" /&gt;
            &lt;RowDefinition Height="1*" /&gt;
            &lt;RowDefinition Height="1*" /&gt;
            &lt;RowDefinition Height="1*" /&gt;
            &lt;RowDefinition Height="1*" /&gt;
            &lt;RowDefinition Height="1*" /&gt;
            &lt;RowDefinition Height="1*" /&gt;
            &lt;RowDefinition Height="1*" /&gt;
         &lt;/Grid.RowDefinitions&gt;
         &lt;Grid.ColumnDefinitions&gt;
            &lt;ColumnDefinition Width="1*" /&gt;
            &lt;ColumnDefinition Width="2*" /&gt;
         &lt;/Grid.ColumnDefinitions&gt;
         &lt;TextBlock Height="30"
                    HorizontalAlignment="Right"
                    Margin="5"
                    Name="NamePrompt"
                    Text="Full Name"
                    VerticalAlignment="Center"
                    FontWeight="Bold"
                    Grid.Row="0" /&gt;
         &lt;TextBlock FontWeight="Bold"
                    Height="30"
                    HorizontalAlignment="Right"
                    Name="streetPrompt"
                    Text="Street Address"
                    VerticalAlignment="Center"
                    Margin="5"
                    Grid.Row="1" /&gt;
         &lt;TextBlock FontWeight="Bold"
                    Height="30"
                    HorizontalAlignment="Right"
                    Name="cityStateZipPrompt"
                    Text="City, State, Zip"
                    VerticalAlignment="Center"
                    Margin="5"
                    Grid.Row="2" /&gt;
         &lt;TextBlock Height="30"
                    HorizontalAlignment="Right"
                    Margin="5"
                    Name="PhonePrompt"
                    Text="Phone"
                    VerticalAlignment="Center"
                    FontWeight="Bold"
                    Grid.Row="3" /&gt;
         &lt;TextBlock FontWeight="Bold"
                    Height="30"
                    HorizontalAlignment="Right"
                    Name="FaxPrompt"
                    Text="Fax"
                    VerticalAlignment="Center"
                    Margin="5"
                    Grid.Row="4" /&gt;
         &lt;TextBlock FontWeight="Bold"
                    Height="30"
                    HorizontalAlignment="Right"
                    Name="EmailPrompt"
                    Text="Email"
                    VerticalAlignment="Center"
                    Margin="5"
                    Grid.Row="5" /&gt;

         &lt;TextBlock FontWeight="Bold"
                    Height="30"
                    HorizontalAlignment="Right"
                    Name="NotesPrompt"
                    Text="Notes"
                    VerticalAlignment="Center"
                    Margin="5"
                    Grid.Row="7" /&gt;

         &lt;TextBox Name="FullName"
                  Width="303"
                  Height="70"
                  HorizontalAlignment="Left"
                  VerticalAlignment="Bottom"
                  Margin="5,0,0,5"
                  Grid.Column="1"
                  Text="{Binding Name}" /&gt;
         &lt;TextBox Name="Street"
                  Width="303"
                  Height="70"
                  HorizontalAlignment="Left"
                  VerticalAlignment="Bottom"
                  Margin="5,0,0,5"
                  Grid.Row="1"
                  Grid.Column="1"
                  Text="{Binding Street}" /&gt;
         &lt;StackPanel Orientation="Horizontal"
                     HorizontalAlignment="Stretch"
                     VerticalAlignment="Stretch"
                     Margin="0"
                     Grid.Row="2"
                     Grid.Column="1"&gt;
            &lt;TextBox Name="City"
                     Width="150"
                     Height="70"
                     HorizontalAlignment="Left"
                     VerticalAlignment="Bottom"
                     Margin="0,0,0,5"
                     Text="{Binding City}" /&gt;
            &lt;TextBox Name="State"
                     Width="74"
                     Height="70"
                     Margin="0,0,0,5"
                     Text="{Binding State}" /&gt;
            &lt;TextBox Name="Zip"
                     Width="93"
                     Height="70"
                     Margin="0,0,0,5"
                     Text="{Binding Zip}" /&gt;
         &lt;/StackPanel&gt;
         &lt;TextBox Height="70"
                  HorizontalAlignment="Left"
                  Margin="5,0,0,5"
                  Name="Phone"
                  VerticalAlignment="Bottom"
                  Width="303"
                  Grid.Column="1"
                  Grid.Row="3"
                  Text="{Binding Phone}" /&gt;
         &lt;TextBox Height="70"
                  HorizontalAlignment="Left"
                  Margin="5,0,0,5"
                  Name="Fax"
                  VerticalAlignment="Bottom"
                  Width="303"
                  Grid.Column="1"
                  Grid.Row="4"
                  Text="{Binding Fax}" /&gt;
         &lt;TextBox Height="70"
                  HorizontalAlignment="Left"
                  Margin="5,0,0,5"
                  Name="Email"
                  VerticalAlignment="Bottom"
                  Width="303"
                  Grid.Column="1"
                  Grid.Row="5"
                  Text="{Binding Email}" /&gt;
         &lt;StackPanel Orientation="Horizontal"
                     HorizontalAlignment="Stretch"
                     VerticalAlignment="Stretch"
                     Margin="5"
                     Grid.Row="6"
                     Grid.Column="1"&gt;
            &lt;RadioButton Name="Male"
                         Content="Male"
                         GroupName="Sex"
                         IsChecked="{Binding IsMale}"
                         FontSize="20" /&gt;
            &lt;RadioButton Name="Female"
                         Content="Female"
                         GroupName="Sex"
                         IsChecked="{Binding IsFemale}"
                         FontSize="20" /&gt;
         &lt;/StackPanel&gt;
         &lt;TextBox Height="72"
                  HorizontalAlignment="Left"
                  Margin="5,0,0,5"
                  Name="Notes"
                  VerticalAlignment="Bottom"
                  Width="290"
                  Grid.Column="1"
                  Grid.Row="7"
                  Text="{Binding Notes}" /&gt;
      &lt;/Grid&gt;
   &lt;/Grid&gt;
&lt;/phone:PhoneApplicationPage&gt;</pre>
<h4>You can obtain the complete source code for this application <a href="http://jesseliberty.com/files/YourFirstApplication.zip" target="_blank">here</a>.</h4>
<h3>Avoiding Property Wrappers</h3>
<p>An argument can certainly be made that too many of the properties in the ViewModel are nothing but pass-through wrappers for the same properties in Customer.  You can avoid that by making a Customer object a public property of the ViewModel and then binding to that directly.  If you prefer that style, you would want to change the ViewModel to look like this:</p>
<pre class="brush: csharp;">public class MainViewModel : ViewModelBase
{
    public string ApplicationTitle
    {
        get { return "Your First Application"; }
    }

    public string PageName
    {
        get { return "Customer"; }
    }

    private   Customer cust = Customer.GetCustomer();
    public   Customer Cust { get { return cust; } }

    public string Name { get { return cust.First + " " + cust.Last; } }
    public bool IsMale { get { return cust.IsMale == true; } }
    public bool IsFemale { get { return !IsMale; } }
}</pre>
<p>You’ll need to update the Xaml file to bind to WorkPhone and WorkEmail (as the ViewModel is no longer translating for you).</p>
<p>Finally, you’ll need to bind explicitly to the Customer property for most of the  fields, and to the ViewModel for the couple (Name and Male/Female) that will use Properties on the VM rather than on the Customer</p>
<pre class="brush: csharp;">public MainPage()
{
    InitializeComponent();
    var vm = new MainViewModel();
    DataContext = vm.Cust;
    FullName.DataContext = vm;
    Male.DataContext = Female.DataContext = vm;
}</pre>
<p>We create an instance of the ViewModel, and then set the DataContext of the View to the Cust property of the ViewModel.  We then set the DataContext of FullName to the ViewModel instance, and finally we set Male.DataContext and FemaleDataContext to the vm as well.</p>
<p>Mind Map</p>
<p><em>This is the kind of thing that people who like this kind of thing like.</em></p>
<p>[Click on the map to see it full size]</p>
<p><a href="http://jesseliberty.com/wp-content/uploads/2010/08/MindMapDataBinding2.jpg"><img class="aligncenter size-medium wp-image-3325" style="display: block; float: none; margin-left: auto; margin-right: auto;" title="MindMapDataBinding2" src="http://jesseliberty.com/wp-content/uploads/2010/08/MindMapDataBinding2-300x212.jpg" alt="" width="300" height="212" /></a></p>
<p><a href="http://jesseliberty.com/2010/09/04/iphone-to-windows-phone-7-diving-deeper/" target="_blank">Go to next tutorial</a></li>
]]></content:encoded>
			<wfw:commentRss>http://jesseliberty.com/2010/08/27/i2w-an-iphone-developers-first-windows-phone-7-application/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Diary of a trip to the UK &amp; Ireland – The Final Chapter</title>
		<link>http://jesseliberty.com/2010/04/25/diary-of-a-trip-to-the-uk-ireland-the-final-chapter/</link>
		<comments>http://jesseliberty.com/2010/04/25/diary-of-a-trip-to-the-uk-ireland-the-final-chapter/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 12:44:55 +0000</pubDate>
		<dc:creator>Jesse Liberty</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Presentations]]></category>

		<guid isPermaLink="false">http://jesseliberty.com/2010/04/25/diary-of-a-trip-to-the-uk-ireland-the-final-chapter/</guid>
		<description><![CDATA[The ferry to Belfast was uneventful, and Belfast itself is a beautiful, scarred city, caught between decades of violence and flickering hope for the future. The “troubles” are recent enough that virtually  everyone there lived through them, yet quiet enough &#8230; <a href="http://jesseliberty.com/2010/04/25/diary-of-a-trip-to-the-uk-ireland-the-final-chapter/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The ferry to Belfast was uneventful, and Belfast itself is a beautiful, scarred city, caught between decades of violence and flickering hope for the future.</p>
<p><span id="more-1015"></span>The “troubles” are recent <a href="http://jesseliberty.com/wp-content/uploads/2010/04/Belfast1.jpg"><img style="margin: 10px 20px 10px 0px; display: inline; border: 0px;" title="Belfast" src="http://jesseliberty.com/wp-content/uploads/2010/04/Belfast_thumb1.jpg" border="0" alt="Belfast" width="240" height="160" align="left" /></a> enough that virtually  everyone there lived through them, yet quiet enough now that there is a brisk business in taking tourists on the famous “Black Cab Tours.”  Throughout the area you find houses with huge murals painted on, memorializing the fighters (and at times those caught in the cross-fire) as if the old wounds are only barely closed.</p>
<p>The Belfast UG was terrific, very enthusiastic and very happy to have the presentation.</p>
<p>From there I crossed drove to Cork (5 hours) as the internal flights were not yet dependable. A terrific drive, which I broke up by driving through some smaller  towns.  It is true, the more south you go, the thicker the stout gets. Cork is the home of Murphy’s Stout, Dublin the home of Guinness.  It is better here, there is just no doubt.</p>
<p><a href="http://jesseliberty.com/wp-content/uploads/2010/04/stout.jpg"><img style="margin: 10px 20px 10px 0px; display: inline; border-width: 0px;" title="stout" src="http://jesseliberty.com/wp-content/uploads/2010/04/stout_thumb.jpg" border="0" alt="stout" width="129" height="172" align="left" /></a>The Cork UG was wonderful, they see themselves as a bit out of the way and so are very pleased to have folks from Microsoft come – and they show their pleasure openly and kindly.  The next day was my one opportunity to see the beautiful west coast of Ireland, but it was a drizzly day and my body insisted on sleeping late, so I settled for a surprisingly pleasant walk in Dublin.</p>
<p>My only regret in this trip is that due to the problems with flying I was unable to talk with the Dublin UG; to make up for which I hope to be back soon!</p>
<p>All in all it was a terrific opportunity to talk with hundreds of working Silverlight Programmers throughout the UK &amp; Ireland, and a trip I won’t soon forget.</p>
<p><strong>Two weeks, four countries, 9 presentations, two flights, one ferry and  1,650 miles driven</strong>. Brilliant. </p>
]]></content:encoded>
			<wfw:commentRss>http://jesseliberty.com/2010/04/25/diary-of-a-trip-to-the-uk-ireland-the-final-chapter/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Diary of a trip to the UK and Ireland &#8211; Continued</title>
		<link>http://jesseliberty.com/2010/04/16/diary-of-a-trip-to-the-uk-and-ireland-continued/</link>
		<comments>http://jesseliberty.com/2010/04/16/diary-of-a-trip-to-the-uk-and-ireland-continued/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 11:17:27 +0000</pubDate>
		<dc:creator>Jesse Liberty</dc:creator>
				<category><![CDATA[Community]]></category>

		<guid isPermaLink="false">http://jesseliberty.com/2010/04/16/diary-of-a-trip-to-the-uk-and-ireland-continued/</guid>
		<description><![CDATA[Dateline Hetton, near Skipton. The presentation in Cambridge was great fun, preceded by a quick walking tour with Rachel Hawley (who, it turns out, I’ve known thrice without understanding she was all the same person!  She was involved in hiring &#8230; <a href="http://jesseliberty.com/2010/04/16/diary-of-a-trip-to-the-uk-and-ireland-continued/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Dateline Hetton, near Skipton. </strong></p>
<p><a href="http://jesseliberty.com/wp-content/uploads/2010/04/KingsCollege.jpg"><img style="margin: 0px 20px 20px 0px; display: inline; border: 0px;" title="Kings College " src="http://jesseliberty.com/wp-content/uploads/2010/04/KingsCollege_thumb.jpg" border="0" alt="Kings College " width="244" height="163" align="left" /></a>The presentation in Cambridge was great fun, preceded by a quick walking tour with Rachel Hawley (who, it turns out, I’ve known thrice without understanding she was all the same person!  She was involved in hiring me to write a (mostly) political column in 2006/2007 for <a href="http://www.simple-talk.com/author/jesse-liberty/" target="_blank">Simple Talk</a>, then again in helping me with <a href="http://devexpress.com/Products/Visual_Studio_Add-in/Coding_Assistance/" target="_blank">CodeRush</a> and finally with arranging the Cambridge part of my trip, not least acting as tour-guide.</p>
<p><span id="more-993"></span></p>
<p>After a very warm reception at the Cambridge presentation, filled with highly motivated and skilled developers, I drove up to Leeds, where Black Marble played the role of host and benefactor, offering an incredible welcome. They have a remarkable company that I can’t imagine anyone not wanting to work for, and their presentations, offered free as a contribution to the community, attract a large crowd of world-class developers.  The presentation was followed by one of the best dinners I’ve ever had at a truly <a href="http://www.angelhetton.co.uk/" target="_blank">magnificent inn</a> and today, before departing, yet another Full English breakfast, this one punctuated by the addition of Black Pudding.  (You’ll have to look it up, if you are American and you find out what it is, you may stop reading this diary altogether).</p>
<p>Now it is off to Newcastle Upon Tyne, with, I hope a side trip to Hogwarts. </p>
]]></content:encoded>
			<wfw:commentRss>http://jesseliberty.com/2010/04/16/diary-of-a-trip-to-the-uk-and-ireland-continued/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>The United Kingdom &amp; The Republic of Ireland</title>
		<link>http://jesseliberty.com/2010/02/15/the-united-kingdom-the-republic-of-ireland-2/</link>
		<comments>http://jesseliberty.com/2010/02/15/the-united-kingdom-the-republic-of-ireland-2/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 09:39:00 +0000</pubDate>
		<dc:creator>Jesse Liberty</dc:creator>
				<category><![CDATA[z Silverlight Archives]]></category>
		<category><![CDATA[Community]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I am extremely pleased to say that thanks to the very hard work of Guy Smith-Ferrier, and the generosity of Microsoft UK, Microsoft Ireland, Microsoft User Group Support Services and Microsoft US,  and the work and welcome of numerous user &#8230; <a href="http://jesseliberty.com/2010/02/15/the-united-kingdom-the-republic-of-ireland-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I am extremely pleased to say that thanks to the very hard work of Guy Smith-Ferrier, and the generosity of <a href="http://www.microsoft.com/uk/about/default.mspx" target="_blank">Microsoft UK,</a> <a href="http://www.microsoft.com/ireland/about/" target="_blank">Microsoft Ireland</a>, <a href="http://www.usergroupsupportservices.com/MyUGSS.ugss" target="_blank">Microsoft User Group Support Services</a> and <a href="http://microsoft.com" target="_blank">Microsoft US</a>,  and the work and welcome of numerous user groups in the UK and Ireland, I am able to announce that I’ll be talking at the following events in mid-April.</p>
<p>[ <a href="http://jesseliberty.com/html/Map.htm" target="new">Map</a> ]</p>
<p>(Presentation details below)</p>
<table border="0" cellspacing="2" cellpadding="2" width="472">
<tbody>
<tr>
<td width="107" valign="top"><strong>Date</strong></td>
<td width="290" valign="top"><strong>Group</strong></td>
<td width="43" valign="top"><strong>City</strong></td>
<td width="20" valign="top"><strong>Talk</strong></td>
</tr>
<tr>
<td width="107" valign="top">12 April</td>
<td width="290" valign="top"><a href="http://www.dotnetdevnet.com" target="_blank">The .NET Developer Network</a></td>
<td width="43" valign="top">Bristol</td>
<td width="20" valign="top">#2</td>
</tr>
<tr>
<td width="107" valign="top">13, 14 April</td>
<td width="290" valign="top">Microsoft Tech Days<br />
Twitter: #TechDays</td>
<td width="43" valign="top">London</td>
<td width="20" valign="top"></td>
</tr>
<tr>
<td width="107" valign="top">13 April</td>
<td width="290" valign="top"><a href="http://consultingblogs.emc.com/michelleflynn/archive/2010/02/10/silverlight-user-group-11-video-and-slides.aspx" target="_blank">Silverlight User Group</a> / <a href="http://www.dnug.org.uk/" target="_blank">London .NET User Group</a>.</td>
<td width="43" valign="top">London</td>
<td width="20" valign="top">#2</td>
</tr>
<tr>
<td width="107" valign="top">14 April</td>
<td width="290" valign="top"><a href="http://www.nxtgenug.net" target="_blank">The Next Generation User Group</a></td>
<td width="43" valign="top">Cambridge</td>
<td width="20" valign="top">#3</td>
</tr>
<tr>
<td width="107" valign="top">15 April</td>
<td width="290" valign="top"><a href="http://www.blackmarble.com" target="_blank">Black Marble User Group</a></td>
<td width="43" valign="top">Leeds</td>
<td width="20" valign="top">#3</td>
</tr>
<tr>
<td width="107" valign="top">16 April</td>
<td width="290" valign="top"><a href="http://www.nebytes.net" target="_blank">NEBytes</a></td>
<td width="43" valign="top">Newcastle Upon Tyne</td>
<td width="20" valign="top">#3</td>
</tr>
<tr>
<td width="107" valign="top">19 April</td>
<td width="290" valign="top"><a href="http://scottishdevelopers.com/2010/03/26/jesse-libertys-uk-tour-dundee-edinburgh-19th-and-20th-april/">Scottish Developers User Group</a></td>
<td width="43" valign="top">Dundee</td>
<td width="20" valign="top">#1</td>
</tr>
<tr>
<td width="107" valign="top">20 April</td>
<td width="290" valign="top"><a href="http://scottishdevelopers.com/2010/03/26/jesse-libertys-uk-tour-dundee-edinburgh-19th-and-20th-april/">Scottish Developers User Group</a></td>
<td width="43" valign="top">Edinburgh</td>
<td width="20" valign="top">#2</td>
</tr>
<tr>
<td width="107" valign="top">21 April</td>
<td width="290" valign="top"><a href="http://www.mtug.ie/UserGroups/Dublin/tabid/77/ctl/Details/Mid/403/ItemID/57/Default.aspx?ContainerSrc=[G]Containers/_default/No+Container">Dublin User Group</a></td>
<td width="43" valign="top">Dublin</td>
<td width="20" valign="top">TBD</td>
</tr>
<tr>
<td width="107" valign="top">22 April</td>
<td width="290" valign="top"><a href="http://nimtug.org/blogs/events/default.aspx">Northern Ireland Microsoft UG</a></td>
<td width="43" valign="top">Belfast</td>
<td width="20" valign="top">TBD</td>
</tr>
<tr>
<td width="107" valign="top">23 April</td>
<td width="290" valign="top"><a href="http://www.mtug.ie/UserGroups/Cork/tabid/78/ctl/Details/Mid/405/ItemID/59/Default.aspx?ContainerSrc=[G]Containers/_default/No+Container">Cork User Group</a></td>
<td width="43" valign="top">Cork</td>
<td width="20" valign="top">TBD</td>
</tr>
</tbody>
</table>
<h1>Presentations</h1>
<h3><span style="color: #800000;"> </span><span style="color: #000080;">#1</span> Introduction to Application Development With Silverlight 4</h3>
<p>This presentation is targeted at .NET programmers new to Silverlight or who wish a review of the fundamentals of building an application in Silverlight 4. Topics will include</p>
<ul>
<li>Drag and Drop development</li>
<li>Xaml and Code</li>
<li>Layout and Controls</li>
<li>Data, Data-binding, Validation and Async-validation</li>
<li>Templates and The Visual State Manager (Time allowing)</li>
</ul>
<p><strong> </strong></p>
<h3><span style="color: #800000;"> </span><span style="color: #000080;">#2</span> Silverlight 4,  MVVM and Test-Driven Development</h3>
<ul>
<li>MVVM and Silverlight to build test-driven programs<strong> </strong></li>
<li>Understanding Refactoring and Dependency Injection<strong></strong></li>
<li>A Walk through of a non-trivial application<strong></strong></li>
</ul>
<h3><span style="color: #000080;">#3</span> Building A Highly Extensible, Decoupled Silverlight Open Source Application with MEF and RIA Services using Lean, Test Driven Development, An International Team of Volunteer Programmers,  and lots of Advil.</h3>
<p>This talk will use the <a href="http://slhvp.com/">Silverlight HyperVideo Platform</a> open-source project on CodePlex as a case study in building highly extensible Silverlight applications. Among the topics we will focus on are:</p>
<ul>
<li>New features in Silverlight 4 and how they made life easier</li>
<li>The <a href="http://mef.codeplex.com">Managed Extensibility Framework</a> (MEF) added to Silverlight 4</li>
<li>WCF RIA Services for connection to a back-end db</li>
<li>Handling inter-module communication when the requirements are that modules cannot assume which other modules will be created, there can be no dependencies on order-of creation and unanticipated modules must be able to communicate with existing modules.</li>
<li>Using Markers, Injected Markers and polling to trigger events while viewing a video.</li>
<li>A Quick introduction to Lean, TDD and Kanban</li>
</ul>
<p><strong></strong></p>
<p><a title="TDD" name="TDD"></a><strong></strong></p>
<h3></h3>
<div class="wlWriterHeaderFooter" style="margin: 0px; padding: 0px 0px 0px 0px;">This work is licensed under a <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons  license.</a></div>
]]></content:encoded>
			<wfw:commentRss>http://jesseliberty.com/2010/02/15/the-united-kingdom-the-republic-of-ireland-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Silverlight From Zero</title>
		<link>http://jesseliberty.com/2009/11/02/silverlight-from-zero/</link>
		<comments>http://jesseliberty.com/2009/11/02/silverlight-from-zero/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 14:44:00 +0000</pubDate>
		<dc:creator>Jesse Liberty</dc:creator>
				<category><![CDATA[z Silverlight Archives]]></category>
		<category><![CDATA[GetStarted]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[This is the first of a series of blog posts directed at folks who are new to Silverlight and/or want to brush up on the fundamentals.&#160; It will consist of mini-tutorials on topics I think need more coverage, and links &#8230; <a href="http://jesseliberty.com/2009/11/02/silverlight-from-zero/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://silverlight.net/learn/tutorials/mini/1/" target=_blank mce_href="http://silverlight.net/learn/tutorials/mini/1/"><img style="BORDER-RIGHT-WIDTH: 0px; MARGIN: 10px 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=MiniTutorialLogo2 border=0 alt=MiniTutorialLogo2 src="http://blogs.silverlight.net/blogs/jesseliberty/MiniTutorialLogo2_4CD8B517.jpg" width=256 height=75 mce_src="http://blogs.silverlight.net/blogs/jesseliberty/MiniTutorialLogo2_4CD8B517.jpg"/></a> </p>
<p>This is the first of a series of blog posts directed at folks who are new to Silverlight and/or want to brush up on the fundamentals.&nbsp; It will consist of mini-tutorials on topics I think need more coverage, and links to existing <a href="http://silverlight.net/learn/tutorials/mini/1/" target=_blank mce_href="http://silverlight.net/learn/tutorials/mini/1/">mini-tutorials</a>, <a href="http://silverlight.net/learn/tutorials/full/1/" target=_blank mce_href="http://silverlight.net/learn/tutorials/full/1/">tutorials</a> and <a href="http://silverlight.net/learn/videos/silverlight-videos/" target=_blank mce_href="http://silverlight.net/learn/videos/silverlight-videos/">videos</a>. We begin… at the beginning.</p>
<h1>What is Silverlight, Why Do I care? <br /></h1>
<p>This is the traditional place to start, but in all probability if you are here, you know the answer. In brief: Silverlight is Microsoft’s Rich Internet Application enabling technology. The goal is to create applications that are delivered by the browser but which offer the user experience of a desktop application.&nbsp; There is no question that using a RIA technology offers the ability to create a quality of experience that cannot be matched by more traditional approaches.</p>
<h1>Where Do I Get It? <br /></h1>
<p><em>Everything </em>you need to start writing Silverlight applications is available on our <a href="http://silverlight.net/getstarted" target=_blank mce_href="http://silverlight.net/getstarted">Get Started</a> page.<a href="http://www.microsoft.com/web/gallery/install.aspx?appsxml=www.microsoft.com%2Fweb%2Fwebpi%2F2.0%2FWebProductList.xml%3Bwww.microsoft.com%2Fweb%2Fwebpi%2F2.0%2FWebProductList.xml&amp;appid=78%3B121" target=_blank mce_href="http://www.microsoft.com/web/gallery/install.aspx?appsxml=www.microsoft.com%2Fweb%2Fwebpi%2F2.0%2FWebProductList.xml%3Bwww.microsoft.com%2Fweb%2Fwebpi%2F2.0%2FWebProductList.xml&amp;appid=78%3B121"><img style="BORDER-RIGHT-WIDTH: 0px; MARGIN: 10px 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=WebPlatform border=0 alt=WebPlatform align=right src="http://blogs.silverlight.net/blogs/jesseliberty/WebPlatform_4C6C8222.jpg" width=193 height=46 mce_src="http://blogs.silverlight.net/blogs/jesseliberty/WebPlatform_4C6C8222.jpg"/></a></p>
<p>If you don’t already have Visual Studio, consider starting with <a href="http://www.microsoft.com/express/vwd/" target=_blank mce_href="http://www.microsoft.com/express/vwd/">Visual Web Developer</a> (VWD). You can download both VWD and Silverlight together using the <a href="http://www.microsoft.com/web/gallery/install.aspx?appsxml=www.microsoft.com%2Fweb%2Fwebpi%2F2.0%2FWebProductList.xml%3Bwww.microsoft.com%2Fweb%2Fwebpi%2F2.0%2FWebProductList.xml&amp;appid=78%3B121" target=_blank mce_href="http://www.microsoft.com/web/gallery/install.aspx?appsxml=www.microsoft.com%2Fweb%2Fwebpi%2F2.0%2FWebProductList.xml%3Bwww.microsoft.com%2Fweb%2Fwebpi%2F2.0%2FWebProductList.xml&amp;appid=78%3B121">Web Platform Installer</a></p>
<p>Otherwise,&nbsp; you may want to take a look at the more powerful&nbsp; Visual Studio <a href="http://www.microsoft.com/visualstudio/en-us/products/professional/default.mspx" target=_blank mce_href="http://www.microsoft.com/visualstudio/en-us/products/professional/default.mspx">2008</a> or the new beta of Visual Studio 2010.&nbsp; Once you get serious with Silverlight you’ll really want&nbsp; <a href="http://www.microsoft.com/expression/" target=_blank mce_href="http://www.microsoft.com/expression/">Expression</a> Blend.&nbsp;&nbsp; </p>
<h2><font color=#000000 size=4>Navigating the Get Started Page</font> <br /></h2>
<p>On <a href="http://silverlight.net/getstarted" target=_blank mce_href="http://silverlight.net/getstarted">Get Started</a> you’ll find an array of options. The first option tells you how to get Visual Studio or VWD, and options 2, 3 and 5 while incredibly useful, are not required for your initial foray into Silverlight… so just grab option 4.</p>
<h3>Quick Tour?<a href="http://blogs.silverlight.net/blogs/jesseliberty/StartLearningAbridged_452FDE24.jpg" mce_href="http://blogs.silverlight.net/blogs/jesseliberty/StartLearningAbridged_452FDE24.jpg"><img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; MARGIN: 10px 0px 10px 10px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=StartLearningAbridged border=0 alt=StartLearningAbridged align=right src="http://blogs.silverlight.net/blogs/jesseliberty/StartLearningAbridged_thumb_6B91C16F.jpg" width=244 height=164 mce_src="http://blogs.silverlight.net/blogs/jesseliberty/StartLearningAbridged_thumb_6B91C16F.jpg"/></a></h3>
<p>In the next section on the Get Started page, you’ll find a quick tour of Silverlight.&nbsp;&nbsp; </p>
<p>This is a great way to get going. On the other hand, if you are going to follow <em>this </em>series, you may want to watch just #1 (Getting Started video) and hold off on the rest as I’m&nbsp; going to integrate all of that material (including Tim’s terrific 8 part blog series) as we go. </p>
<h2><font color=#000000 size=4>The Tools</font></h2>
<p>Tim’s <a href="http://timheuer.com/blog/articles/silverlight-get-started-part-1-hello-world.aspx" target=_blank mce_href="http://timheuer.com/blog/articles/silverlight-get-started-part-1-hello-world.aspx">excellent first video</a> in his series will definitely get you started on the right foot using the tools.&nbsp; <a href="http://blogs.silverlight.net/blogs/jesseliberty/TimH_0319B75A.jpg" mce_href="http://blogs.silverlight.net/blogs/jesseliberty/TimH_0319B75A.jpg"><img style="BORDER-RIGHT-WIDTH: 0px; MARGIN: 10px 0px 10px 10px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=TimH border=0 alt=TimH align=right src="http://blogs.silverlight.net/blogs/jesseliberty/TimH_thumb_0DD70EAF.jpg" width=171 height=136 mce_src="http://blogs.silverlight.net/blogs/jesseliberty/TimH_thumb_0DD70EAF.jpg"/></a></p>
<p>I’ve never fully understood why developers don’t spend more time learning the details of Visual Studio; it is, after all, our fundamental tool, the environment in which we live all day. Time spent on getting all you can out of Visual Studio will pay dividends for a long time.</p>
<h2><font color=#000000 size=4>Diving In</font></h2>
<p>With that, you are ready to dive into Silverlight. Arguably, the best way to get a handle on what Silverlight is, is to write a program that uses it to accomplish something reasonably useful. A good starter video on building an application (a bit old, but still correct) is <a href="http://silverlight.net/learn/videos/all/using-the-silverlight-canvas/" target=_blank mce_href="http://silverlight.net/learn/videos/all/using-the-silverlight-canvas/">this gentle intro</a> to creating a Silverlight application with Visual Studio, using the Canvas to lay out controls.&nbsp; Then read <a href="http://timheuer.com/blog/articles/silverlight-get-started-part-2-defining-layout.aspx" target=_blank mce_href="http://timheuer.com/blog/articles/silverlight-get-started-part-2-defining-layout.aspx">Part 2</a> in Tim’s series on layout. </p>
<p><strong>Next in this series:</strong> <a href="http://blogs.silverlight.net/blogs/jesseliberty/archive/2009/11/06/designer-v-xaml-v-code.aspx" target=_blank mce_href="http://blogs.silverlight.net/blogs/jesseliberty/archive/2009/11/06/designer-v-xaml-v-code.aspx">Three Approaches: Designer, Xaml or Dynamic</a></p>
<p><font size=1></font>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://jesseliberty.com/2009/11/02/silverlight-from-zero/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Complexity Isn’t Simple</title>
		<link>http://jesseliberty.com/2009/09/01/complexity-isn%e2%80%99t-simple/</link>
		<comments>http://jesseliberty.com/2009/09/01/complexity-isn%e2%80%99t-simple/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 01:49:00 +0000</pubDate>
		<dc:creator>Jesse Liberty</dc:creator>
				<category><![CDATA[z Silverlight Archives]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[It is very rare for me to respond to comments in follow-on blog post, in fact I don&#8217;t think I&#8217;ve ever done so before. However the response to my previous blog entry about Dot Net Rocks show number 476 was &#8230; <a href="http://jesseliberty.com/2009/09/01/complexity-isn%e2%80%99t-simple/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It is very rare for me to respond to comments in follow-on blog post, in fact I don&#8217;t think I&#8217;ve ever done so before. However the response to my <a href="http://silverlight.net/blogs/jesseliberty/archive/2009/08/27/in-response-to-dnr-476.aspx" target=_blank mce_href="http://silverlight.net/blogs/jesseliberty/archive/2009/08/27/in-response-to-dnr-476.aspx">previous blog entry</a> about <a href="http://www.dotnetrocks.com/default.aspx?showNum=476" target=_blank mce_href="http://www.dotnetrocks.com/default.aspx?showNum=476">Dot Net Rocks show number 476</a> was so overwhelming, and so many good points were made, that I couldn&#8217;t resist having another go at some of these issues.</p>
<p><a href="http://silverlight.net/blogs/jesseliberty/ManAtMaze_5DC6DCAE.jpg" mce_href="http://silverlight.net/blogs/jesseliberty/ManAtMaze_5DC6DCAE.jpg"><img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="Center of Attention" border=0 alt="Center of Attention" src="http://silverlight.net/blogs/jesseliberty/ManAtMaze_thumb_5A654506.jpg" width=304 height=303 mce_src="http://silverlight.net/blogs/jesseliberty/ManAtMaze_thumb_5A654506.jpg"/></a> </p>
<p><font face="Franklin Gothic Book">N.B.: I&#8217;ve taken the liberty™ of paraphrasing user comments.&nbsp; The original comments can be seen <a href="http://silverlight.net/blogs/jesseliberty/archive/2009/08/27/in-response-to-dnr-476.aspx#277470" target=_blank mce_href="http://silverlight.net/blogs/jesseliberty/archive/2009/08/27/in-response-to-dnr-476.aspx#277470">here</a>. </font></p>
<h4>Too Much To Keep Up With?</h4>
<p><em><font color=#0000ff>Nate Jackson wrote that he felt, even as a seasoned developer, that the pace at which technology is coming out of Microsoft is too fast for him to reasonably keep up with or even use to provide context for future projects.</font></em></p>
<p>My response is that I don&#8217;t disagree that with so many new technologies it&#8217;s terribly difficult to keep up. Rather, my position is that I&#8217;d rather live in a world where there are constantly improving technologies and run the risk&nbsp;of feeling that I&#8217;m falling behind then live in either of the alternative worlds: the one where we forgo rapid technology improvement, or the one in which we prematurely deprecate technology that developers are still using. </p>
<h4>Rapid Deprecation?</h4>
<p><font color=#0000ff><em>Guerchele objected that if we continued to advance the technology without deprecating,&nbsp; we wii inevitably end up with too many technologies. He rejected my idea of a “gizmo&#8221; because it does not </em>enforce</font><em><font color=#0000ff> adoption of the latest technology for new projects</font> </em></p>
<p>While I embrace the evolution of development technology, the solution cannot be to &#8220;forbid&#8221; the use of platforms we released only a few years ago. While it is in my own experience that applications that would&#8217;ve taken me months or even years to finish with the technology available five years ago can today be completed in months while providing a more robust and better UI, I have to also recognize that other developers do not necessarily feel the need to move from the technology with which they&#8217;re most comfortable. </p>
<p>And it may well be that for them the opportunity cost of forgoing the potential in the new technology is outweighed by the benefit of not having to take the time to make that move,&nbsp; given that they&#8217;re already fully productive in a technology they know. </p>
<p>No, actually&nbsp; that’s a lie. If the truth were known, my actual opinion is that the anticipated cost of adopting a new technology is over-estimated by those who feel this way (and under-estimated, I suppose by&nbsp;people like me!); and the real world gains of moving to a new technology like Silverlight are in fact far higher than might be anticipated. But I really do understand that many developers disagree with me.</p>
<h4>Full Projects Please</h4>
<p><em><font color=#0000ff>rickj1 wrote that our training and material has suffered from a lack of a “full-featured step-by-step end to end real world tutorial.” I fully agree, which is why I find the touring project very satisfying, though I think it&#8217;s extremely important to put each component into context and also to point out a generalized set of uses that transcend any individual project.</font> </em></p>
<p><strong>Note to rickj1, </strong>every part of project touring will be fully annotated and all the source code will be available as we move forward. </p>
<p>Others have commented, and once again I agree, that my tutorials and videos would be improved by providing more motivation for each technique; that is,&nbsp; “don&#8217;t just show me how to do something, tell me when I might want to do it.&#8221; </p>
<h4>A Few Words From Josh</h4>
<blockquote>
<p>“Nitwit! Blubber! Oddment! Tweak!&#8221; – <a href="http://en.wikiquote.org/wiki/Albus_Dumbledore" target=_blank mce_href="http://en.wikiquote.org/wiki/Albus_Dumbledore">A.D.</a></p>
</blockquote>
<p>Josh Holmes, RIA evangelist for Microsoft, who was on the original panel, made the following points in a private correspondence(which he has permitted me to copy here): </p>
<p><em><font color=#0000ff>You’re right, we can’t support the extraordinary train of technologies including everything from Access 3 to.NET 4.0….My biggest frustration with the show was that we never really defined “Complexity” and who things were complex for. I think I tried to make the point at least once that things were getting simpler to create for professional programmers but harder and harder for non-programmers (the so-called hobbyist). Even with the Getting Started posts and the like, you have to be a technologist to write an application these days with Microsoft technologies. This is one of many reasons that we are losing share to technologies such as PHP. </font></em></p>
<p>While I agree that we are not fully serving the needs of the so-called hobbyist &#8212; and parenthetically if we mean by that people who program but for whom programming is not their day job, then I think we need a different term; Programming Artisan comes to mind &#8212; I&#8217;m not sure there is anything like universal agreement that things are getting simpler for <em>professional</em> programmers. </p>
<p>There&#8217;s no doubt that with the latest technology, once mastered, we can do things more quickly, better, more simply than we could just a few years ago, however you have to factor into that equation the cost of learning the new technology, and the perceived &#8220;complexity&#8221; of myriad overlapping choices. </p>
<p>As to the hobbyist, or even the technologist attempting to transfer to .Net,there is no doubt that the learning curve has grown, if not steeper, then at least longer. That said, we all remember how much of the plumbing we used to write, and&nbsp; few of us want to back. </p>
<p>Josh continues,&nbsp; <em><font color=#0000ff>The second part of complexity that we never covered is that the software that we build is far too complex for our users. We have all of the opportunity to do something amazing but there are few firms that do. Silverlight and WPF are enabling technologies but unless the devs and designers really push it to its limits, my grandma still can’t use her applications… </font></em></p>
<p>It is certainly true that we are a long way from software that is as easy to use as a toaster, but that has been true for a very long time. I would argue that it was worse in the so-called &#8220;good old days&#8221; before things got so &#8220;complex.&#8221;&nbsp; In fact, I would argue, we are slowly learning how to make software that <em>is</em> more intuitive, easier-to-use out-of-the-box, and that appeals to a broader audience. While we absolutely have a long way to go, I don&#8217;t think we should lose sight of the enormous strides that have been made towards more intuitive interfaces in products both from within Microsoft and from numerous other software vendors.</p>
<p>The bottom line for me is that the overall experience of being a programmer requires that you know more than was needed when I started, but that&#8217;s because we&#8217;re being asked to build <em>much better products</em>. And given that, I’d far rather have today&#8217;s tools than the tools I had in the 1980s.</p>
<p><em>Please note, this post was produced through dictation; my apologies for any absurdities. It turns out that carpal tunnel syndrome is a whole lot less fun than you might expect.</em></p>
<p><em>-jesse</em></p>
]]></content:encoded>
			<wfw:commentRss>http://jesseliberty.com/2009/09/01/complexity-isn%e2%80%99t-simple/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating A Form – Level 100</title>
		<link>http://jesseliberty.com/2009/08/04/creating-a-form-%e2%80%93-level-100/</link>
		<comments>http://jesseliberty.com/2009/08/04/creating-a-form-%e2%80%93-level-100/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 20:26:00 +0000</pubDate>
		<dc:creator>Jesse Liberty</dc:creator>
				<category><![CDATA[z Silverlight Archives]]></category>
		<category><![CDATA[Xaml]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[(click on the image to see other Mini-tutorials) &#160; Turing Page [Novice: 4]&#160; FAQ&#160; Table of Contents &#160; &#160; &#160; &#160; In Novice Page 3 we were about to create a form.&#160; Here is&#160; the form we’ll create: Layout Is &#8230; <a href="http://jesseliberty.com/2009/08/04/creating-a-form-%e2%80%93-level-100/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img title=MiniTutorialLogo border=0 alt=MiniTutorialLogo src="http://silverlight.net/blogs/jesseliberty/MiniTutorialLogo_50448465.jpg" width=304 height=90 mce_src="http://silverlight.net/blogs/jesseliberty/MiniTutorialLogo_50448465.jpg"/> <br />(click on the image to see other Mini-tutorials)</p>
<p mce_keep="true">&nbsp;</p>
<p><strong></strong></p>
<p><strong><img style="MARGIN: 0px 25px 0px 0px" title=ProjectTuringLogo border=0 alt=ProjectTuringLogo align=left src="http://silverlight.net/blogs/jesseliberty/ProjectTuringLogo_2BB2F6E1.jpg" width=113 height=125 mce_src="http://silverlight.net/blogs/jesseliberty/ProjectTuringLogo_2BB2F6E1.jpg"/> </strong></p>
<p><strong></strong></p>
<p><strong></strong></p>
<p><strong></strong></p>
<p><strong></strong></p>
<p><strong></strong></p>
<p><strong></strong></p>
<p><strong>Turing Page </strong>[Novice: 4]&nbsp; <a href="http://silverlight.net/blogs/jesseliberty/pages/turing-FAQ.aspx" target=_blank>FAQ</a>&nbsp; <a href="http://silverlight.net/blogs/jesseliberty/pages/Turing-Project-Table-Of-Contents.aspx" target=_blank mce_href="http://silverlight.net/blogs/jesseliberty/pages/Turing-Project-Table-Of-Contents.aspx">Table of Contents</a></p>
<p mce_keep="true">&nbsp;</p>
<p mce_keep="true">&nbsp;</p>
<p mce_keep="true">&nbsp;</p>
<p mce_keep="true">&nbsp;</p>
<p><i></i></p>
<p><em></em></p>
<p>In Novice Page 3 we were about to create a form.&nbsp; Here is&nbsp; the form we’ll create:</p>
<p><a href="http://silverlight.net/blogs/jesseliberty/TuringBlogEntryForm_145BE8E2.jpg" mce_href="http://silverlight.net/blogs/jesseliberty/TuringBlogEntryForm_145BE8E2.jpg"><img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=TuringBlogEntryForm border=0 alt=TuringBlogEntryForm src="http://silverlight.net/blogs/jesseliberty/TuringBlogEntryForm_thumb_0CD07975.jpg" width=254 height=359 mce_src="http://silverlight.net/blogs/jesseliberty/TuringBlogEntryForm_thumb_0CD07975.jpg"/></a> </p>
<h4>Layout Is Easiest In Expression Blend</h4>
<p>To create this form, I’ll begin by opening Expression Blend 3 and creating a new Silverlight Application,</p>
<p><a href="http://silverlight.net/blogs/jesseliberty/NewBlendProject_683EEBF0.jpg" mce_href="http://silverlight.net/blogs/jesseliberty/NewBlendProject_683EEBF0.jpg"><img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=NewBlendProject border=0 alt=NewBlendProject src="http://silverlight.net/blogs/jesseliberty/NewBlendProject_thumb_19CA5986.jpg" width=304 height=214 mce_src="http://silverlight.net/blogs/jesseliberty/NewBlendProject_thumb_19CA5986.jpg"/></a> </p>
<p>If you’ve not reconfigured Blend it will open with numerous panels, some tabbed, some open as shown here:</p>
<p><a href="http://silverlight.net/blogs/jesseliberty/BlendDesignSurfaceSquashed_31EDC3E1.jpg" mce_href="http://silverlight.net/blogs/jesseliberty/BlendDesignSurfaceSquashed_31EDC3E1.jpg"><img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=BlendDesignSurfaceSquashed border=0 alt=BlendDesignSurfaceSquashed src="http://silverlight.net/blogs/jesseliberty/BlendDesignSurfaceSquashed_thumb_1F38CA2A.jpg" width=304 height=214 mce_src="http://silverlight.net/blogs/jesseliberty/BlendDesignSurfaceSquashed_thumb_1F38CA2A.jpg"/></a> </p>
<h4>A Quick Tour of Expression Blend</h4>
<p><a href="http://silverlight.net/blogs/jesseliberty/BlendToolboxClosed_1ECC9735.jpg" mce_href="http://silverlight.net/blogs/jesseliberty/BlendToolboxClosed_1ECC9735.jpg"><img style="BORDER-RIGHT-WIDTH: 0px; MARGIN: 10px 25px 10px 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=BlendToolboxClosed border=0 alt=BlendToolboxClosed align=left src="http://silverlight.net/blogs/jesseliberty/BlendToolboxClosed_thumb_49A4FB47.jpg" width=47 height=175 mce_src="http://silverlight.net/blogs/jesseliberty/BlendToolboxClosed_thumb_49A4FB47.jpg"/></a>On the far left is the toolbar a small piece of which is shown here. Notice that some of the controls have a tiny white triangle next to them. Clicking on the triangle opens up related tools.</p>
<p><a href="http://silverlight.net/blogs/jesseliberty/BlendToolboxOpen_096EE1CD.jpg" mce_href="http://silverlight.net/blogs/jesseliberty/BlendToolboxOpen_096EE1CD.jpg"><img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=BlendToolboxOpen border=0 alt=BlendToolboxOpen src="http://silverlight.net/blogs/jesseliberty/BlendToolboxOpen_thumb_1DF4314B.jpg" width=186 height=243 mce_src="http://silverlight.net/blogs/jesseliberty/BlendToolboxOpen_thumb_1DF4314B.jpg"/></a> </p>
<p>In the second image I’ve clicked on the triangle next to button and opened a panel with controls related to button.</p>
<p>Next to the toolbox are a number of tabbed panels including&nbsp; Projects, Assets, States and Parts, below which is the Objects and Timeline Panel&nbsp; </p>
<p>Note that the files in the Blend project are identical to the files in a Visual Studio project and you can and will have these files open in both applications at the same time.</p>
<p><a href="http://silverlight.net/blogs/jesseliberty/BlendProjectsWindow_569EDB58.jpg" mce_href="http://silverlight.net/blogs/jesseliberty/BlendProjectsWindow_569EDB58.jpg"><img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=BlendProjectsWindow border=0 alt=BlendProjectsWindow src="http://silverlight.net/blogs/jesseliberty/BlendProjectsWindow_thumb_5632A863.jpg" width=304 height=305 mce_src="http://silverlight.net/blogs/jesseliberty/BlendProjectsWindow_thumb_5632A863.jpg"/></a> </p>
<p>In the center of the screen is the <em>Design Surface</em> otherwise known as the <em>Art board</em>.&nbsp; </p>
<p>Also note the tiny control in the upper left corner of the Art-board that lets you switch between a grid and a canvas. Also note that surrounding the grid area (white) is a border (blue). You can use the border area to create rows and columns very quickly, as you’ll see in just a moment.</p>
<p><a href="http://silverlight.net/blogs/jesseliberty/BlendGridWindow_6EC245B3.jpg" mce_href="http://silverlight.net/blogs/jesseliberty/BlendGridWindow_6EC245B3.jpg"><img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=BlendGridWindow border=0 alt=BlendGridWindow src="http://silverlight.net/blogs/jesseliberty/BlendGridWindow_thumb_276CEFC1.jpg" width=244 height=203 mce_src="http://silverlight.net/blogs/jesseliberty/BlendGridWindow_thumb_276CEFC1.jpg"/></a> </p>
<p>Expression Blend allows you to work in a WYSIWYG environment, but it also produces Xaml that corresponds to everything you do on the design surface. You can switch to split mode to see both the design and the Xaml. </p>
<p>In fact, e<em>very visible object</em> in Silverlight is a CLR object that can be created in three ways:</p>
<p>1. In Code (as you’ll see much later in the book)</p>
<p>2. In Xaml (the markup language that we’ll be talking about quite a bit in this chapter)</p>
<p>3. By Drag and Drop into the design surface. </p>
<p>The design surface and the Xaml are two reflections of the exact same information. Dragging a control onto the design surface generates Xaml, and modifying the Xaml will be reflected on the Design surface. </p>
<p>The far upper right has three tabs:&nbsp; the properties window where you set the properties of any object on the design surface,&nbsp; Resources and&nbsp; Data.</p>
<p><a href="http://silverlight.net/blogs/jesseliberty/BlendPropertiesWindow_2E1FF944.jpg" mce_href="http://silverlight.net/blogs/jesseliberty/BlendPropertiesWindow_2E1FF944.jpg"><img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=BlendPropertiesWindow border=0 alt=BlendPropertiesWindow src="http://silverlight.net/blogs/jesseliberty/BlendPropertiesWindow_thumb_749CE94C.jpg" width=205 height=304 mce_src="http://silverlight.net/blogs/jesseliberty/BlendPropertiesWindow_thumb_749CE94C.jpg"/></a> </p>
<h4>Xaml</h4>
<p>XAML is the markup language for Silverlight. Think of it as HTML on steroids. </p>
<p>Xaml is an XML markup language (and thus is highly toolable; that is, it works very well with tools like Expression Blend and Visual Studio).</p>
<p>Xaml is highly expressive and can be used to describe not only layout (where to place controls) and standard forms-based controls (buttons, etc.) as well as graphics (ellipses, rectangles, etc.) but can also be used to declare transformations and animations of those objects, and much more.</p>
<h3>Creating a Form for Data Input</h3>
<p>Our goal is to create a simple form for data input, in which users will enter information about their favorite book.</p>
<p>We’ll build the form using the methodology of <em>successive approximation</em> also known by the technical term <em>Get it working and keep it working</em>. To tackle this, we’ll divide the work into three stages: laying out the controls, wiring up the events, and then, in subsequent chapters, connecting the data to data objects. </p>
<h4>Layout Panels</h4>
<p>There are quite a number of layout panels available, though the most common are</p>
<p>· Panel – the abstract base class for other, more specialized panels</p>
<p>· Canvas – Used for absolute positioning</p>
<p>· Stack Panel – For stacking objects on top of or next to one another</p>
<p>· Tab Panel – for tabbed layouts</p>
<p>· Docking Panel &#8211; for docking objects to the top, bottom or sides of your panel</p>
<p>· Grid – Probably the most frequently used panel. The grid allows you to create rows and columns and fill each “cell” with other controls. </p>
<p>Visual Studio and Expression Blend create a Grid panel for you by default. A grid is very much like an HTML Table, but a bit more powerful. </p>
<h4>Creating Rows And Columns</h4>
<p>Let’s start in the art board in Expression. To ensure that we have a grid, first hover over the small button at the top left corner. It will tell you if you are in Grid or Canvas mode; you want Grid.</p>
<p><b><a href="http://silverlight.net/blogs/jesseliberty/clip_image0024_221E0910.jpg" mce_href="http://silverlight.net/blogs/jesseliberty/clip_image0024_221E0910.jpg"><img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=clip_image002[4] border=0 alt=clip_image002[4] src="http://silverlight.net/blogs/jesseliberty/clip_image0024_thumb_5AC8B31D.jpg" width=244 height=165 mce_src="http://silverlight.net/blogs/jesseliberty/clip_image0024_thumb_5AC8B31D.jpg"/></a></b></p>
<p>You can now designate where you want your rows and columns. While hovering over the border a yellow line is drawn to show where your row will be created. </p>
<p><b><a href="http://silverlight.net/blogs/jesseliberty/clip_image003_617BBCA0.jpg" mce_href="http://silverlight.net/blogs/jesseliberty/clip_image003_617BBCA0.jpg"><img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: 0px; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: 0px" title=clip_image003 border=0 alt=clip_image003 src="http://silverlight.net/blogs/jesseliberty/clip_image003_thumb_533D43B0.jpg" width=231 height=193 mce_src="http://silverlight.net/blogs/jesseliberty/clip_image003_thumb_533D43B0.jpg"/></a></b></p>
<p><strong></strong></p>
<p>If you click, the line turns blue and the row is written to the Xaml. </p>
<p><b><a href="http://silverlight.net/blogs/jesseliberty/clip_image004_44FECAC0.jpg" mce_href="http://silverlight.net/blogs/jesseliberty/clip_image004_44FECAC0.jpg"><img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=clip_image004 border=0 alt=clip_image004 src="http://silverlight.net/blogs/jesseliberty/clip_image004_thumb_4BB1D443.jpg" width=180 height=168 mce_src="http://silverlight.net/blogs/jesseliberty/clip_image004_thumb_4BB1D443.jpg"/></a></b></p>
<p>The small open-lock symbol indicates that the rows are using relative spacing rather than absolute. </p>
<h4>&nbsp;</h4>
<h4>Looking At The Xaml Produced</h4>
<p>To see the markup produced by drawing these lines, click on the “split” option on the small bar to the right of the art-board </p>
<p><b><a href="http://silverlight.net/blogs/jesseliberty/clip_image005_0052307F.jpg" mce_href="http://silverlight.net/blogs/jesseliberty/clip_image005_0052307F.jpg"><img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=clip_image005 border=0 alt=clip_image005 src="http://silverlight.net/blogs/jesseliberty/clip_image005_thumb_7213B78E.jpg" width=149 height=170 mce_src="http://silverlight.net/blogs/jesseliberty/clip_image005_thumb_7213B78E.jpg"/></a></b></p>
<p>Split mode can be a big help in relating the Xaml to the design.</p>
<p><a href="http://silverlight.net/blogs/jesseliberty/SplitModenoarrows_63D53E9E.jpg" mce_href="http://silverlight.net/blogs/jesseliberty/SplitModenoarrows_63D53E9E.jpg"><img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="SplitMode no arrows" border=0 alt="SplitMode no arrows" src="http://silverlight.net/blogs/jesseliberty/SplitModenoarrows_thumb_434DFEEC.jpg" width=304 height=206 mce_src="http://silverlight.net/blogs/jesseliberty/SplitModenoarrows_thumb_434DFEEC.jpg"/></a> <br />(click on image to see larger version)</p>
<h4>&nbsp;</h4>
<h4>Creating The Rows and Putting In The Prompts</h4>
<p>Looking at the image of the form at the top of this entry, you can see that you’ll need 11 rows. Go ahead and click on the left margin about 10 or 11 times, creating somewhat evenly spaced rows. Then move to the border on top, and click to create a pair of columns.&nbsp; </p>
<p>As you add controls you can adjust the relative heights of each row (or the width of each column) to fit. </p>
<p>Start filling in the cells by adding the prompts for each row. Begin on the second row and reserve the first row for the title. </p>
<h4>Adding Prompts</h4>
<p>Click on TextBlock in the toolbox </p>
<p><a href="http://silverlight.net/blogs/jesseliberty/PickingATextBlock_3ED77E25.jpg" mce_href="http://silverlight.net/blogs/jesseliberty/PickingATextBlock_3ED77E25.jpg"><img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=PickingATextBlock border=0 alt=PickingATextBlock src="http://silverlight.net/blogs/jesseliberty/PickingATextBlock_thumb_77822832.jpg" width=304 height=217 mce_src="http://silverlight.net/blogs/jesseliberty/PickingATextBlock_thumb_77822832.jpg"/></a></p>
<p>Then drag with the mouse down to create a TextBlock in the left cell of the second row. Don’t worry about size or placement, you’ll fix that in the properties window. </p>
<p><a href="http://silverlight.net/blogs/jesseliberty/DraggingTextBlock_7715F53D.jpg" mce_href="http://silverlight.net/blogs/jesseliberty/DraggingTextBlock_7715F53D.jpg"><img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=DraggingTextBlock border=0 alt=DraggingTextBlock src="http://silverlight.net/blogs/jesseliberty/DraggingTextBlock_thumb_5DADF203.jpg" width=304 height=142 mce_src="http://silverlight.net/blogs/jesseliberty/DraggingTextBlock_thumb_5DADF203.jpg"/></a> </p>
<p>With that in place, click next to it and then turn to the Properties window.&nbsp; Name the TextBlock <em>FullNamePrompt </em>and set the alignments, margins and font size as shown here:</p>
<p><a href="http://silverlight.net/blogs/jesseliberty/LayoutForPrompts_0167199E.jpg" mce_href="http://silverlight.net/blogs/jesseliberty/LayoutForPrompts_0167199E.jpg"><img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=LayoutForPrompts border=0 alt=LayoutForPrompts src="http://silverlight.net/blogs/jesseliberty/LayoutForPrompts_thumb_5CD58C19.jpg" width=304 height=372 mce_src="http://silverlight.net/blogs/jesseliberty/LayoutForPrompts_thumb_5CD58C19.jpg"/></a> </p>
<p>Once this is set, copy the control in the Objects and Timeline panel and then paste half a dozen copies,</p>
<p><a href="http://silverlight.net/blogs/jesseliberty/copyTextBlocks_75652969.jpg" mce_href="http://silverlight.net/blogs/jesseliberty/copyTextBlocks_75652969.jpg"><img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=copyTextBlocks border=0 alt=copyTextBlocks src="http://silverlight.net/blogs/jesseliberty/copyTextBlocks_thumb_74F8F674.jpg" width=184 height=304 mce_src="http://silverlight.net/blogs/jesseliberty/copyTextBlocks_thumb_74F8F674.jpg"/></a> </p>
<p>The advantage of making these copies, and then editing each in the properties window is that you preserve the Alignments and Margins, font and font size; you then only have to set the name, text and row for each. </p>
<p>(A better solution is to use a style, which we’ll get to later in this series, and which you can read about now <a href="http://silverlight.net/blogs/jesseliberty/archive/2008/07/05/styles-and-templates.aspx" target=_blank mce_href="http://silverlight.net/blogs/jesseliberty/archive/2008/07/05/styles-and-templates.aspx">here</a> or see a video about styles <a href="http://beta.silverlight.net/learn/videos/silverlight-videos/creating-styles" target=_blank mce_href="http://beta.silverlight.net/learn/videos/silverlight-videos/creating-styles">here</a>).</p>
<h4>Adding the Input Controls</h4>
<p>When you’ve set all your prompts on the left side, it is time to add the input controls on the right.&nbsp; The first five entry rows are TextBoxes,</p>
<p>[Note that entry is done with a TextBox and the prompts are TextBlocks – the two words are very similar but the controls are quite different]</p>
<p>Drag the first TextBox into place, and set its alignment to right and bottom), set the left margin to 5 and the other three to zero, and finally, set its with to 150 and its height to 25. </p>
<p>Next make four copies, and adjust their name and row for the next four data entry fields.</p>
<p><a href="http://silverlight.net/blogs/jesseliberty/TextBoxes_5F9B410C.jpg" mce_href="http://silverlight.net/blogs/jesseliberty/TextBoxes_5F9B410C.jpg"><img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=TextBoxes border=0 alt=TextBoxes src="http://silverlight.net/blogs/jesseliberty/TextBoxes_thumb_3B09B388.jpg" width=304 height=182 mce_src="http://silverlight.net/blogs/jesseliberty/TextBoxes_thumb_3B09B388.jpg"/></a> </p>
<h4>Date Picker</h4>
<p>The sixth entry row, DateOfEntry) will get a DatePicker. To create one, click on the Chevron, which opens the advanced controls, and click on DatePicker,</p>
<p><a href="http://silverlight.net/blogs/jesseliberty/DatePicker_1E8CC1A8.jpg" mce_href="http://silverlight.net/blogs/jesseliberty/DatePicker_1E8CC1A8.jpg"><img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=DatePicker border=0 alt=DatePicker src="http://silverlight.net/blogs/jesseliberty/DatePicker_thumb_59E02766.jpg" width=304 height=176 mce_src="http://silverlight.net/blogs/jesseliberty/DatePicker_thumb_59E02766.jpg"/></a> </p>
<p>This control has a lot of flexibility in its display; much of which can be set in the properties window,</p>
<p><a href="http://silverlight.net/blogs/jesseliberty/DatePickerProps_2B86A1B9.jpg" mce_href="http://silverlight.net/blogs/jesseliberty/DatePickerProps_2B86A1B9.jpg"><img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=DatePickerProps border=0 alt=DatePickerProps src="http://silverlight.net/blogs/jesseliberty/DatePickerProps_thumb_5D120F4E.jpg" width=304 height=268 mce_src="http://silverlight.net/blogs/jesseliberty/DatePickerProps_thumb_5D120F4E.jpg"/></a> </p>
<p>For now, though, we’ll go with the defaults as shown.</p>
<h4>Radio Buttons, Check Boxes and Stack Panels</h4>
<p>The input for Level is three Radio Buttons. You can find a complete write up of using Radio Buttons here, but the key things to know are that you want all the Radio Buttons to share the same GroupName (so that they are mutually exclusive), you want one to have IsChecked clicked and, most important, you’ll want to put all the radio buttons into a stack panel. The stack panel will have its alignment set to stretch with no margins and its orientation set to horizontal. </p>
<p><a href="http://silverlight.net/blogs/jesseliberty/RadioButtons_0A932F12.jpg" mce_href="http://silverlight.net/blogs/jesseliberty/RadioButtons_0A932F12.jpg"><img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=RadioButtons border=0 alt=RadioButtons src="http://silverlight.net/blogs/jesseliberty/RadioButtons_thumb_5C39A964.jpg" width=304 height=196 mce_src="http://silverlight.net/blogs/jesseliberty/RadioButtons_thumb_5C39A964.jpg"/></a> </p>
<p>Similarly the versions input is a pair of check boxes, and they too sit in a stack panel.</p>
<h4>ListBox and ListBoxItems</h4>
<p>Finally, the Tags are chosen from a ListBox (for now). To add the ListBox open the Chevron and drag the ListBox into place, and for now you can hardwire the choices by clicking on the Items collection and adding ListBoxItems.</p>
<p><a href="http://silverlight.net/blogs/jesseliberty/ItemsCollectionEditor_5BCD766F.jpg" mce_href="http://silverlight.net/blogs/jesseliberty/ItemsCollectionEditor_5BCD766F.jpg"><img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=ItemsCollectionEditor border=0 alt=ItemsCollectionEditor src="http://silverlight.net/blogs/jesseliberty/ItemsCollectionEditor_thumb_3B4636BD.jpg" width=304 height=158 mce_src="http://silverlight.net/blogs/jesseliberty/ItemsCollectionEditor_thumb_3B4636BD.jpg"/></a> <br />(Click on the image to see a larger version)</p>
<p><strong>Save everything. </strong>Keep Blend open, but also open this same project in Visual Studio</p>
<p>Take a look at the markup&nbsp; in MainPage.xaml, you should find that the structure and syntax of Xaml is pretty easy to pick up when you compare the Xaml to the WYSIWYG design.&nbsp; </p>
<h4>Pretty Xaml</h4>
<p>I find it much easier to read the Xaml if each property is on a line by itself. To accomplish that, open Tools-&gt;Options and click on the arrow next to Text Editor. Then open up Xaml and Formatting and click on General to set the rule that formatting should be done when you paste from clipboard or complete a tag and click on Spacing to set the rule that each attribute should be on a line of its own; as shown in the following composite image:</p>
<p><a href="http://silverlight.net/blogs/jesseliberty/OptionsComposite_21DE3383.jpg" mce_href="http://silverlight.net/blogs/jesseliberty/OptionsComposite_21DE3383.jpg"><img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=OptionsComposite border=0 alt=OptionsComposite src="http://silverlight.net/blogs/jesseliberty/OptionsComposite_thumb_1A52C416.jpg" width=304 height=280 mce_src="http://silverlight.net/blogs/jesseliberty/OptionsComposite_thumb_1A52C416.jpg"/></a> </p>
<p>The Xaml that is produced becomes easier to handle, though it takes up a lot more room, as shown in the following small excerpt:</p>
<div id=codeSnippetWrapper>
<div style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" id=codeSnippet>
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum1>   1:</span> <span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">TextBox</span> <span style="COLOR: #ff0000">x:Name</span><span style="COLOR: #0000ff">="Topic"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum2>   2:</span>          <span style="COLOR: #ff0000">Height</span><span style="COLOR: #0000ff">="25"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum3>   3:</span>          <span style="COLOR: #ff0000">HorizontalAlignment</span><span style="COLOR: #0000ff">="Left"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum4>   4:</span>          <span style="COLOR: #ff0000">Margin</span><span style="COLOR: #0000ff">="5,0,0,0"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum5>   5:</span>          <span style="COLOR: #ff0000">VerticalAlignment</span><span style="COLOR: #0000ff">="Bottom"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum6>   6:</span>          <span style="COLOR: #ff0000">Width</span><span style="COLOR: #0000ff">="150"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum7>   7:</span>          <span style="COLOR: #ff0000">Grid</span>.<span style="COLOR: #ff0000">Column</span><span style="COLOR: #0000ff">="1"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum8>   8:</span>          <span style="COLOR: #ff0000">Grid</span>.<span style="COLOR: #ff0000">Row</span><span style="COLOR: #0000ff">="7"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum9>   9:</span>          <span style="COLOR: #ff0000">TextWrapping</span><span style="COLOR: #0000ff">="Wrap"</span> <span style="COLOR: #0000ff">/&gt;</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum10>  10:</span> <span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">ListBox</span> <span style="COLOR: #ff0000">x:Name</span><span style="COLOR: #0000ff">="Tags"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum11>  11:</span>          <span style="COLOR: #ff0000">HorizontalAlignment</span><span style="COLOR: #0000ff">="Left"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum12>  12:</span>          <span style="COLOR: #ff0000">Margin</span><span style="COLOR: #0000ff">="8,0,0,0"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum13>  13:</span>          <span style="COLOR: #ff0000">Width</span><span style="COLOR: #0000ff">="125"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum14>  14:</span>          <span style="COLOR: #ff0000">Grid</span>.<span style="COLOR: #ff0000">Column</span><span style="COLOR: #0000ff">="1"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum15>  15:</span>          <span style="COLOR: #ff0000">Grid</span>.<span style="COLOR: #ff0000">Row</span><span style="COLOR: #0000ff">="9"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum16>  16:</span>          <span style="COLOR: #ff0000">BorderThickness</span><span style="COLOR: #0000ff">="1,5"</span><span style="COLOR: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum17>  17:</span>     <span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">ListBoxItem</span>  <span style="COLOR: #ff0000">x:Name</span><span style="COLOR: #0000ff">="Silverlight"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum18>  18:</span>                   <span style="COLOR: #ff0000">VerticalAlignment</span><span style="COLOR: #0000ff">="Bottom"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum19>  19:</span>                   <span style="COLOR: #ff0000">FontFamily</span><span style="COLOR: #0000ff">="Georgia"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum20>  20:</span>                   <span style="COLOR: #ff0000">Content</span><span style="COLOR: #0000ff">="Silverlight"</span> <span style="COLOR: #0000ff">/&gt;</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum21>  21:</span>     <span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">ListBoxItem</span> <span style="COLOR: #ff0000">x:Name</span><span style="COLOR: #0000ff">="Expression"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum22>  22:</span>                  <span style="COLOR: #ff0000">Content</span><span style="COLOR: #0000ff">="Expression"</span> <span style="COLOR: #0000ff">/&gt;</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum23>  23:</span>     <span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">ListBoxItem</span> <span style="COLOR: #ff0000">x:Name</span><span style="COLOR: #0000ff">="VisualStudio"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum24>  24:</span>                  <span style="COLOR: #ff0000">Content</span><span style="COLOR: #0000ff">="Visual Studio"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum25>  25:</span>                  <span style="COLOR: #ff0000">IsSelected</span><span style="COLOR: #0000ff">="True"</span> <span style="COLOR: #0000ff">/&gt;</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum26>  26:</span>     <span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">ListBoxItem</span> <span style="COLOR: #ff0000">x:Name</span><span style="COLOR: #0000ff">="Blogs"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum27>  27:</span>                  <span style="COLOR: #ff0000">Content</span><span style="COLOR: #0000ff">="Blogs"</span> <span style="COLOR: #0000ff">/&gt;</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum28>  28:</span> <span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">ListBox</span><span style="COLOR: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum29>  29:</span> <span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">StackPanel</span> <span style="COLOR: #ff0000">x:Name</span><span style="COLOR: #0000ff">="ButtonsStack"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum30>  30:</span>             <span style="COLOR: #ff0000">Margin</span><span style="COLOR: #0000ff">="0"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum31>  31:</span>             <span style="COLOR: #ff0000">Grid</span>.<span style="COLOR: #ff0000">Column</span><span style="COLOR: #0000ff">="1"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum32>  32:</span>             <span style="COLOR: #ff0000">Grid</span>.<span style="COLOR: #ff0000">Row</span><span style="COLOR: #0000ff">="8"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum33>  33:</span>             <span style="COLOR: #ff0000">Orientation</span><span style="COLOR: #0000ff">="Horizontal"</span><span style="COLOR: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum34>  34:</span>     <span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">RadioButton</span> <span style="COLOR: #ff0000">x:Name</span><span style="COLOR: #0000ff">="Level100"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum35>  35:</span>                  <span style="COLOR: #ff0000">Margin</span><span style="COLOR: #0000ff">="5,0,0,0"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum36>  36:</span>                  <span style="COLOR: #ff0000">VerticalAlignment</span><span style="COLOR: #0000ff">="Bottom"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum37>  37:</span>                  <span style="COLOR: #ff0000">Content</span><span style="COLOR: #0000ff">="100"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum38>  38:</span>                  <span style="COLOR: #ff0000">GroupName</span><span style="COLOR: #0000ff">="Levels"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum39>  39:</span>                  <span style="COLOR: #ff0000">HorizontalAlignment</span><span style="COLOR: #0000ff">="Left"</span> <span style="COLOR: #0000ff">/&gt;</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum40>  40:</span>     <span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">RadioButton</span> <span style="COLOR: #ff0000">x:Name</span><span style="COLOR: #0000ff">="Level300"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum41>  41:</span>                  <span style="COLOR: #ff0000">Height</span><span style="COLOR: #0000ff">="17"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum42>  42:</span>                  <span style="COLOR: #ff0000">Margin</span><span style="COLOR: #0000ff">="5,0,0,0"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum43>  43:</span>                  <span style="COLOR: #ff0000">Width</span><span style="COLOR: #0000ff">="40"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum44>  44:</span>                  <span style="COLOR: #ff0000">Content</span><span style="COLOR: #0000ff">="300"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum45>  45:</span>                  <span style="COLOR: #ff0000">d:LayoutOverrides</span><span style="COLOR: #0000ff">="Height"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum46>  46:</span>                  <span style="COLOR: #ff0000">HorizontalAlignment</span><span style="COLOR: #0000ff">="Left"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum47>  47:</span>                  <span style="COLOR: #ff0000">VerticalAlignment</span><span style="COLOR: #0000ff">="Bottom"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum48>  48:</span>                  <span style="COLOR: #ff0000">IsChecked</span><span style="COLOR: #0000ff">="True"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum49>  49:</span>                  <span style="COLOR: #ff0000">GroupName</span><span style="COLOR: #0000ff">="Levels"</span> <span style="COLOR: #0000ff">/&gt;</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum50>  50:</span>     <span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">RadioButton</span> <span style="COLOR: #ff0000">x:Name</span><span style="COLOR: #0000ff">="Level400"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum51>  51:</span>                  <span style="COLOR: #ff0000">Height</span><span style="COLOR: #0000ff">="17"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum52>  52:</span>                  <span style="COLOR: #ff0000">HorizontalAlignment</span><span style="COLOR: #0000ff">="Left"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum53>  53:</span>                  <span style="COLOR: #ff0000">Margin</span><span style="COLOR: #0000ff">="5,0,0,0"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum54>  54:</span>                  <span style="COLOR: #ff0000">VerticalAlignment</span><span style="COLOR: #0000ff">="Bottom"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum55>  55:</span>                  <span style="COLOR: #ff0000">Width</span><span style="COLOR: #0000ff">="40"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum56>  56:</span>                  <span style="COLOR: #ff0000">Content</span><span style="COLOR: #0000ff">="400"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum57>  57:</span>                  <span style="COLOR: #ff0000">d:LayoutOverrides</span><span style="COLOR: #0000ff">="Height"</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum58>  58:</span>                  <span style="COLOR: #ff0000">GroupName</span><span style="COLOR: #0000ff">="Levels"</span> <span style="COLOR: #0000ff">/&gt;</span></pre>
<p><!--CRLF-->
<pre style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"><span style="COLOR: #606060" id=lnum59>  59:</span> <span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">StackPanel</span><span style="COLOR: #0000ff">&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<p>Your form is ready to go. Click Control-F5 to test it.</p>
<p mce_keep="true">&nbsp;</p>
<table border=0 cellSpacing=2 cellPadding=2>
<tbody>
<tr>
<td width=100><strong>Novice</strong></td>
<td width=150>Previous: &nbsp;Data Entry</td>
<td width=150>Next&nbsp;Data</td>
</tr>
<tr>
<td width=100><strong>Advanced</strong></td>
<td width=150>Previous:&nbsp;Two Levels </td>
<td width=150>Next:&nbsp;Data</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://jesseliberty.com/2009/08/04/creating-a-form-%e2%80%93-level-100/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On Learning New Technology – Controls Toolkit &amp; Examples</title>
		<link>http://jesseliberty.com/2008/11/01/on-learning-new-technology-%e2%80%93-controls-toolkit-examples/</link>
		<comments>http://jesseliberty.com/2008/11/01/on-learning-new-technology-%e2%80%93-controls-toolkit-examples/#comments</comments>
		<pubDate>Sat, 01 Nov 2008 18:34:47 +0000</pubDate>
		<dc:creator>Jesse Liberty</dc:creator>
				<category><![CDATA[z Silverlight Archives]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[&#160; I had a great PDC.&#160; I arrived with a schedule filled with sessions I intended to go to, and (shhhhh!) I skipped them all (except, ScottGu’s keynote and Scott Hanselman’s BabySmash both of which were (predictably) great).&#160; The reason &#8230; <a href="http://jesseliberty.com/2008/11/01/on-learning-new-technology-%e2%80%93-controls-toolkit-examples/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript" src="http://w.sharethis.com/widget/?tabs=email%2Cweb&amp;charset=utf-8&amp;style=default&amp;publisher=385eda54-f85a-45b2-a8ed-a53b545fb5ad&amp;popup=true&amp;embeds=true"></script>
<p>&#160;<a href="http://microsoftpdc.com/"><img title="ScottPDC" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin: 10px 20px 10px 0px; border-right-width: 0px" height="221" alt="ScottPDC" src="http://silverlight.net/blogs/jesseliberty/ScottPDC_7C2F72CD.jpg" width="301" align="left" border="0" /></a> I had a great PDC.&#160; I arrived with a schedule filled with sessions I intended to go to, and (shhhhh!) I skipped them all (except, ScottGu’s keynote and Scott Hanselman’s BabySmash both of which were (predictably) great).&#160; </p>
<p>The reason I skipped all the others (and there were a lot of excellent talks that I will now have to settle for <a href="https://sessions.microsoftpdc.com/public/timeline.aspx">seeing the recordings</a>)&#160; is that I had the singular opportunity to not only talk with, but truly engage with some amazing developers.&#160; </p>
<p>Microsoft puts on 3 major shows a year, and PDC is the most “forward looking” of the three, which means, ultimately, that a lot of what you see at PDC you probably can’t put into production code <em>today</em>.&#160; Given that and the “all in” cost of attending (admission, transportation, accommodations and missed work) it tends to attract some very serious geeks. And that can make for some very interesting conversations on any number of topics.</p>
<h3>Terse, Complex or Dead Simple?</h3>
<p>One topic that came up a lot was the universal sense of being overwhelmed by the sheer volume of new technology, and how each developer coped with learning all the new material. This lead to some fascinating discussions about how technology is taught, documented, and explained. It was very clear that there would never be consensus on the &quot;best&quot; method; there can be no one best way to teach because there&#160; is no single learning style. That said, there did seem to be two schools of thought about examples. One group seemed to strongly favor real-world examples even at the cost of a little complexity;&#160; the other to strongly favor incredibly simple examples even at the cost of being overtly artificial. </p>
<p>It is clear that I favor dead-simple examples, and I can trace that directly to learning to program what turned out to be a terrific ISAM package in C in the mid 1980s. The problem, though was in their documentation. Each of their examples was incredibly cool, but amazingly opaque. It was only after I stripped away all the indirection and programming elegance that I realized that there were just half a dozen relatively straight-forward function calls to manage. I ended up creating my own set of examples that were 1/10 the size of theirs and 10 times easier to grok. It was a lesson that is seared into my writing center. </p>
</p>
<h3>Revisiting the Controls Toolkit Examples</h3>
<p>The incredible folks in Shawn Burke&#8217;s group have released the Silverlight Control Toolkit and it comes with what I consider to be really terrific documentation, plus source code plus examples and so Bob&#8217;s Your Uncle and you&#8217;re done.&#160; But while I really like what they&#8217;ve done, I&#8217;m going to take a shot at revisiting some of the samples to really tear it down to the simplest and most visible moving parts, and along the way I&#8217;ll also take a look at using the controls in both Blend and Visual Studio.&#160; This will be an on-going effort, over a few weeks and depending on your comments and what else comes up, we&#8217;ll take some detours and delve into some of the nuances of how these controls can be used in unexpected ways.</p>
<table cellspacing="0" cellpadding="2" width="400" border="1">
<tbody>
<tr>
<td valign="top" width="400">Please <a href="http://www.codeplex.com/Silverlight/Wiki/View.aspx?title=Silverlight%20Toolkit%20Overview%20Part%203&amp;referringTitle=Home">click here</a> to download the Controls Toolkit</td>
</tr>
</tbody>
</table>
<p>I set out today to begin work on the AutoComplete control, which has all sorts of interesting nooks and crannies, but I quickly discovered that I wanted to create my own data to explore this control (and others), and this is where ADD is either a curse or a blessing, because I spent quite a bit of time spelunking through the open file dialog, and the scroll viewer (not to mention deciding on the right kind of generic collection.&#160; So, since it is the weekend, let&#8217;s actually start there and we&#8217;ll get to the AutoComplete control (part 1 of many) in the next entry.</p>
<h2></h2>
<h3>Creating A Data Set of Words</h3>
<p>What I wanted was a very large set of words (so that when we&#8217;re working with the auto-complete you can start typing (e.g., ) acc and get quite a few words that match (accent, accompany, accordand, accordingly, accosted, account, accounted, accumulate, accurate, accustomed)&#160; That lets you continue to narrow, adding an o knocks out accent and accumulate, accurate and accustomed. adding an r gets you down to just two words: accordand and accordingly.&#160; You see the point.</p>
<p>On the other hand, I did not want you to have to download a large file just to make this work, and besides, it is more interesting if you can put in your own set.&#160; So! it doesn&#8217;t take much to write a program that reads a file from your disk (Silverlight doesn&#8217;t mind reading from your disk, it is writing to your disk where it is very careful).&#160; We take the file and read in all the words and after a bit of hocus pocus create a collection of unique words (that is, we eliminate all the duplicates and all the punctuation).&#160; Sort the collection and we have just what we need.</p>
<p>Here is how I chose to do it.</p>
<p>First, i needed a file, so I went to <a href="http://www.gutenberg.org/wiki/Main_Page?fb_page_id=6195089915&amp;">Project Gutenberg</a> (a wonderful project well worth your time) where I was able to download a text version of Swan&#8217;s way by Marcel Proust (public domain).&#160; That will serve nicely as a source of words (and some interesting words at that!)</p>
<p>Second, I created a very simple UI as this is really just a utility. The UI has a button to open the file dialog, a TextBlock to let me know what is happening, and then two large TextBlocks encased inside ScrollViewers to show me the words I&#8217;ve retrieved. The left ScrollViewer displays the words in the order they were retrieved, the right displays them in alphabetical order,</p>
<p><a href="http://silverlight.net/blogs/jesseliberty/AutoFill_0276495C.jpg"><img title="AutoFill" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="459" alt="AutoFill" src="http://silverlight.net/blogs/jesseliberty/AutoFill_thumb_73CB9D76.jpg" width="470" border="0" /></a>     <br />(Figure cropped)</p>
<p>Notice that I&#8217;ve only captured 4,298 unique words. That is because I told the code to stop retrieving words once it hit 100,000 characters – why sit around all day on a weekend and 4K words is plenty.</p>
<p>Here&#8217;s the code walkthrough; nothing terribly complicated, though with luck you&#8217;ll find something new or useful…</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff">&lt;</span><span style="color: #800000">UserControl</span> <span style="color: #ff0000">x:Class</span><span style="color: #0000ff">=&quot;AutoFill1.Page&quot;</span>
    <span style="color: #ff0000">xmlns</span><span style="color: #0000ff">=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;</span>
    <span style="color: #ff0000">xmlns:x</span><span style="color: #0000ff">=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;</span>
    <span style="color: #ff0000">Width</span><span style="color: #0000ff">=&quot;400&quot;</span> <span style="color: #ff0000">Height</span><span style="color: #0000ff">=&quot;600&quot;</span><span style="color: #0000ff">&gt;</span>
    <span style="color: #0000ff">&lt;</span><span style="color: #800000">Grid</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">=&quot;LayoutRoot&quot;</span> <span style="color: #ff0000">Background</span><span style="color: #0000ff">=&quot;White&quot;</span><span style="color: #0000ff">&gt;</span>
        <span style="color: #0000ff">&lt;</span><span style="color: #800000">Grid.RowDefinitions</span><span style="color: #0000ff">&gt;</span>
            <span style="color: #0000ff">&lt;</span><span style="color: #800000">RowDefinition</span> <span style="color: #ff0000">Height</span><span style="color: #0000ff">=&quot;1*&quot;</span> <span style="color: #0000ff">/&gt;</span>
            <span style="color: #0000ff">&lt;</span><span style="color: #800000">RowDefinition</span> <span style="color: #ff0000">Height</span><span style="color: #0000ff">=&quot;5*&quot;</span> <span style="color: #0000ff">/&gt;</span>
        <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Grid.RowDefinitions</span><span style="color: #0000ff">&gt;</span>
        <span style="color: #0000ff">&lt;</span><span style="color: #800000">Grid.ColumnDefinitions</span><span style="color: #0000ff">&gt;</span>
            <span style="color: #0000ff">&lt;</span><span style="color: #800000">ColumnDefinition</span> <span style="color: #ff0000">Width</span><span style="color: #0000ff">=&quot;1*&quot;</span> <span style="color: #0000ff">/&gt;</span>
            <span style="color: #0000ff">&lt;</span><span style="color: #800000">ColumnDefinition</span> <span style="color: #ff0000">Width</span><span style="color: #0000ff">=&quot;1*&quot;</span> <span style="color: #0000ff">/&gt;</span>
        <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Grid.ColumnDefinitions</span><span style="color: #0000ff">&gt;</span>
        <span style="color: #0000ff">&lt;</span><span style="color: #800000">Button</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">=&quot;OpenFile&quot;</span> <span style="color: #ff0000">Content</span><span style="color: #0000ff">=&quot;Open File&quot;</span>
                 <span style="color: #ff0000">Height</span><span style="color: #0000ff">=&quot;30&quot;</span> <span style="color: #ff0000">Width</span><span style="color: #0000ff">=&quot;60&quot;</span> <span style="color: #ff0000">Margin</span><span style="color: #0000ff">=&quot;10&quot;</span>
                 <span style="color: #ff0000">HorizontalAlignment</span><span style="color: #0000ff">=&quot;Left&quot;</span> <span style="color: #ff0000">VerticalAlignment</span><span style="color: #0000ff">=&quot;Top&quot;</span>  <span style="color: #0000ff">/&gt;</span>
        <span style="color: #0000ff">&lt;</span><span style="color: #800000">TextBlock</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">=&quot;Totals&quot;</span> <span style="color: #ff0000">Width</span><span style="color: #0000ff">=&quot;200&quot;</span> <span style="color: #ff0000">Height</span><span style="color: #0000ff">=&quot;30&quot;</span>
            <span style="color: #ff0000">Text</span><span style="color: #0000ff">=&quot;Waiting...&quot;</span>  <span style="color: #ff0000">Grid</span>.<span style="color: #ff0000">Column</span><span style="color: #0000ff">=&quot;1&quot;</span> <span style="color: #ff0000">VerticalAlignment</span><span style="color: #0000ff">=&quot;Top&quot;</span>
            <span style="color: #ff0000">Margin</span><span style="color: #0000ff">=&quot;0,20,0,0&quot;</span><span style="color: #0000ff">/&gt;</span>

        <span style="color: #0000ff">&lt;</span><span style="color: #800000">ScrollViewer</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">=&quot;WordDisplayViewer&quot;</span>  <span style="color: #ff0000">BorderBrush</span><span style="color: #0000ff">=&quot;Black&quot;</span>
          <span style="color: #ff0000">BorderThickness</span><span style="color: #0000ff">=&quot;1&quot;</span>  <span style="color: #ff0000">Grid</span>.<span style="color: #ff0000">Row</span><span style="color: #0000ff">=&quot;1&quot;</span> <span style="color: #ff0000">Grid</span>.<span style="color: #ff0000">Column</span><span style="color: #0000ff">=&quot;0&quot;</span> <span style="color: #ff0000">Margin</span><span style="color: #0000ff">=&quot;5&quot;</span>
          <span style="color: #ff0000">Background</span><span style="color: #0000ff">=&quot;Bisque&quot;</span> <span style="color: #ff0000">VerticalScrollBarVisibility</span><span style="color: #0000ff">=&quot;Auto&quot;</span>
          <span style="color: #ff0000">HorizontalScrollBarVisibility</span><span style="color: #0000ff">=&quot;Hidden&quot;</span> <span style="color: #ff0000">VerticalAlignment</span><span style="color: #0000ff">=&quot;Stretch&quot;</span>
          <span style="color: #ff0000">Width</span><span style="color: #0000ff">=&quot;190&quot;</span> <span style="color: #0000ff">&gt;</span>
            <span style="color: #0000ff">&lt;</span><span style="color: #800000">TextBlock</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">=&quot;WordDisplay&quot;</span> <span style="color: #ff0000">TextWrapping</span><span style="color: #0000ff">=&quot;Wrap&quot;</span> <span style="color: #ff0000">Text</span><span style="color: #0000ff">=&quot;Words&quot;</span> <span style="color: #ff0000">Width</span><span style="color: #0000ff">=&quot;160&quot;</span> <span style="color: #0000ff">/&gt;</span>
        <span style="color: #0000ff">&lt;/</span><span style="color: #800000">ScrollViewer</span><span style="color: #0000ff">&gt;</span>
        <span style="color: #0000ff">&lt;</span><span style="color: #800000">ScrollViewer</span> <span style="color: #ff0000">BorderBrush</span><span style="color: #0000ff">=&quot;Black&quot;</span> <span style="color: #ff0000">BorderThickness</span><span style="color: #0000ff">=&quot;1&quot;</span> <span style="color: #ff0000">Grid</span>.<span style="color: #ff0000">Row</span><span style="color: #0000ff">=&quot;1&quot;</span>
            <span style="color: #ff0000">Grid</span>.<span style="color: #ff0000">Column</span><span style="color: #0000ff">=&quot;1&quot;</span> <span style="color: #ff0000">Margin</span><span style="color: #0000ff">=&quot;5&quot;</span> <span style="color: #ff0000">Width</span><span style="color: #0000ff">=&quot;190&quot;</span> <span style="color: #ff0000">Background</span><span style="color: #0000ff">=&quot;Wheat&quot;</span>
            <span style="color: #ff0000">VerticalScrollBarVisibility</span><span style="color: #0000ff">=&quot;Auto&quot;</span> <span style="color: #ff0000">HorizontalScrollBarVisibility</span><span style="color: #0000ff">=&quot;Hidden&quot;</span>
            <span style="color: #ff0000">VerticalAlignment</span><span style="color: #0000ff">=&quot;Stretch&quot;</span> <span style="color: #ff0000">HorizontalAlignment</span><span style="color: #0000ff">=&quot;Stretch&quot;</span><span style="color: #0000ff">&gt;</span>
             <span style="color: #0000ff">&lt;</span><span style="color: #800000">TextBlock</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">=&quot;SortDisplay&quot;</span> <span style="color: #ff0000">TextWrapping</span><span style="color: #0000ff">=&quot;Wrap&quot;</span> <span style="color: #ff0000">Width</span><span style="color: #0000ff">=&quot;160&quot;</span>
               <span style="color: #ff0000">Text</span><span style="color: #0000ff">=&quot;SortDisplay&quot;</span> <span style="color: #0000ff">/&gt;</span>
        <span style="color: #0000ff">&lt;/</span><span style="color: #800000">ScrollViewer</span><span style="color: #0000ff">&gt;</span>
    <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Grid</span><span style="color: #0000ff">&gt;</span>
<span style="color: #0000ff">&lt;/</span><span style="color: #800000">UserControl</span><span style="color: #0000ff">&gt;</span></pre>
</div>
<p>The key to having a nice scrolling block of text is to have the width of the text box be less than the width of the scrollViewer – enough to allow for the scroll bars.</p>
<p>In Page.xaml.cs I declare two private members, a StringBuilder and a List&lt;String&gt; and in Page_Loaded I provide the button&#8217;s event handler, which opens the file dialog,</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff">public</span> <span style="color: #0000ff">partial</span> <span style="color: #0000ff">class</span> Page : UserControl
{
   <span style="color: #0000ff">private</span> StringBuilder sb = <span style="color: #0000ff">new</span> StringBuilder();
   <span style="color: #0000ff">private</span> List&lt;<span style="color: #0000ff">string</span>&gt; words = <span style="color: #0000ff">new</span> List&lt;<span style="color: #0000ff">string</span>&gt;();

   <span style="color: #0000ff">public</span> Page()
   {
      InitializeComponent();
      Loaded += <span style="color: #0000ff">new</span> RoutedEventHandler( Page_Loaded );
   }

   <span style="color: #0000ff">void</span> Page_Loaded( <span style="color: #0000ff">object</span> sender, RoutedEventArgs e )
   {
      OpenFile.Click += <span style="color: #0000ff">new</span> RoutedEventHandler( OpenFile_Click );
   }</pre>
</div>
</p>
<p>The job of the event handler is to present the file dialog and then if hte user picks a file to open that file as a file stream, read through each line and using the string builder create a nice long string of up to 100,000 characters.&#160; </p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff">void</span> OpenFile_Click( <span style="color: #0000ff">object</span> sender, RoutedEventArgs e )
{
   OpenFileDialog openFileDialog1 = <span style="color: #0000ff">new</span> OpenFileDialog();

   <span style="color: #008000">// Set filter options and filter index.</span>
   openFileDialog1.Filter = <span style="color: #006080">&quot;Text Files (.txt)|*.txt|All Files (*.*)|*.*&quot;</span>;
   openFileDialog1.FilterIndex = 1;

   openFileDialog1.Multiselect = <span style="color: #0000ff">false</span>;

   <span style="color: #008000">// Call the ShowDialog method to show the dialog box.</span>
   <span style="color: #0000ff">bool</span>? userClickedOK = openFileDialog1.ShowDialog();

   <span style="color: #008000">// Process input if the user clicked OK.</span>
   <span style="color: #0000ff">if</span> ( userClickedOK == <span style="color: #0000ff">true</span> )
   {
      <span style="color: #008000">// Open the selected file to read.</span>
      System.IO.Stream fileStream = openFileDialog1.File.OpenRead();

      <span style="color: #0000ff">using</span> ( System.IO.StreamReader reader = <span style="color: #0000ff">new</span> System.IO.StreamReader( fileStream ) )
      {
         <span style="color: #0000ff">string</span> temp = <span style="color: #0000ff">string</span>.Empty;
         <span style="color: #0000ff">try</span>
         {
            <span style="color: #0000ff">do</span>
            {
               temp = reader.ReadLine();
               sb.Append( temp );
            } <span style="color: #0000ff">while</span> ( temp != <span style="color: #0000ff">null</span> &amp;&amp; sb.Length &lt; 100000 ) ;
         }
         <span style="color: #0000ff">catch</span>
         {
         }
      }
      fileStream.Close();</pre>
</div>
<p>(Notice that this is not exactly industrial-strength code. )</p>
<p><a href="http://silverlight.net/blogs/jesseliberty/SwanBook_59F76747.jpg"><img title="SwanBook" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="306" alt="SwanBook" src="http://silverlight.net/blogs/jesseliberty/SwanBook_thumb_6B67C81F.jpg" width="501" border="0" /></a>&#160; </p>
<p>In any case, once I have my string I break it into words by using the regular expression &quot;\b&quot; which separates the string into words which I put in an array of strings called AllWords. </p>
<table cellspacing="3" cellpadding="4" width="400" border="4">
<tbody>
<tr>
<td valign="top" width="400">If you are interested in regular expressions but you find books and articles on them too abstract, I can&#8217;t recommend <a href="http://www.regexbuddy.com/">RegEx Buddy</a> highly enough.&#160; You put in some text, and it (a) helps you build up your regular expression and (b) lets you test and (c) explains what works, what doesn&#8217;t and why.&#160; Caveat: it is not free.</td>
</tr>
</tbody>
</table>
<p>&#160;</p>
<p><a href="http://www.regexbuddy.com/"><img title="RegExBuddy" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="457" alt="RegExBuddy" src="http://silverlight.net/blogs/jesseliberty/RegExBuddy_4AE0886D.jpg" width="481" border="0" /></a> </p>
</p>
<p>(Regex Buddy at work – from their site)</p>
<p>&#160;</p>
<p>In any case, once my string is broken into words, I then iterate through each word to see if I have it already (I want only one copy of each word) and if not, I check to see if it is &quot;junk&quot; (has punctuation, numerals, etc.).&#160; If it passes muster, I add it to my list&lt;string&gt; and once done I display the results,</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4">
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">fileStream.Close();</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff">string</span> pattern = <span style="color: #006080">&quot;\\b&quot;</span>;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #0000ff">string</span>[] allWords = </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">System.Text.RegularExpressions.Regex.Split( </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">                  sb.ToString(), pattern );</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff">foreach</span> ( <span style="color: #0000ff">string</span> word <span style="color: #0000ff">in</span> allWords )</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">{</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">   <span style="color: #0000ff">if</span> ( words.Contains( word ) == <span style="color: #0000ff">false</span> )</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">   {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">      <span style="color: #0000ff">if</span> ( word.Length &gt; 0 &amp;&amp;  ! IsJunk( word ) )</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">      {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">         words.Add( word );</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">      }     <span style="color: #008000">// end if not junk</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">   }        <span style="color: #008000">// end if unique</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">}           <span style="color: #008000">// end for each word in all words</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">Totals.Text = words.Count + <span style="color: #006080">&quot; unique words added.&quot;</span>;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">Display();</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">}           <span style="color: #008000">// end if user clicked OK in dialog</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">             <span style="color: #008000">// end method</span></pre>
</p></div>
</div>
<p>To be able to display and use the words, I&#8217;ve created two properties,</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4">
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #0000ff">public</span> List&lt;<span style="color: #0000ff">string</span>&gt; Words</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">{</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">   get { <span style="color: #0000ff">return</span> <span style="color: #0000ff">this</span>.words; }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">}</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">&#160;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff">public</span> List&lt;<span style="color: #0000ff">string</span>&gt; SortedWords</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">{</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">   get </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">   { </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">      List&lt;<span style="color: #0000ff">string</span>&gt; temp = <span style="color: #0000ff">this</span>.words;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">      temp.Sort();</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">      <span style="color: #0000ff">return</span> temp;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">   }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">}</pre>
</p></div>
</div>
<p>Here are the two missing helper methods:</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4">
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #0000ff">private</span> <span style="color: #0000ff">void</span> Display()</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">{</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">   WordDisplay.Text = <span style="color: #0000ff">string</span>.Empty;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">   SortDisplay.Text = <span style="color: #0000ff">string</span>.Empty;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">   <span style="color: #0000ff">foreach</span> ( <span style="color: #0000ff">string</span> s <span style="color: #0000ff">in</span> Words )</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">   {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">      WordDisplay.Text += <span style="color: #006080">&quot; &quot;</span> + s;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">   }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">   <span style="color: #0000ff">foreach</span> ( <span style="color: #0000ff">string</span> s2 <span style="color: #0000ff">in</span> SortedWords )</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">   {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">      SortDisplay.Text += <span style="color: #006080">&quot; &quot;</span> + s2;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">   }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">}</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">&#160;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #0000ff">private</span> <span style="color: #0000ff">bool</span> IsJunk( <span style="color: #0000ff">string</span> theWord )</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">{</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">   <span style="color: #0000ff">foreach</span> ( <span style="color: #0000ff">char</span> c <span style="color: #0000ff">in</span> theWord.ToCharArray() )</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">   {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">      <span style="color: #0000ff">if</span> ( <span style="color: #0000ff">char</span>.IsPunctuation( c ) || <span style="color: #0000ff">char</span>.IsDigit( c ) || <span style="color: #0000ff">char</span>.IsSymbol( c ) || <span style="color: #0000ff">char</span>.IsSeparator( c ) )</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">         <span style="color: #0000ff">return</span> <span style="color: #0000ff">true</span>;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">   }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">   <span style="color: #0000ff">return</span> <span style="color: #0000ff">false</span>;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">}</pre>
</p></div>
</div>
<p>The very next thing to do (now that this works) is to refactor into three classes: the original page, the code that opens the dialog box and the code that creates the data structure of words.&#160; I&#8217;ll do that next time and use that data structure to illustrate how to use the autocomplete box. </p>
]]></content:encoded>
			<wfw:commentRss>http://jesseliberty.com/2008/11/01/on-learning-new-technology-%e2%80%93-controls-toolkit-examples/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Podcast on Templating</title>
		<link>http://jesseliberty.com/2008/09/23/podcast-on-templating/</link>
		<comments>http://jesseliberty.com/2008/09/23/podcast-on-templating/#comments</comments>
		<pubDate>Tue, 23 Sep 2008 18:16:00 +0000</pubDate>
		<dc:creator>Jesse Liberty</dc:creator>
				<category><![CDATA[z Silverlight Archives]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[&#160; &#160; I&#39;m pleased to announce that the first of my monthly Sparkling Client podcasts has been posted. This month, we take a Tour of Silverlight Templates. Resources Additional resources to supplement this topic include Tutorial on Templates Styles Video, &#8230; <a href="http://jesseliberty.com/2008/09/23/podcast-on-templating/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://silverlight.net/blogs/jesseliberty/Logo/SLLogo.jpg" border="0" alt="" />&nbsp;</p>
<p>&nbsp;</p>
<p>I&#39;m pleased to announce that the first of my monthly <a href="http://www.sparklingclient.com/templating-in-silverlight-with-jesse-liberty/" target="_blank">Sparkling Client podcasts</a> has been posted. This month, we take a <strong>Tour of Silverlight Templates. </strong></p>
<table class="">
<tr>
<td class=""><a class="" href="http://www.sparklingclient.com/templating-in-silverlight-with-jesse-liberty/" target="_blank"><img title="SaprklingClient" style="BORDER-TOP-WIDTH:0px;BORDER-LEFT-WIDTH:0px;BORDER-BOTTOM-WIDTH:0px;BORDER-RIGHT-WIDTH:0px;" height="70" alt="SaprklingClient" src="http://silverlight.net/blogs/jesseliberty/SaprklingClient_mvZNIw.jpg" width="357" align="left" border="0" /></a> </td>
<td class=""><a href="http://feeds.sparklingclient.com/SparklingClient" target="_blank"><img title="Subscribe" style="BORDER-TOP-WIDTH:0px;BORDER-LEFT-WIDTH:0px;BORDER-BOTTOM-WIDTH:0px;BORDER-RIGHT-WIDTH:0px;" height="50" alt="Subscribe" src="http://silverlight.net/blogs/jesseliberty/Subscribe_jY5tLQ.jpg" width="139" align="right" border="0" /></a> </td>
</tr>
</table>
<h3>Resources</h3>
<p>Additional resources to supplement this topic include </p>
<ul>
<li><a href="http://silverlight.net/learn/tutorials/StylesTemplatesVSM.aspx">Tutorial on Templates</a> </li>
<li><a href="http://silverlight.net/learn/learnvideo.aspx?video=69796">Styles Video</a>, <a href="http://silverlight.net/learn/learnvideo.aspx?video=69798">Templates I Video</a>, <a href="http://silverlight.net/learn/learnvideo.aspx?video=69792">Templates II Video</a> </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://jesseliberty.com/2008/09/23/podcast-on-templating/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

