<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Joe Mayo</title>
        <link>http://geekswithblogs.net/WinAZ/Default.aspx</link>
        <description>Cloud and Glue</description>
        <language>en-US</language>
        <copyright>Joe Mayo</copyright>
        <managingEditor>jmayo@mayosoftware.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <image>
            <title>Joe Mayo</title>
            <url>http://geekswithblogs.net/images/RSS2Image.gif</url>
            <link>http://geekswithblogs.net/WinAZ/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>Windows 8 ListBox 2 ListView</title>
            <category>LINQ to Twitter</category>
            <category>Windows 8</category>
            <link>http://geekswithblogs.net/WinAZ/archive/2012/02/13/windows-8-listbox-2-listview.aspx</link>
            <description>&lt;p&gt;One of the new data controls in Windows 8 Metro is the &lt;em&gt;ListView&lt;/em&gt;. The &lt;em&gt;ListView&lt;/em&gt; does the same thing as the &lt;em&gt;ListBox&lt;/em&gt;, plus more.  In this post, I’ll build on the &lt;em&gt;TwitterClient&lt;/em&gt;, from my previous post: &lt;a href="http://geekswithblogs.net/WinAZ/archive/2012/02/06/windows-8-composition-and-content.aspx" target="_blank"&gt;Windows 8 Composition and Content&lt;/a&gt;. and show how to refactor the &lt;em&gt;ListBox&lt;/em&gt; to a &lt;em&gt;ListView&lt;/em&gt;. I’ll also mention a few of the differences between the two controls.&lt;/p&gt;  &lt;h4&gt;Refactor ListBox to ListView&lt;/h4&gt;  &lt;p&gt;To save you a little time, I’ll show you the XAML for the &lt;em&gt;ListBox&lt;/em&gt;, from my previous post. Then I’ll follow up with changes for making that work as a &lt;em&gt;ListView&lt;/em&gt;. Here’s the code for the &lt;em&gt;ListBox&lt;/em&gt;:&lt;/p&gt;  &lt;pre class="brush: xml"&gt;        &amp;lt;ListBox Height="465" HorizontalAlignment="Left" Margin="5,144,0,0" 
                 Name="PublicTweetListBox" VerticalAlignment="Top" Width="1355"
                 ItemsSource="{Binding Tweets}"&amp;gt;
            &amp;lt;ListBox.ItemTemplate&amp;gt;
                &amp;lt;DataTemplate&amp;gt;
                    &amp;lt;StackPanel Orientation="Horizontal" Height="132"&amp;gt;
                        &amp;lt;Button&amp;gt;
                            &amp;lt;Image Source="{Binding ImageUrl}" 
                                   Height="73" Width="73" 
                                   VerticalAlignment="Top" Margin="0,10,8,0"/&amp;gt;
                        &amp;lt;/Button&amp;gt;
                        &amp;lt;StackPanel Width="370"&amp;gt;
                            &amp;lt;TextBlock Text="{Binding Name}" 
                                       Foreground="#FFC8AB14" FontSize="28" /&amp;gt;
                            &amp;lt;TextBlock Text="{Binding Text}" 
                                       TextWrapping="Wrap" FontSize="24" /&amp;gt;
                        &amp;lt;/StackPanel&amp;gt;
                    &amp;lt;/StackPanel&amp;gt;
                &amp;lt;/DataTemplate&amp;gt;
            &amp;lt;/ListBox.ItemTemplate&amp;gt;
        &amp;lt;/ListBox&amp;gt;&lt;/pre&gt;

&lt;p&gt;If you’ve seen the previous post, the code above isn’t anything different – it’s a &lt;em&gt;ListBox&lt;/em&gt; with a &lt;em&gt;DataTemplate&lt;/em&gt; and bindings to a ViewModel. Here’s how to change the code to switch this to a &lt;em&gt;ListView&lt;/em&gt;:&lt;/p&gt;

&lt;pre class="brush: xml"&gt;        &amp;lt;ListView Height="465" HorizontalAlignment="Left" Margin="5,144,0,0" 
                 Name="PublicTweetListView" VerticalAlignment="Top" Width="1355"
                 ItemsSource="{Binding Tweets}"&amp;gt;
            &amp;lt;ListView.ItemTemplate&amp;gt;
                &amp;lt;DataTemplate&amp;gt;
                    &amp;lt;StackPanel Orientation="Horizontal" Height="132"&amp;gt;
                        &amp;lt;Button&amp;gt;
                            &amp;lt;Image Source="{Binding ImageUrl}" 
                                   Height="73" Width="73" 
                                   VerticalAlignment="Top" Margin="0,10,8,0"/&amp;gt;
                        &amp;lt;/Button&amp;gt;
                        &amp;lt;StackPanel Width="370"&amp;gt;
                            &amp;lt;TextBlock Text="{Binding Name}" 
                                       Foreground="#FFC8AB14" FontSize="28" /&amp;gt;
                            &amp;lt;TextBlock Text="{Binding Text}" 
                                       TextWrapping="Wrap" FontSize="24" /&amp;gt;
                        &amp;lt;/StackPanel&amp;gt;
                    &amp;lt;/StackPanel&amp;gt;
                &amp;lt;/DataTemplate&amp;gt;
            &amp;lt;/ListView.ItemTemplate&amp;gt;
        &amp;lt;/ListView&amp;gt;&lt;/pre&gt;

&lt;p&gt;No need to rub your eyes, all that’s required to change from a ListBox to a ListView is to change all the tag names that say &lt;em&gt;ListBox&lt;/em&gt; to &lt;em&gt;ListView&lt;/em&gt;.  Besides a name, there’s more that changes, which I’ll discuss next.&lt;/p&gt;

&lt;h4&gt;Advantages of &lt;em&gt;ListView&lt;/em&gt; over &lt;em&gt;ListBox&lt;/em&gt;&lt;/h4&gt;

&lt;p&gt;The biggest advantage of leaving &lt;em&gt;ListBox&lt;/em&gt; in Metro is for backwards compatibility with existing XAML app platforms.  However, moving to the new Windows 8 data controls like &lt;em&gt;ListView&lt;/em&gt;, &lt;em&gt;GridView&lt;/em&gt;, etc. give you some advantages.  Windows 8 data controls have inherent support for the type of visual feedback associated with touch apps. For example, a feature called &lt;em&gt;snap grid&lt;/em&gt; causes the list to reposition a list item into view if you stopped panning when that list item is not fully in view.  Another feature is &lt;em&gt;inertia&lt;/em&gt;, where the grid keeps scrolling based on the speed of the pan. &lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: The new data/list controls have built-in behaviors, such as snap grid and inertia that are based on animations.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In addition to the visual feedback provided by the new Windows 8 controls, you also have more functionality exposed through the control’s APIs.  The &lt;em&gt;ListView&lt;/em&gt; control derives from a new class, &lt;em&gt;ListViewBase&lt;/em&gt;, and both &lt;em&gt;ListViewBase&lt;/em&gt; and &lt;em&gt;ListBox&lt;/em&gt; derive from &lt;em&gt;Selector&lt;/em&gt;:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Selector&lt;/p&gt;

  &lt;p&gt;    ListBox&lt;/p&gt;

  &lt;p&gt;    ListViewBase&lt;/p&gt;

  &lt;p&gt;        GridView&lt;/p&gt;

  &lt;p&gt;        ListView&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Through &lt;em&gt;ListViewBase&lt;/em&gt;, &lt;em&gt;ListView&lt;/em&gt; gets new events, methods, and properties that help it provide the built-in support for Metro look and feel.&lt;/p&gt;

&lt;p&gt;By moving from &lt;em&gt;ListBox&lt;/em&gt; to &lt;em&gt;ListView&lt;/em&gt;, you essentially get all this new functionality for free.  On top of that, you have API support to customize that behavior as you need.&lt;/p&gt;

&lt;h4&gt;Summary&lt;/h4&gt;

&lt;p&gt;You saw how easy it is to convert from &lt;em&gt;ListBox&lt;/em&gt; to &lt;em&gt;ListView&lt;/em&gt;. I followed up with a few comments about the benefits of &lt;em&gt;ListView&lt;/em&gt; over &lt;em&gt;ListBox&lt;/em&gt;, explaining how &lt;em&gt;ListView&lt;/em&gt; gives you all the new Metro look and feel behaviors for free.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://twitter.com/#!/JoeMayo" target="_blank"&gt;@JoeMayo&lt;/a&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/WinAZ/aggbug/148687.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Joe Mayo</dc:creator>
            <guid>http://geekswithblogs.net/WinAZ/archive/2012/02/13/windows-8-listbox-2-listview.aspx</guid>
            <pubDate>Mon, 13 Feb 2012 15:19:08 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/WinAZ/comments/148687.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/WinAZ/archive/2012/02/13/windows-8-listbox-2-listview.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/WinAZ/comments/commentRss/148687.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/WinAZ/services/trackbacks/148687.aspx</trackback:ping>
        </item>
        <item>
            <title>Windows 8 Composition and Content</title>
            <category>LINQ to Twitter</category>
            <category>Windows 8</category>
            <link>http://geekswithblogs.net/WinAZ/archive/2012/02/06/windows-8-composition-and-content.aspx</link>
            <description>&lt;p&gt;Composition is an integral part of Windows 8 UI design from both &lt;a href="http://en.wikipedia.org/wiki/Composition_(visual_arts)" target="_blank"&gt;aesthetic&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/Composite_pattern" target="_blank"&gt;logical&lt;/a&gt; perspectives. This post modified my previous post, &lt;a href="http://geekswithblogs.net/WinAZ/archive/2012/01/30/refactoring-windows-8-code-behind-to-mvvm.aspx" target="_blank"&gt;Refactoring Windows 8 Code-Behind to MVVM&lt;/a&gt;. adding to the variety of compositional examples.  I’ll start with an explanation of composition in Windows 8, modify the previous code to show the power of composition, and then highlight a few more existing examples of where composition naturally fits into the Windows 8 UI environment.&lt;/p&gt;  &lt;h4&gt;Understanding Windows 8 Composition&lt;/h4&gt;  &lt;p&gt;A Windows 8 UI is built like a tree. You have a single root element that surrounds all other elements, multiple branches containing more elements, and finally many leaves that don’t contain any elements. In shorthand, the structure looks something like this:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Root&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;    Content&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;        Branch&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;            Branch&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;                Leaf&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;            Branch&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;                Leaf&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;                Leaf&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;        Branch&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;            Leaf&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;You might have noticed that I sneaked in an extra element, &lt;em&gt;Content&lt;/em&gt;, in the figure above that I hadn’t talked about yet. Nevertheless, &lt;em&gt;Content&lt;/em&gt; is necessary and important in Windows 8 development. The figure above is a generalization of the hierarchical relationship between elements.  However, the XAML below, based on the previous post, is a concrete example:&lt;/p&gt;  &lt;pre class="brush: xml"&gt;&amp;lt;UserControl x:Class="TwitterClient.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="768" d:DesignWidth="1366"&amp;gt;
  
    &amp;lt;Grid x:Name="LayoutRoot" Background="#FF0C0C0C"&amp;gt;
        &amp;lt;Button Content="Refresh Public Tweets" Height="72" Width="365" 
                HorizontalAlignment="Left"  Margin="500,66,0,0" 
                Name="RefreshButton" VerticalAlignment="Top"
                Command="{Binding RefreshCommand}"/&amp;gt;
        &amp;lt;ListBox Height="465" HorizontalAlignment="Left" Margin="5,144,0,0" 
                 Name="PublicTweetListBox" VerticalAlignment="Top" Width="1355"
                 ItemsSource="{Binding Tweets}"&amp;gt;
            &amp;lt;ListBox.ItemTemplate&amp;gt;
                &amp;lt;DataTemplate&amp;gt;
                    &amp;lt;StackPanel Orientation="Horizontal" Height="132"&amp;gt;
                        &amp;lt;Image Source="{Binding ImageUrl}" 
                               Height="73" Width="73" 
                               VerticalAlignment="Top" Margin="0,10,8,0"/&amp;gt;
                        &amp;lt;StackPanel Width="370"&amp;gt;
                            &amp;lt;TextBlock Text="{Binding Name}" 
                                       Foreground="#FFC8AB14" FontSize="28" /&amp;gt;
                            &amp;lt;TextBlock Text="{Binding Text}" 
                                       TextWrapping="Wrap" FontSize="24" /&amp;gt;
                        &amp;lt;/StackPanel&amp;gt;
                    &amp;lt;/StackPanel&amp;gt;
                &amp;lt;/DataTemplate&amp;gt;
            &amp;lt;/ListBox.ItemTemplate&amp;gt;
        &amp;lt;/ListBox&amp;gt;
    &amp;lt;/Grid&amp;gt;   
&amp;lt;/UserControl&amp;gt;&lt;/pre&gt;

&lt;p&gt;The example above gives a better idea of the compositional relationship between elements and how they form a tree that is visually identifiable through proper spacing of elements. &lt;em&gt;UserControl&lt;/em&gt; is the &lt;em&gt;Root&lt;/em&gt; element and &lt;em&gt;Grid&lt;/em&gt; is the &lt;em&gt;Content&lt;/em&gt; element for &lt;em&gt;Root&lt;/em&gt;.  Subsequent elements form a hierarchy, further displaying the compositional nature of Windows 8 UI development.&lt;/p&gt;

&lt;p&gt;Since the examples in this post are based on the &lt;a href="http://geekswithblogs.net/WinAZ/archive/2012/01/30/refactoring-windows-8-code-behind-to-mvvm.aspx" target="_blank"&gt;previous post&lt;/a&gt;, you might find it useful to have a few tips on getting from there to here, which is discussed next.&lt;/p&gt;

&lt;h4&gt;Reusing Previous Code&lt;/h4&gt;

&lt;p&gt;Over the past couple of posts, I’ve renamed the same project to something new.  This is more tedious than necessary, so I’ll just rename the project one more time to something more generic, like TwitterClient. If you’re thinking, “Oh no, not &lt;strong&gt;another &lt;/strong&gt;Twitter client!”, don’t worry. It’s just a sample program – and besides, no one will ever use it. &lt;/p&gt;

&lt;p&gt;Here’s a quick walk-through of the file system part of the rename:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Make a copy of &lt;em&gt;RefactorToMVVM&lt;/em&gt; folder in Windows Explorer and rename it to &lt;strong&gt;TwitterClient&lt;/strong&gt;. &lt;/li&gt;

  &lt;li&gt;In the new &lt;em&gt;TwitterClient&lt;/em&gt; folder, rename the solution file, &lt;em&gt;RefactorToMVVM.sln&lt;/em&gt;, to &lt;strong&gt;TwitterClient.sln&lt;/strong&gt;. &lt;/li&gt;

  &lt;li&gt;Unhide files and rename &lt;em&gt;RefactorToMVVM.v11.suo&lt;/em&gt; to &lt;strong&gt;TwitterClient.v11.suo&lt;/strong&gt; (Alternatively delete because VS11 recreates it for you). &lt;/li&gt;

  &lt;li&gt;Rename the project folder, &lt;em&gt;RefactorToMVVM&lt;/em&gt;, to &lt;strong&gt;TwitterClient&lt;/strong&gt;. &lt;/li&gt;

  &lt;li&gt;In the new &lt;em&gt;TwitterClient&lt;/em&gt; project folder, rename the project file, &lt;em&gt;RefactorToMVVM.csproj&lt;/em&gt;, to &lt;strong&gt;TwitterClient.csproj&lt;/strong&gt;. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now your file names are up-to-date, you’ll need to change a couple more items in the solution. To get started on this part, go back to the &lt;em&gt;TwitterClient&lt;/em&gt; solution folder and double-click on &lt;em&gt;TwitterClient.sln&lt;/em&gt; to open the solution. You’ll see an error saying that VS can’t open the &lt;em&gt;RefactorToMVVM&lt;/em&gt; project and that’s okay because you intentionally renamed it – meaning that the solution file won’t be able to find the project file under it’s new name. Click &lt;em&gt;OK&lt;/em&gt; for the error message box that appears. The following steps fix the project load problem and take you through the rest of the renaming:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;After the solution loads, right-click on the grayed-out &lt;em&gt;RefactorToMVVM&lt;/em&gt; project and select &lt;em&gt;Remove&lt;/em&gt;. &lt;/li&gt;

  &lt;li&gt;Right-click on the solution, select &lt;em&gt;Add, Existing Project&lt;/em&gt; and an &lt;em&gt;Add Existing Project&lt;/em&gt; window will appear. &lt;/li&gt;

  &lt;li&gt;Navigate to the &lt;em&gt;TwitterClient&lt;/em&gt; solution, down to the &lt;em&gt;TwitterClient&lt;/em&gt; project, select &lt;em&gt;TwitterClient.csproj&lt;/em&gt; and click &lt;em&gt;OK&lt;/em&gt;. The new project will load. &lt;/li&gt;

  &lt;li&gt;Under the &lt;em&gt;TwitterClient&lt;/em&gt; project, double-click &lt;em&gt;Properties&lt;/em&gt; to open the &lt;em&gt;Properties&lt;/em&gt; configuration page. &lt;/li&gt;

  &lt;li&gt;On the &lt;em&gt;Properties&lt;/em&gt; &lt;em&gt;Application&lt;/em&gt; tab, change both the &lt;em&gt;Assembly name&lt;/em&gt; and &lt;em&gt;Default namespaces&lt;/em&gt; to &lt;strong&gt;TwitterClient&lt;/strong&gt;. &lt;/li&gt;

  &lt;li&gt;Open &lt;em&gt;Tweet.cs&lt;/em&gt; (or any code file), select &lt;em&gt;RefactorToMVVM&lt;/em&gt;, type &lt;strong&gt;Ctrl+R+R&lt;/strong&gt;, and rename to &lt;strong&gt;TwitterClient&lt;/strong&gt;. Select preview, comments, and strings options and observe all the places in code where the change is made.  Click &lt;em&gt;Apply&lt;/em&gt; when you’re ready to make the changes. &lt;/li&gt;

  &lt;li&gt;Double-click the &lt;em&gt;Package.appxmanifest&lt;/em&gt; file, which opens the &lt;em&gt;Package&lt;/em&gt; configuration window. &lt;/li&gt;

  &lt;li&gt;On the &lt;em&gt;Application UI&lt;/em&gt; tab, change &lt;em&gt;Display Name&lt;/em&gt; to &lt;strong&gt;TwitterClient&lt;/strong&gt;, &lt;em&gt;Entry Point&lt;/em&gt; to &lt;strong&gt;TwitterClient.App&lt;/strong&gt;, and &lt;em&gt;Description&lt;/em&gt; to &lt;strong&gt;Client Application for Twitter&lt;/strong&gt;. &lt;/li&gt;

  &lt;li&gt;On the &lt;em&gt;Packaging&lt;/em&gt; tab, change &lt;em&gt;Package Display Name&lt;/em&gt; to &lt;strong&gt;TwitterClient&lt;/strong&gt;. &lt;/li&gt;

  &lt;li&gt;Save and close &lt;em&gt;Package.appxmanifest&lt;/em&gt;. &lt;/li&gt;

  &lt;li&gt;The visual designer for &lt;em&gt;Package.appxmanifest&lt;/em&gt; doesn’t let you change everything and there’s one more item to remember. Right-click on &lt;em&gt;Package.appxmanifest&lt;/em&gt;, select &lt;em&gt;Open With&lt;/em&gt;, select &lt;em&gt;XML Editor&lt;/em&gt;, and click &lt;em&gt;OK&lt;/em&gt;. &lt;/li&gt;

  &lt;li&gt;Under &lt;em&gt;/Applications/Application&lt;/em&gt;, change the &lt;em&gt;Executable&lt;/em&gt; attribute to &lt;strong&gt;TwitterClient.exe&lt;/strong&gt;. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;font color="#ffffff"&gt;Before finishing, press F7 to build the solution. If you have errors, it’s most likely because of the naming changes done previously. So, it would be useful to retrace your steps if the error message doesn’t lead you to the answer right away.  Now that we have a new renamed solution/project, we can proceed to an in-depth discussion of Composition and Content by adding a button the the tweet list.&lt;/font&gt;&lt;/p&gt;

&lt;h4&gt;Adding a Button&lt;/h4&gt;

&lt;p&gt;&lt;font color="#ffffff"&gt;Here, we’re not going to just add a button, we’re going to examine how a button supports composition through its &lt;em&gt;Content&lt;/em&gt; property. You’ll see attribute content, element content, and a cool trick that makes it easy to code compositional content in XAML.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color="#ffffff"&gt;If you want a simple button with text, you can use the &lt;em&gt;Content&lt;/em&gt; attribute, like this:&lt;/font&gt;&lt;/p&gt;

&lt;pre class="brush: xml"&gt;&amp;lt;Button Content="{Binding Name}" /&amp;gt;&lt;/pre&gt;

&lt;p&gt;The XAML &lt;em&gt;Content&lt;/em&gt; attribute corresponds to a &lt;em&gt;Content&lt;/em&gt; property of the &lt;em&gt;Button&lt;/em&gt; class. Your first thought, upon seeing the &lt;em&gt;Content&lt;/em&gt; property on a &lt;em&gt;Button&lt;/em&gt;, might be to ask, “Why isn’t this property named Text?” That’s a logical question, especially if you’ve been using &lt;a href="http://msdn.microsoft.com/en-us/library/ms158234.aspx" target="_blank"&gt;Windows Forms&lt;/a&gt;, &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.button.text.aspx" target="_blank"&gt;ASP.NET&lt;/a&gt;, or one of many other UI frameworks. Actually, Windows 8 is closer to both Silverlight and WPF in their view of composition and content. &lt;/p&gt;

&lt;p&gt;The primary rationale for content is because text isn’t the only object you can display on a button. You can add different types of UI elements to a button by assigning those items to the &lt;em&gt;Content&lt;/em&gt; property. In previous frameworks, that don’t support content, you would have needed to slog through extra code to create a special button. With Windows 8, you only need to assign a value to the content property of a given control. Here’s an example for creating a button that contains an image:&lt;/p&gt;

&lt;pre class="brush: xml"&gt;                        &amp;lt;Button&amp;gt;
                            &amp;lt;Button.Content&amp;gt;
                                &amp;lt;Image Source="{Binding ImageUrl}" 
                                       Height="73" Width="73" 
                                       VerticalAlignment="Top" Margin="0,10,8,0"/&amp;gt;
                            &amp;lt;/Button.Content&amp;gt;
                        &amp;lt;/Button&amp;gt;&lt;/pre&gt;

&lt;p&gt;Above, &lt;em&gt;Button&lt;/em&gt; contains an image, which can’t be represented in text, as previously shown via the &lt;em&gt;Content&lt;/em&gt; attribute. This example uses Property Element syntax – &lt;em&gt;which is the control type and property name, separated by a dot&lt;/em&gt;. The power of this approach to re-defining the appearance of a button can’t be understated – you can see how easy it is to do. &lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: The content property isn’t always named &lt;em&gt;Content&lt;/em&gt;. i.e. Types derived from &lt;em&gt;ItemsControl&lt;/em&gt;, such as &lt;em&gt;ListBox&lt;/em&gt; designate the &lt;em&gt;Items&lt;/em&gt; property as their content property.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A control can be decorated with  &lt;em&gt;Windows.UI.Xaml.Markup.ContentPropertyAttribute&lt;/em&gt;, specifying what the content property is for that control. In the case of &lt;em&gt;Button&lt;/em&gt;, the content property is &lt;em&gt;Content&lt;/em&gt; (same name):&lt;/p&gt;

&lt;pre class="brush: csharp"&gt;    [ContentProperty("Content")]
    public class UserControl : Windows.UI.Xaml.Controls.Control
    {
        // ...

        public UIElement Content { get; set; }

        // ...
    }&lt;/pre&gt;

&lt;p&gt;This is good information if you’re a control developer, but it’s also interesting because of a special feature of content properties that gives you simpler syntax. More specifically, you can remove the Property Element syntax, like this:&lt;/p&gt;

&lt;pre class="brush: xml"&gt;                        &amp;lt;Button&amp;gt;
                            &amp;lt;Image Source="{Binding ImageUrl}" 
                                   Height="73" Width="73" 
                                   VerticalAlignment="Top" Margin="0,10,8,0"/&amp;gt;
                        &amp;lt;/Button&amp;gt;&lt;/pre&gt;

&lt;p&gt;The image  below is a new snapshot of the updated screen, showing how the images look as buttons. As you can see, customizing buttons is very easy.  More to the point, composing custom UI elements is easy via Windows 8 content support.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/WinAZ/Windows-Live-Writer/Windows-8-Composition-and-Content_F9C8/image_2.png"&gt;&lt;img style="border-width: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/WinAZ/Windows-Live-Writer/Windows-8-Composition-and-Content_F9C8/image_thumb.png" width="244" height="139" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;While this discussion focused on the Button, many other control types have content properties and support composition the same way.  If you look back at the XAML in the previous section, “Understanding Windows 8 Composition”, you’ll see several more composition examples, including &lt;em&gt;UserControl/Grid&lt;/em&gt;, &lt;em&gt;Grid/Elements&lt;/em&gt;, &lt;em&gt;ListBox/ListBox.ItemTemplate&lt;/em&gt;, and so on.&lt;/p&gt;

&lt;h4&gt;Summary&lt;/h4&gt;

&lt;p&gt;This post demonstrated the inherent support for composition in Windows 8 UI development. This capability is supported via content properties.  You saw how &lt;em&gt;Button&lt;/em&gt; demonstrates the power of composition and the role of the content property in facilitating composition.  Remember that &lt;em&gt;Button&lt;/em&gt; is only an example, and you should understand that other controls have content properties.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://twitter.com/#!/JoeMayo" target="_blank"&gt;@JoeMayo&lt;/a&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/WinAZ/aggbug/148612.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Joe Mayo</dc:creator>
            <guid>http://geekswithblogs.net/WinAZ/archive/2012/02/06/windows-8-composition-and-content.aspx</guid>
            <pubDate>Mon, 06 Feb 2012 17:11:55 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/WinAZ/comments/148612.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/WinAZ/archive/2012/02/06/windows-8-composition-and-content.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/WinAZ/comments/commentRss/148612.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/WinAZ/services/trackbacks/148612.aspx</trackback:ping>
        </item>
        <item>
            <title>Refactoring Windows 8 Code-Behind to MVVM</title>
            <category>Twitter</category>
            <category>LINQ to Twitter</category>
            <category>Windows 8</category>
            <link>http://geekswithblogs.net/WinAZ/archive/2012/01/30/refactoring-windows-8-code-behind-to-mvvm.aspx</link>
            <description>&lt;p&gt;In my previous post, &lt;a href="http://geekswithblogs.net/WinAZ/archive/2012/01/26/using-linq-to-twitter-in-windows-8-metro-apps.aspx" target="_blank"&gt;Using LINQ to Twitter in Windows 8 Metro Apps&lt;/a&gt;, I cheated a little (some might say a lot) on my UI architecture by using code-behind. In this post, I’ll make it all better by showing you how to separate the model and interaction logic from the UI design – proper separation of concerns.&lt;/p&gt;  &lt;p&gt;I’ll accomplish this with a pattern, named Model-View-ViewModel (MVVM), which is widely used for WPF, Silverlight, and (soon) Windows 8 Metro Apps.  I’ll start by discussing what MVVM is, move to how I’ll apply it to the previous Windows 8 Metro app, and finish with a step-by-step walkthrough to refactor from code-behind to MVVM.&lt;/p&gt;  &lt;h4&gt;Understanding MVVM&lt;/h4&gt;  &lt;p&gt;The subject of whether to use MVVM or not can be debated forever.  However, it’s a useful way to achieve separation of concerns in your application and many people like and use it, including myself.&lt;/p&gt;  &lt;p&gt;Jeremy Likeness has a nice site that specializes in the subject: &lt;a href="http://www.mvvmexplained.com/" target="_blank"&gt;MVVM Explained&lt;/a&gt;.&lt;/p&gt;  &lt;h4&gt;Designing Our Implementation&lt;/h4&gt;  &lt;p&gt;There are a handful of good frameworks for helping you write applications using MVVM. In this app, Since Windows 8 is so new, these frameworks aren’t generally available or ready. However, MVVM is a pattern, not a library, and you can always provide your own code to support the pattern, as you’ll see in this post.&lt;/p&gt;  &lt;p&gt;This application will work exactly the same as the original, displaying public tweets when a button is clicked, but the internal implementation will be modified.  In particular, the classes and relationship between classes are altered to match the MVVM pattern. The following illustration shows this relationship:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/WinAZ/Windows-Live-Writer/f075254230a0_126ED/MVVM_2.png"&gt;&lt;img style="border-width: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="MVVM" border="0" alt="MVVM" src="http://geekswithblogs.net/images/geekswithblogs_net/WinAZ/Windows-Live-Writer/f075254230a0_126ED/MVVM_thumb.png" width="151" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;The three objects in the illustration above represent files for implementing a &lt;em&gt;View&lt;/em&gt;, &lt;em&gt;ViewModel&lt;/em&gt;, and &lt;em&gt;Model&lt;/em&gt;. The view is MainPage.xaml, where you can see tweets and click the Refresh button. The model is an object that holds information for a single tweet. Actually, we’ll be working with a list of tweets, which will be held in the &lt;em&gt;ViewModel&lt;/em&gt; and bound to the View. &lt;/p&gt;  &lt;p&gt;In some diagrams, you’ll see a binding layer between the &lt;em&gt;ViewModel&lt;/em&gt; and &lt;em&gt;View&lt;/em&gt;, which is an important part of their relationship. In fact the binding relationship can be involved, but this application is so simple that I’ve also opted for a simpler diagram. Besides managing the model and supporting data binding, the &lt;em&gt;ViewModel&lt;/em&gt; is instrumental in holding the current state of the view.  i.e. if you select a ComboBox option, it’s the View that holds onto the value that is selected. Here’s a breakdown in responsibilities for this app:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;u&gt;Model&lt;/u&gt;: Hold data for a single tweet. Technically, the list of tweets, held by the &lt;em&gt;ViewModel&lt;/em&gt; is also a model component – instead of a single instance it’s a collection of instances. &lt;!--EndFragment--&gt;&lt;/li&gt;    &lt;li&gt;&lt;u&gt;ViewModel&lt;/u&gt;: Hold a list of current tweets and provide a command handler that responds to Refresh button clicks and populates the list of tweets. &lt;!--EndFragment--&gt;&lt;/li&gt;    &lt;li&gt;&lt;u&gt;View:&lt;/u&gt; Display tweets and let the user click a refresh button. &lt;/li&gt; &lt;/ul&gt;  &lt;h4&gt;Refactoring the Model&lt;/h4&gt;  &lt;p&gt;In the previous post, I named the object bound to the &lt;em&gt;View&lt;/em&gt; with a &lt;em&gt;ViewModel&lt;/em&gt; suffix, &lt;em&gt;TweetViewModel&lt;/em&gt;. To fix this, select the &lt;em&gt;TweetViewModel.cs&lt;/em&gt; file, in the Solution Explorer Project, press &lt;strong&gt;F2&lt;/strong&gt; and change the name to &lt;em&gt;Tweet.cs&lt;/em&gt;. You’ll see a message box asking if you want to do a rename and you should click the &lt;em&gt;Yes&lt;/em&gt; button, which renames the class name in the file as well as any declarations of that class in the project. &lt;/p&gt;  &lt;p&gt;Next, rename the &lt;em&gt;Tweet&lt;/em&gt; property, of the &lt;em&gt;Tweet&lt;/em&gt; class by selecting the property name, &lt;em&gt;Tweet&lt;/em&gt;, press &lt;strong&gt;Ctrl+R+R&lt;/strong&gt;, change &lt;em&gt;Tweet&lt;/em&gt; to &lt;em&gt;Text&lt;/em&gt; in the &lt;em&gt;New name&lt;/em&gt; box of the &lt;em&gt;Rename&lt;/em&gt; message box that appears, and click &lt;em&gt;OK&lt;/em&gt;. Here’s the updated &lt;em&gt;Tweet&lt;/em&gt; class:&lt;/p&gt;  &lt;div style="color: black; background-color: white;"&gt;   &lt;pre&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System;
&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Collections.Generic;
&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Linq;
&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Text;
&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Threading.Tasks;

&lt;span style="color: blue;"&gt;namespace&lt;/span&gt; RefactorToMVVM
{
    &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; Tweet
    {
        &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; Name { &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;; }
        &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; Text { &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;; }
        &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; ImageUrl { &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;; }
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: I’ve also done a refactoring of the namespace, &lt;em&gt;LinqToTwitterPublicQuery&lt;/em&gt;, to &lt;em&gt;RefactorToMVVM&lt;/em&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Though this class was previously called a &lt;em&gt;ViewModel&lt;/em&gt;, the name didn’t capture the essence of what a &lt;em&gt;ViewModel&lt;/em&gt; is about: model access, binding, and state management. You’ll see some of this in the next section.&lt;/p&gt;

&lt;h4&gt;Creating the ViewModel&lt;/h4&gt;

&lt;p&gt;The &lt;em&gt;ViewModel&lt;/em&gt; is often described as “A model of the View”, which is a non-visual abstraction of the view. The &lt;em&gt;ViewModel&lt;/em&gt; supports separation of concerns where the concern of designing a UI occurs in the XAML, but the concern of state management and responding to events belongs to the &lt;em&gt;ViewModel&lt;/em&gt;. In this simple &lt;em&gt;ViewModel&lt;/em&gt;, we’ll add just enough functionality to be architecturally correct, but no more than is needed for this application. More specifically, we’ll create the &lt;em&gt;PublicTweetsViewModel&lt;/em&gt;, shown below, that references a model and responds to refresh commands from the &lt;em&gt;View&lt;/em&gt; (remember to add a project reference to &lt;em&gt;LinqToTwitter.dll&lt;/em&gt;):&lt;/p&gt;

&lt;div style="color: black; background-color: white;"&gt;
  &lt;pre&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Collections.Generic;
&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Linq;
&lt;span style="color: blue;"&gt;using&lt;/span&gt; LinqToTwitter;
&lt;span style="color: blue;"&gt;using&lt;/span&gt; Windows.UI.Xaml.Data;

&lt;span style="color: blue;"&gt;namespace&lt;/span&gt; RefactorToMVVM
{
    &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; PublicTweetViewModel : INotifyPropertyChanged
    {
        &lt;span style="color: blue;"&gt;public&lt;/span&gt; List&amp;lt;Tweet&amp;gt; Tweets { &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;; }

        &lt;span style="color: blue;"&gt;public&lt;/span&gt; PublicTweetViewModel()
        {
            RefreshCommand = &lt;span style="color: blue;"&gt;new&lt;/span&gt; TwitterCommand&amp;lt;&lt;span style="color: blue;"&gt;object&lt;/span&gt;&amp;gt;(OnRefresh);
        }

        &lt;span style="color: blue;"&gt;public&lt;/span&gt; TwitterCommand&amp;lt;&lt;span style="color: blue;"&gt;object&lt;/span&gt;&amp;gt; RefreshCommand { &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;; }

        &lt;span style="color: blue;"&gt;void&lt;/span&gt; OnRefresh(&lt;span style="color: blue;"&gt;object&lt;/span&gt; obj)
        {
            &lt;span style="color: blue;"&gt;var&lt;/span&gt; twitterCtx = &lt;span style="color: blue;"&gt;new&lt;/span&gt; TwitterContext();

            Tweets =
                (&lt;span style="color: blue;"&gt;from&lt;/span&gt; tweet &lt;span style="color: blue;"&gt;in&lt;/span&gt; twitterCtx.Status
                 &lt;span style="color: blue;"&gt;where&lt;/span&gt; tweet.Type == StatusType.Public
                 &lt;span style="color: blue;"&gt;select&lt;/span&gt; &lt;span style="color: blue;"&gt;new&lt;/span&gt; Tweet
                 {
                     Name = tweet.User.Name,
                     Text = tweet.Text,
                     ImageUrl = tweet.User.ProfileImageUrl
                 })
                .ToList();

            &lt;span style="color: blue;"&gt;if&lt;/span&gt; (PropertyChanged != &lt;span style="color: blue;"&gt;null&lt;/span&gt;)
            {
                PropertyChanged(&lt;span style="color: blue;"&gt;this&lt;/span&gt;, &lt;span style="color: blue;"&gt;new&lt;/span&gt; PropertyChangedEventArgs(&lt;span style="color: rgb(163, 21, 21);"&gt;"Tweets"&lt;/span&gt;));
            }
        }

        &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;event&lt;/span&gt; PropertyChangedEventHandler PropertyChanged;
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;The code above has a constructor, &lt;em&gt;Tweets&lt;/em&gt; collection property, &lt;em&gt;RefreshCommand&lt;/em&gt; property, &lt;em&gt;OnRefresh&lt;/em&gt; method, and &lt;em&gt;PropertyChanged&lt;/em&gt; event. The &lt;em&gt;Tweets&lt;/em&gt; collection will hold a list of public tweets and is populated by the &lt;em&gt;OnRefresh&lt;/em&gt; method. Tracing back, the constructor adds the &lt;em&gt;OnRefresh&lt;/em&gt; method as a handler for the &lt;em&gt;RefreshCommand&lt;/em&gt; property, using the &lt;em&gt;TwitterCommand&lt;/em&gt;, which is a special implementation of &lt;em&gt;ICommand&lt;/em&gt;. Here’s the implementation of &lt;em&gt;TwitterCommand&lt;/em&gt;, which you should add to another file, named &lt;em&gt;TwitterCommand.cs&lt;/em&gt;:&lt;/p&gt;

&lt;div style="color: black; background-color: white;"&gt;
  &lt;pre&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System;
&lt;span style="color: blue;"&gt;using&lt;/span&gt; Windows.UI.Xaml.Input;

&lt;span style="color: blue;"&gt;namespace&lt;/span&gt; RefactorToMVVM
{
    &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; TwitterCommand&amp;lt;T&amp;gt; : ICommand
    {
        &lt;span style="color: blue;"&gt;readonly&lt;/span&gt; Action&amp;lt;T&amp;gt; callback;

        &lt;span style="color: blue;"&gt;public&lt;/span&gt; TwitterCommand(Action&amp;lt;T&amp;gt; handler)
        {
            callback = handler;
        }

        &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;bool&lt;/span&gt; CanExecute(&lt;span style="color: blue;"&gt;object&lt;/span&gt; parameter)
        {
            &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: blue;"&gt;true&lt;/span&gt;;
        }

        &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;event&lt;/span&gt; Windows.UI.Xaml.EventHandler CanExecuteChanged;

        &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Execute(&lt;span style="color: blue;"&gt;object&lt;/span&gt; parameter)
        {
            &lt;span style="color: blue;"&gt;if&lt;/span&gt; (callback != &lt;span style="color: blue;"&gt;null&lt;/span&gt;) callback((T)parameter);
        }
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;The &lt;em&gt;TwitterCommand&lt;/em&gt; constructor accepts an &lt;em&gt;Action&lt;/em&gt; delegate, assigning &lt;em&gt;handler&lt;/em&gt; to &lt;em&gt;callback&lt;/em&gt;. When the &lt;em&gt;View&lt;/em&gt; triggers the &lt;em&gt;RefreshCommand&lt;/em&gt; in &lt;em&gt;PublicTweetViewModel&lt;/em&gt;, &lt;em&gt;Execute&lt;/em&gt; is invoked, which then invokes the &lt;em&gt;callback&lt;/em&gt; delegate that the &lt;em&gt;PublicTweetViewModel&lt;/em&gt; constructor assigned to the &lt;em&gt;OnRefresh&lt;/em&gt; method.&lt;/p&gt;

&lt;p&gt;When &lt;em&gt;OnRefresh&lt;/em&gt; executes, it isn’t enough to just assign results to &lt;em&gt;Tweets&lt;/em&gt;, you must also let the &lt;em&gt;View&lt;/em&gt; know it should display the new data. This is where the &lt;em&gt;INotifyPropertyChanged&lt;/em&gt; interface helps. The &lt;em&gt;PropertyChanged&lt;/em&gt; event is a member of &lt;em&gt;INotifyPropertyChanged&lt;/em&gt; and the &lt;em&gt;View&lt;/em&gt; listens to this event. The following code is a snippet of &lt;em&gt;PublicTweeViewModel&lt;/em&gt;, shown previously, with only the &lt;em&gt;INotifyPropertyChanged&lt;/em&gt; related code:&lt;/p&gt;

&lt;div style="color: black; background-color: white;"&gt;
  &lt;pre&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;...&lt;/font&gt;&lt;/pre&gt;

  &lt;pre&gt;    &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; PublicTweetViewModel : INotifyPropertyChanged
    {
        &lt;span style="color: blue;"&gt;...&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;        &lt;span style="color: blue;"&gt;void&lt;/span&gt; OnRefresh(&lt;span style="color: blue;"&gt;object&lt;/span&gt; obj)
        {
            &lt;span style="color: blue;"&gt;...&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;            &lt;span style="color: blue;"&gt;if&lt;/span&gt; (PropertyChanged != &lt;span style="color: blue;"&gt;null&lt;/span&gt;)
            {
                PropertyChanged(&lt;span style="color: blue;"&gt;this&lt;/span&gt;, &lt;span style="color: blue;"&gt;new&lt;/span&gt; PropertyChangedEventArgs(&lt;span style="color: rgb(163, 21, 21);"&gt;"Tweets"&lt;/span&gt;));
            }
        }

        &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;event&lt;/span&gt; PropertyChangedEventHandler PropertyChanged;
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;After &lt;a href="http://linqtotwitter.codeplex.com/" target="_blank"&gt;LINQ to Twitter&lt;/a&gt; gets new tweets, &lt;em&gt;OnRefresh&lt;/em&gt; fires the &lt;em&gt;PropertyChanged&lt;/em&gt; event, passing the property name, &lt;em&gt;Tweets&lt;/em&gt;, that changed. This tells the &lt;em&gt;View&lt;/em&gt; to re-bind to &lt;em&gt;Tweets&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;With the &lt;em&gt;ViewModel&lt;/em&gt; in place, all that’s left to do is hook up the &lt;em&gt;ViewModel&lt;/em&gt; in the &lt;em&gt;View&lt;/em&gt; and complete binding so the &lt;em&gt;View&lt;/em&gt; doesn’t use code-behind anymore.&lt;/p&gt;

&lt;h4&gt;Binding the ViewModel to the View&lt;/h4&gt;

&lt;p&gt;The first &lt;em&gt;View&lt;/em&gt; related task is to fix the code-behind problem. Essentially, remove all unnecessary code from &lt;em&gt;MainPage.xaml.cs&lt;/em&gt;. So, you can delete the entire &lt;em&gt;RefreshButton_Click&lt;/em&gt; method and set the &lt;em&gt;DataContext&lt;/em&gt; for the &lt;em&gt;View&lt;/em&gt;, like this:&lt;/p&gt;

&lt;div style="color: black; background-color: white;"&gt;
  &lt;pre&gt;&lt;span style="color: blue;"&gt;namespace&lt;/span&gt; RefactorToMVVM
{
    &lt;span style="color: blue;"&gt;partial&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; MainPage
    {
        &lt;span style="color: blue;"&gt;public&lt;/span&gt; MainPage()
        {
            InitializeComponent();
            DataContext = &lt;span style="color: blue;"&gt;new&lt;/span&gt; PublicTweetViewModel();
        }
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Notice how the &lt;em&gt;MainPage&lt;/em&gt; constructor sets its &lt;em&gt;DataContext&lt;/em&gt; property to an instance of &lt;em&gt;PublicTweetViewModel&lt;/em&gt;. I won’t put any more code in the code-behind.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: I could have avoided putting any extra code in the code-behind by setting the &lt;em&gt;DataContext&lt;/em&gt; in XAML. Unfortunately, the preview version of VS11 doesn’t support that yet.  If you do, you’ll see a message like &lt;em&gt;“Method 'add_PropertyChanged' in type 'RefactorToMVVM.PublicTweetViewModel' from assembly 'refactortomvvm.intermediate, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.    C:\Users\jmayo\Documents\Visual Studio 11\Projects\RefactorToMVVM\RefactorToMVVM\MainPage.xaml    RefactorToMVVM”&lt;/em&gt;. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now, all the binding expressions in &lt;em&gt;MainPage.xaml&lt;/em&gt; can reference properties of &lt;em&gt;PublicTweetViewModel&lt;/em&gt;. This includes binding &lt;em&gt;RefreshButton&lt;/em&gt; and &lt;em&gt;PublicTweetListBox&lt;/em&gt;, like this:&lt;/p&gt;

&lt;div style="color: black; background-color: white;"&gt;
  &lt;pre&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;UserControl&lt;/span&gt; &lt;span style="color: red;"&gt;x:Class&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;RefactorToMVVM.MainPage&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;
    &lt;span style="color: red;"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;http://schemas.microsoft.com/winfx/2006/xaml/presentation&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;
    &lt;span style="color: red;"&gt;xmlns:x&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;http://schemas.microsoft.com/winfx/2006/xaml&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;
    &lt;span style="color: red;"&gt;xmlns:d&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;http://schemas.microsoft.com/expression/blend/2008&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;
    &lt;span style="color: red;"&gt;xmlns:mc&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;http://schemas.openxmlformats.org/markup-compatibility/2006&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;
    &lt;span style="color: red;"&gt;mc:Ignorable&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;d&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;
    &lt;span style="color: red;"&gt;d:DesignHeight&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;768&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: red;"&gt;d:DesignWidth&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;1366&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
  
    &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Grid&lt;/span&gt; &lt;span style="color: red;"&gt;x:Name&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;LayoutRoot&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: red;"&gt;Background&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;#FF0C0C0C&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Button&lt;/span&gt; &lt;span style="color: red;"&gt;Content&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;Refresh Public Tweets&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: red;"&gt;Height&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;72&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: red;"&gt;Width&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;365&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; 
                &lt;span style="color: red;"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;Left&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;  &lt;span style="color: red;"&gt;Margin&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;500,66,0,0&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; 
                &lt;span style="color: red;"&gt;Name&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;RefreshButton&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: red;"&gt;VerticalAlignment&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;Top&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;
                &lt;span style="color: red;"&gt;Command&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;{Binding RefreshCommand}&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;ListBox&lt;/span&gt; &lt;span style="color: red;"&gt;Height&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;465&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: red;"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;Left&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: red;"&gt;Margin&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;5,144,0,0&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; 
                 &lt;span style="color: red;"&gt;Name&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;PublicTweetListBox&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: red;"&gt;VerticalAlignment&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;Top&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: red;"&gt;Width&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;1355&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;
                 &lt;span style="color: red;"&gt;ItemsSource&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;{Binding Tweets}&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
            &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;ListBox.ItemTemplate&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
                &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;DataTemplate&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;StackPanel&lt;/span&gt; &lt;span style="color: red;"&gt;Orientation&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;Horizontal&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: red;"&gt;Height&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;132&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
                        &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Image&lt;/span&gt; &lt;span style="color: red;"&gt;Source&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;{Binding ImageUrl}&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; 
                               &lt;span style="color: red;"&gt;Height&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;73&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: red;"&gt;Width&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;73&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; 
                               &lt;span style="color: red;"&gt;VerticalAlignment&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;Top&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: red;"&gt;Margin&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;0,10,8,0&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;StackPanel&lt;/span&gt; &lt;span style="color: red;"&gt;Width&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;370&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
                            &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;TextBlock&lt;/span&gt; &lt;span style="color: red;"&gt;Text&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;{Binding Name}&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; 
                                       &lt;span style="color: red;"&gt;Foreground&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;#FFC8AB14&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: red;"&gt;FontSize&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;28&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;
                            &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;TextBlock&lt;/span&gt; &lt;span style="color: red;"&gt;Text&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;{Binding Text}&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; 
                                       &lt;span style="color: red;"&gt;TextWrapping&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;Wrap&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: red;"&gt;FontSize&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;24&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;StackPanel&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;StackPanel&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
                &lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;DataTemplate&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
            &lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;ListBox.ItemTemplate&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;ListBox&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Grid&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;   
&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;UserControl&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;For &lt;em&gt;RefreshButton&lt;/em&gt;, remove the &lt;em&gt;Click&lt;/em&gt; event handler and replace it with the command binding shown above. This is how the &lt;em&gt;RefreshCommand&lt;/em&gt; property in the &lt;em&gt;PublicTweetViewModel&lt;/em&gt;, which is an instance of &lt;em&gt;TwitterCommand&lt;/em&gt; binds to the button.&lt;/p&gt;

&lt;p&gt;Since we already deleted the &lt;em&gt;RefreshButton_Click&lt;/em&gt; method from the code behind, we need to tell &lt;em&gt;PublicTweetListBox&lt;/em&gt; to get it’s data by binding the &lt;em&gt;Tweets&lt;/em&gt; collection, from &lt;em&gt;PublicTweetViewModel&lt;/em&gt;, to the &lt;em&gt;ItemsSource&lt;/em&gt; property.&lt;/p&gt;

&lt;p&gt;Within the &lt;em&gt;DataTemplate&lt;/em&gt; for &lt;em&gt;PublicTweetsListBox&lt;/em&gt;, each individual tweet binds the same as the previous post. The exception is that you must change the &lt;em&gt;TextBlock&lt;/em&gt; binding for the previously named property, &lt;em&gt;Tweet&lt;/em&gt;, to &lt;em&gt;Text&lt;/em&gt;. If you recall, we changed the &lt;em&gt;Tweet&lt;/em&gt; property of the model (also named &lt;em&gt;Tweet&lt;/em&gt;) to &lt;em&gt;Text&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;That’s it, press &lt;strong&gt;F5&lt;/strong&gt; to run the application. You’ll notice that it works exactly like the previous application where pressing the &lt;em&gt;Refresh Public Tweets&lt;/em&gt; button will load public tweets to the screen.&lt;/p&gt;

&lt;h4&gt;Summary&lt;/h4&gt;

&lt;p&gt;In this post, I attempted to redeem myself from the supposed crimes of those who would be offended. Seriously, the MVVM pattern is pretty slick in how it relies primarily on binding and keeps the UI design separate from the implementation. You saw an image of how the previous code would be refactored to support MVVM. Then I took you through a series of steps that refactored the &lt;em&gt;Model&lt;/em&gt;, created a new &lt;em&gt;ViewModel&lt;/em&gt; and an &lt;em&gt;ICommand&lt;/em&gt; implementation. Finally, you learned how to connect the &lt;em&gt;ViewModel&lt;/em&gt; to the &lt;em&gt;View&lt;/em&gt; and bind the &lt;em&gt;ICommand&lt;/em&gt; to the &lt;em&gt;Button&lt;/em&gt; and data to a &lt;em&gt;ListBox&lt;/em&gt;. The result is an application that works the same as its code-behind predecessor, yet is more maintainable because of the clean separation of concerns that MVVM helps with.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://twitter.com/#!/JoeMayo" target="_blank"&gt;@JoeMayo&lt;/a&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/WinAZ/aggbug/148527.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Joe Mayo</dc:creator>
            <guid>http://geekswithblogs.net/WinAZ/archive/2012/01/30/refactoring-windows-8-code-behind-to-mvvm.aspx</guid>
            <pubDate>Mon, 30 Jan 2012 16:22:13 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/WinAZ/comments/148527.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/WinAZ/archive/2012/01/30/refactoring-windows-8-code-behind-to-mvvm.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/WinAZ/comments/commentRss/148527.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/WinAZ/services/trackbacks/148527.aspx</trackback:ping>
        </item>
        <item>
            <title>Using LINQ to Twitter in Windows 8 Metro Apps</title>
            <category>Twitter</category>
            <category>LINQ to Twitter</category>
            <category>Windows 8</category>
            <link>http://geekswithblogs.net/WinAZ/archive/2012/01/26/using-linq-to-twitter-in-windows-8-metro-apps.aspx</link>
            <description>&lt;p&gt;While the title of this post suggests focus on LINQ to Twitter, it also indicates that I’ll be discussing how to build a Windows 8 Metro application. The application itself will display a list of tweets from Twitter’s public feed.  In the sections that follow, you’ll read background information on pre-requisites to understanding the post, learn how to get LINQ to Twitter working with Visual Studio 11, and then see a step-by-step on how the application is built. &lt;/p&gt;  &lt;h4&gt;Getting Started&lt;/h4&gt;  &lt;p&gt;You can build Metro applications with various languages, including C#, C++, JavaScript, and VB.  This example uses C#. This post doesn’t dive into the gory details of how this works, but stays at the application level to hit the singular goal of building a simple application.  You can visit the &lt;a href="http://msdn.microsoft.com/en-us/windows/" target="_blank"&gt;MSDN Windows developer center for more details&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;The development model for Metro is similar to WPF or Silverlight. The user interface (UI) is built with XAML with a startup App.xaml and MainPage.xaml and associated files.  If you haven’t worked with WPF or Silverlight, it would be helpful for you to learn some basic XAML, which you can find with a quick Web (Bing, Google, etc.) search.  I’ll be describing the application in terms of XAML, rather than visual designer interaction.  If you need a quick intro to C#, check out &lt;a href="http://www.csharp-station.com/" target="_blank"&gt;C# Station&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;You’ll also need to install Windows 8 and Visual Studio 11 (VS11), again visiting &lt;a href="http://msdn.microsoft.com/en-us/windows/" target="_blank"&gt;MSDN Windows developer center for more details&lt;/a&gt; for more information.  &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: The “11” in Visual Studio 11 isn’t the year. The version # for Visual Studio is #11 and the beta preview is named Visual Studio 11. This could be confusing because the previous version was #10 and named Visual Studio 2010.&lt;/p&gt; &lt;/blockquote&gt;  &lt;h4&gt;Setting up LINQ to Twitter&lt;/h4&gt;  &lt;p&gt;&lt;a href="http://linqtotwitter.codeplex.com/" target="_blank"&gt;LINQ to Twitter&lt;/a&gt; works seamlessly with Windows 8 Metro applications, without recompilation. This means that you can visit the &lt;a href="http://linqtotwitter.codeplex.com/releases/view/77843" target="_blank"&gt;LINQ to Twitter download page&lt;/a&gt; at CodePlex.com and get the latest version.  Since Visual Studio 11 works with the .NET 4.0 (v4.0.30319 as of the preview), you should download the version labeled “LINQ to Twitter .NET 4.0 Binaries“.&lt;/p&gt;  &lt;h4&gt;Creating the Project&lt;/h4&gt;  &lt;p&gt;After you open VS11, press &lt;strong&gt;Ctrl+Shift+N&lt;/strong&gt; and you’ll see the following &lt;em&gt;New Project&lt;/em&gt; window:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/WinAZ/Windows-Live-Writer/5ed5141a4fe1_F043/NewProject_2.png"&gt;&lt;img style="border-width: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="NewProject" border="0" alt="NewProject" src="http://geekswithblogs.net/images/geekswithblogs_net/WinAZ/Windows-Live-Writer/5ed5141a4fe1_F043/NewProject_thumb.png" width="244" height="150" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;From the &lt;em&gt;New Project&lt;/em&gt; window, select &lt;em&gt;Visual C# &amp;gt; Windows Metro Style&lt;/em&gt; from the tree view on the left. You have various application types to choose from and each is interesting for learning some basic layout techniques.  This post doesn’t cover all those features because I want to show you something simpler.  So, select &lt;em&gt;Application&lt;/em&gt; from the list and name the file &lt;em&gt;LinqToTwitterPublicQuery&lt;/em&gt;. VS creates a new project that looks like this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/WinAZ/Windows-Live-Writer/5ed5141a4fe1_F043/CreatedProject_2.png"&gt;&lt;img style="border-width: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="CreatedProject" border="0" alt="CreatedProject" src="http://geekswithblogs.net/images/geekswithblogs_net/WinAZ/Windows-Live-Writer/5ed5141a4fe1_F043/CreatedProject_thumb.png" width="244" height="132" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;After the VS creates the application, you’ll see a new file in the designer and new projects in &lt;em&gt;Solution Explorer&lt;/em&gt;. The file, &lt;em&gt;MainPage.xaml&lt;/em&gt;, is the default first page to show when your application starts. To keep things simple, we’ll work on &lt;em&gt;MainPage.xaml&lt;/em&gt; to display public tweets.&lt;/p&gt;  &lt;p&gt;In &lt;em&gt;Solution Explorer&lt;/em&gt;, the &lt;em&gt;LinqToTwitterPublicQuery&lt;/em&gt; project has various folders and files. The &lt;em&gt;Properties&lt;/em&gt;, and &lt;em&gt;References&lt;/em&gt; folders serve the same purpose as other .NET project types. The &lt;em&gt;Images&lt;/em&gt; folder contains default images for logos and splash screen. You can replace these images with your own. The &lt;em&gt;App.xaml&lt;/em&gt; file contains initialization logic/markup to start the application, but we won’t be looking at it in this post, accepting whatever it’s defaults are. The &lt;em&gt;Package.appxmanifest&lt;/em&gt; file contains XML formatted configuration information for the application. Double-clicking &lt;em&gt;Package.appxmanifest&lt;/em&gt; opens a visual designer that makes it easy to change these parameters, but again we’ll take the defaults. Our primary focus is &lt;em&gt;MainPage.xaml&lt;/em&gt;, which I discuss next.&lt;/p&gt;  &lt;h4&gt;Examining &lt;em&gt;MainPage.xaml&lt;/em&gt;&lt;/h4&gt;  &lt;p&gt;&lt;em&gt;MainPage.xaml&lt;/em&gt; is the surface upon which our UI will be built. VS provides a visual designer, giving you drag and drop capabilities to quickly populate the screen with controls. There’s also a more sophisticated UI tool, Blend, that lets you build UI’s. These are nice tools, but the XAML for this application is simple and it’s very useful to be able to work with it, so that’s what I’ll use. Here’s the XAML for &lt;em&gt;MainPage.xaml&lt;/em&gt;:&lt;/p&gt;  &lt;div style="color: black; background-color: white;"&gt;   &lt;pre&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;UserControl&lt;/span&gt; &lt;span style="color: red;"&gt;x:Class&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;LinqToTwitterPublicQuery.MainPage&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;
    &lt;span style="color: red;"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;http://schemas.microsoft.com/winfx/2006/xaml/presentation&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;
    &lt;span style="color: red;"&gt;xmlns:x&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;http://schemas.microsoft.com/winfx/2006/xaml&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;
    &lt;span style="color: red;"&gt;xmlns:d&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;http://schemas.microsoft.com/expression/blend/2008&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;
    &lt;span style="color: red;"&gt;xmlns:mc&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;http://schemas.openxmlformats.org/markup-compatibility/2006&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;
    &lt;span style="color: red;"&gt;mc:Ignorable&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;d&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;
    &lt;span style="color: red;"&gt;d:DesignHeight&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;768&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: red;"&gt;d:DesignWidth&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;1366&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
    
    &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Grid&lt;/span&gt; &lt;span style="color: red;"&gt;x:Name&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;LayoutRoot&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: red;"&gt;Background&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;#FF0C0C0C&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;

    &lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Grid&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
    
&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;UserControl&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;If you’re familiar with XML, you’ll notice that the XAML above is XML. Really, it’s a special type of XML used for building UI’s in WPF, Silverlight, and now Windows8. As described by the outer tag, &lt;em&gt;MainPage.xaml&lt;/em&gt; is a &lt;em&gt;UserControl&lt;/em&gt;. The namespaces are normal for supporting XAML UIs and integration with external tools, such as Blend. You can also see that the width and height are specified as attributes of the &lt;em&gt;UserControl&lt;/em&gt; tag, after namespace declarations. The &lt;em&gt;Grid&lt;/em&gt; is a layout control that works well for specifying rows and columns. You can change the &lt;em&gt;Background&lt;/em&gt; attribute from nearly black, but the darker backgrounds save power, which might be appreciated even more on mobile devices, such as tablets.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; XAML is also used in non-UI applications, such as Windows Workflow, but for our purposes here, we’re primarily interested in using it to build UIs.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;Peeking at the &lt;em&gt;MainPage.xaml.cs&lt;/em&gt; Code-Behind&lt;/h4&gt;

&lt;p&gt;In addition to XAML, &lt;em&gt;MainPage&lt;/em&gt; has a code-behind file, named &lt;em&gt;MainPage.xaml.cs&lt;/em&gt;. You can open the code-behind by opening the tree branch by &lt;em&gt;MainPage.xaml&lt;/em&gt; in the project. Here’s the code from the code-behind:&lt;/p&gt;

&lt;div style="color: black; background-color: white;"&gt;
  &lt;pre&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System;
&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Collections.Generic;
&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Linq;
&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Threading.Tasks;
&lt;span style="color: blue;"&gt;using&lt;/span&gt; Windows.Foundation;
&lt;span style="color: blue;"&gt;using&lt;/span&gt; Windows.UI.Xaml;
&lt;span style="color: blue;"&gt;using&lt;/span&gt; Windows.UI.Xaml.Controls;
&lt;span style="color: blue;"&gt;using&lt;/span&gt; Windows.UI.Xaml.Data;

&lt;span style="color: blue;"&gt;namespace&lt;/span&gt; LinqToTwitterPublicQuery
{
    &lt;span style="color: blue;"&gt;partial&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; MainPage
    {
        &lt;span style="color: blue;"&gt;public&lt;/span&gt; MainPage()
        {
            InitializeComponent();
        }
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;The relationship between the &lt;em&gt;MainPage&lt;/em&gt; class above and the XAML is that they are &lt;em&gt;partial&lt;/em&gt; types of the same class. The syntax in the XAML that indicates its matching &lt;em&gt;partial&lt;/em&gt; is the &lt;em&gt;x:Class&lt;/em&gt; attribute of the &lt;em&gt;UserControl&lt;/em&gt; tag. When you build your project, the XAML transforms to C# code with a &lt;em&gt;partial&lt;/em&gt; name of &lt;em&gt;MainPage&lt;/em&gt;, as specified by the &lt;em&gt;x:Class&lt;/em&gt; attribute and the resulting class has an &lt;em&gt;InitializeComponent&lt;/em&gt; method, containing the C# code that creates all the controls specified in the XAML. &lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: I refer to code-behind because of my own familiarity with legacy .NET UI frameworks. Furthermore, the blasphemy continues by ignoring the popular UI architectural practices, such as MVVM. My goal is simplicity and raw functionality, rather than to impress with my pattern prowess (or lack thereof). For those who would be offended, I beg forgiveness in advance.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The code-behind above has a constructor that calls &lt;em&gt;InitializeComponent&lt;/em&gt;. The crux of this factoid is that you now know that all controls on the page will be instantiated and initialized after the &lt;em&gt;InitializeComponent&lt;/em&gt; method call, making them safe to call. In contrast, those controls don’t exist before the &lt;em&gt;InitializeComponent&lt;/em&gt; call. Right-now the XAML and associated code-behind are nearly empty, except for a &lt;em&gt;Grid&lt;/em&gt;, the next section discusses what type of data will be shown in the UI.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Tip&lt;/strong&gt;: Drilling down on &lt;em&gt;MainPage.xaml.cs&lt;/em&gt; in the project in &lt;em&gt;Solution Explorer&lt;/em&gt; will allow you to see the generated code (build the project first) in a VS generated file named &lt;em&gt;MainPage.g.i.cs&lt;/em&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;Building the &lt;em&gt;ViewModel&lt;/em&gt;&lt;/h4&gt;

&lt;p&gt;The &lt;em&gt;ViewModel&lt;/em&gt; is a class I’m building to define what information will display in the XAML. The XAML is the &lt;em&gt;View&lt;/em&gt; and the data bound to the View is a &lt;em&gt;ViewModel&lt;/em&gt;. (Somewhere in this stream, the pattern-police are bound to bust me.) The &lt;em&gt;TweetViewModel&lt;/em&gt; in this application is shown below:&lt;/p&gt;

&lt;div style="color: black; background-color: white;"&gt;
  &lt;pre&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System;
&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Collections.Generic;
&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Linq;
&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Text;
&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Threading.Tasks;

&lt;span style="color: blue;"&gt;namespace&lt;/span&gt; LinqToTwitterPublicQuery
{
    &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; TweetViewModel
    {
        &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; Name { &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;; }
        &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; Tweet { &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;; }
        &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; ImageUrl { &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;; }
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;The properties in the code above will hold data for an individual user’s name, tweet text, and URL where their profile image is stored. Now, lets look at the XAML to see how this data is displayed.&lt;/p&gt;

&lt;h4&gt;Designing the UI&lt;/h4&gt;

&lt;p&gt;The look and feel of the UI is defined with XAML, which leads back to &lt;em&gt;MainPage.xaml&lt;/em&gt;. We’ll enhance the existing &lt;em&gt;Grid&lt;/em&gt; with a &lt;em&gt;Button&lt;/em&gt; to load tweets and a &lt;em&gt;ListBox&lt;/em&gt; to display the tweets. Here’s the updated &lt;em&gt;MainPage.xaml&lt;/em&gt;:&lt;/p&gt;

&lt;div style="color: black; background-color: white;"&gt;
  &lt;pre&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;UserControl&lt;/span&gt; &lt;span style="color: red;"&gt;x:Class&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;LinqToTwitterPublicQuery.MainPage&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;
    &lt;span style="color: red;"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;http://schemas.microsoft.com/winfx/2006/xaml/presentation&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;
    &lt;span style="color: red;"&gt;xmlns:x&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;http://schemas.microsoft.com/winfx/2006/xaml&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;
    &lt;span style="color: red;"&gt;xmlns:d&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;http://schemas.microsoft.com/expression/blend/2008&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;
    &lt;span style="color: red;"&gt;xmlns:mc&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;http://schemas.openxmlformats.org/markup-compatibility/2006&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;
    &lt;span style="color: red;"&gt;mc:Ignorable&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;d&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;
    &lt;span style="color: red;"&gt;d:DesignHeight&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;768&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: red;"&gt;d:DesignWidth&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;1366&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
    
    &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Grid&lt;/span&gt; &lt;span style="color: red;"&gt;x:Name&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;LayoutRoot&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: red;"&gt;Background&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;#FF0C0C0C&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Button&lt;/span&gt; &lt;span style="color: red;"&gt;Content&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;Refresh Public Tweets&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: red;"&gt;Height&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;72&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: red;"&gt;Width&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;365&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; 
                &lt;span style="color: red;"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;Left&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;  &lt;span style="color: red;"&gt;Margin&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;500,66,0,0&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; 
                &lt;span style="color: red;"&gt;Name&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;RefreshButton&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: red;"&gt;VerticalAlignment&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;Top&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;ListBox&lt;/span&gt; &lt;span style="color: red;"&gt;Height&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;465&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: red;"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;Left&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: red;"&gt;Margin&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;5,144,0,0&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; 
                 &lt;span style="color: red;"&gt;Name&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;PublicTweetListBox&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: red;"&gt;VerticalAlignment&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;Top&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: red;"&gt;Width&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;1355&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
            &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;ListBox.ItemTemplate&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
                &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;DataTemplate&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;StackPanel&lt;/span&gt; &lt;span style="color: red;"&gt;Orientation&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;Horizontal&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: red;"&gt;Height&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;132&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
                        &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Image&lt;/span&gt; &lt;span style="color: red;"&gt;Source&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;{Binding ImageUrl}&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; 
                               &lt;span style="color: red;"&gt;Height&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;73&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: red;"&gt;Width&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;73&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; 
                               &lt;span style="color: red;"&gt;VerticalAlignment&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;Top&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: red;"&gt;Margin&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;0,10,8,0&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;StackPanel&lt;/span&gt; &lt;span style="color: red;"&gt;Width&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;370&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
                            &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;TextBlock&lt;/span&gt; &lt;span style="color: red;"&gt;Text&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;{Binding Name}&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; 
                                       &lt;span style="color: red;"&gt;Foreground&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;#FFC8AB14&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: red;"&gt;FontSize&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;28&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;
                            &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;TextBlock&lt;/span&gt; &lt;span style="color: red;"&gt;Text&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;{Binding Tweet}&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; 
                                       &lt;span style="color: red;"&gt;TextWrapping&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;Wrap&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: red;"&gt;FontSize&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;24&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;StackPanel&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;StackPanel&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
                &lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;DataTemplate&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
            &lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;ListBox.ItemTemplate&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;ListBox&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Grid&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;   
&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;UserControl&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Within the &lt;em&gt;Grid&lt;/em&gt; in the XAML above, there’s a &lt;em&gt;Button&lt;/em&gt; and a &lt;em&gt;ListBox&lt;/em&gt;. As indicated by its name, &lt;em&gt;Button&lt;/em&gt; is for refreshing the list of public tweets, which I’ll describe the inner workings for soon. &lt;em&gt;ListBox&lt;/em&gt; normally displays a list of strings as it’s default behavior, but this application needs special formatting for the &lt;em&gt;ImageUrl&lt;/em&gt;, &lt;em&gt;Name&lt;/em&gt;, and &lt;em&gt;Tweet&lt;/em&gt; properties of the bound &lt;em&gt;TweetViewModel&lt;/em&gt; instances. This is where data templates come in. &lt;/p&gt;

&lt;p&gt;As you can see above the &lt;em&gt;DataTemplate&lt;/em&gt; element resides within the &lt;em&gt;ListBox.ItemTemplate&lt;/em&gt; property element. The purpose of this &lt;em&gt;DataTemplate&lt;/em&gt; is to define the shape of the data to display.  The bindings of the data are specified between curly braces, with &lt;em&gt;ImageUrl&lt;/em&gt; bound to the Source property of an &lt;em&gt;Image&lt;/em&gt; control, &lt;em&gt;Name&lt;/em&gt; bound to the &lt;em&gt;Text&lt;/em&gt; property of the first &lt;em&gt;TextBlock&lt;/em&gt;, and similarly &lt;em&gt;Tweet&lt;/em&gt; is bound to the &lt;em&gt;Text&lt;/em&gt; property of the second &lt;em&gt;TextBlock&lt;/em&gt;. &lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Tip&lt;/strong&gt;: When I show you the final image of the application running, you can refer back to this XAML so you can see how each control is positioned.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I’ve explained how the properties of each &lt;em&gt;TweetViewModel&lt;/em&gt; instance is bound to the UI, but still need to show you how to bind the entire collection so the &lt;em&gt;ListBox&lt;/em&gt; can find it’s data, which is next.&lt;/p&gt;

&lt;h4&gt;Binding a Collection of Tweets to the UI&lt;/h4&gt;

&lt;p&gt;To operate this application, the user will click on the &lt;em&gt;RefreshButton&lt;/em&gt;, from the &lt;em&gt;MainPage.xaml&lt;/em&gt; in the previous section. The &lt;em&gt;Button&lt;/em&gt; &lt;em&gt;Click&lt;/em&gt; event handler is where the magic happens, where the program uses LINQ to Twitter to get public tweets and binds those tweets to the &lt;em&gt;ListBox&lt;/em&gt;.  To get started on this part, double-click the &lt;em&gt;Button&lt;/em&gt; in the UI (Yes, I know I said everything in the UI would be done by typing XAML, but this is so fun and easy).  VS will add a handler to the code-behind and take you there. Here’s the code-behind, populated with code that does the binding:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Be sure to add a project reference to the &lt;em&gt;LinqToTwitter.dll&lt;/em&gt; assembly you downloaded earlier.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div style="color: black; background-color: white;"&gt;
  &lt;pre&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System;
&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Collections.Generic;
&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Linq;
&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Threading.Tasks;
&lt;span style="color: blue;"&gt;using&lt;/span&gt; LinqToTwitter;
&lt;span style="color: blue;"&gt;using&lt;/span&gt; Windows.Foundation;
&lt;span style="color: blue;"&gt;using&lt;/span&gt; Windows.UI.Xaml;
&lt;span style="color: blue;"&gt;using&lt;/span&gt; Windows.UI.Xaml.Controls;
&lt;span style="color: blue;"&gt;using&lt;/span&gt; Windows.UI.Xaml.Data;

&lt;span style="color: blue;"&gt;namespace&lt;/span&gt; LinqToTwitterPublicQuery
{
    &lt;span style="color: blue;"&gt;partial&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; MainPage
    {
        &lt;span style="color: blue;"&gt;public&lt;/span&gt; MainPage()
        {
            InitializeComponent();
        }

        &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; RefreshButton_Click(&lt;span style="color: blue;"&gt;object&lt;/span&gt; sender, RoutedEventArgs e)
        {
            &lt;span style="color: blue;"&gt;var&lt;/span&gt; twitterCtx = &lt;span style="color: blue;"&gt;new&lt;/span&gt; TwitterContext();

            &lt;span style="color: blue;"&gt;var&lt;/span&gt; tweetVM =
                (&lt;span style="color: blue;"&gt;from&lt;/span&gt; tweet &lt;span style="color: blue;"&gt;in&lt;/span&gt; twitterCtx.Status
                 &lt;span style="color: blue;"&gt;where&lt;/span&gt; tweet.Type == StatusType.Public
                 &lt;span style="color: blue;"&gt;select&lt;/span&gt; &lt;span style="color: blue;"&gt;new&lt;/span&gt; TweetViewModel
                 {
                     Name = tweet.User.Name,
                     Tweet = tweet.Text,
                     ImageUrl = tweet.User.ProfileImageUrl
                 })
                .ToList();

            PublicTweetListBox.ItemsSource = tweetVM;
        }
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;The &lt;em&gt;RefreshButton_Click&lt;/em&gt; method above is the handler for the &lt;em&gt;Click&lt;/em&gt; event of the button, which you can now see if you look at the XAML in your IDE after double-clicking the button. The code above does a normal LINQ to Twitter query for tweets from the public timeline and projects into a &lt;em&gt;List&lt;/em&gt; of &lt;em&gt;TweetViewModel&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;What’s important to the binding story is that the code assigns the resulting collection to the &lt;em&gt;ItemsSource&lt;/em&gt; property of &lt;em&gt;PublicTweetListbox&lt;/em&gt;. When the &lt;em&gt;ListBox&lt;/em&gt; renders, it iterates through this list, binding each property of each &lt;em&gt;TweetViewModel&lt;/em&gt; in the list according to the binding directives specified in the XAML earlier.&lt;/p&gt;

&lt;p&gt;To run the application, press &lt;strong&gt;F5&lt;/strong&gt; and you’ll see a screen with a button but no tweets. Push the button and you’ll see tweets show up in a scrollable list, similar to the image below: &lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/WinAZ/Windows-Live-Writer/5ed5141a4fe1_F043/RunningApp_2.png"&gt;&lt;img style="border-width: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="RunningApp" border="0" alt="RunningApp" src="http://geekswithblogs.net/images/geekswithblogs_net/WinAZ/Windows-Live-Writer/5ed5141a4fe1_F043/RunningApp_thumb.png" width="244" height="139" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h4&gt;Summary&lt;/h4&gt;

&lt;p&gt;You learned how to set up an application with VS11 and the different artifacts that are created for you. I showed you a few things about &lt;em&gt;MainPage.xaml&lt;/em&gt; and it’s associated code-behind. Then you saw how to create a &lt;em&gt;ViewModel&lt;/em&gt;, specify how to display data from the &lt;em&gt;ViewModel&lt;/em&gt;, and how to bind Twitter data to the &lt;em&gt;View&lt;/em&gt;. Now you have a working Windows 8 Metro application that displays tweets, via the LINQ to Twitter library.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://twitter.com/#!/JoeMayo" target="_blank"&gt;@JoeMayo&lt;/a&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/WinAZ/aggbug/148494.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Joe Mayo</dc:creator>
            <guid>http://geekswithblogs.net/WinAZ/archive/2012/01/26/using-linq-to-twitter-in-windows-8-metro-apps.aspx</guid>
            <pubDate>Thu, 26 Jan 2012 17:11:45 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/WinAZ/comments/148494.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/WinAZ/archive/2012/01/26/using-linq-to-twitter-in-windows-8-metro-apps.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/WinAZ/comments/commentRss/148494.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/WinAZ/services/trackbacks/148494.aspx</trackback:ping>
        </item>
        <item>
            <title>LINQ to Twitter v2.0.23 Released</title>
            <link>http://geekswithblogs.net/WinAZ/archive/2012/01/24/linq-to-twitter-v2.0.23-released.aspx</link>
            <description>&lt;p&gt;Released LINQ to Twitter v2.0.23: &lt;a href="http://bit.ly/AoKglP"&gt;http://bit.ly/AoKglP&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://twitter.com/#!/JoeMayo" target="_blank"&gt;@JoeMayo&lt;/a&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/WinAZ/aggbug/148463.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Joe Mayo</dc:creator>
            <guid>http://geekswithblogs.net/WinAZ/archive/2012/01/24/linq-to-twitter-v2.0.23-released.aspx</guid>
            <pubDate>Tue, 24 Jan 2012 17:45:24 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/WinAZ/comments/148463.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/WinAZ/archive/2012/01/24/linq-to-twitter-v2.0.23-released.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/WinAZ/comments/commentRss/148463.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/WinAZ/services/trackbacks/148463.aspx</trackback:ping>
        </item>
        <item>
            <title>Installing Windows 8 Developer Preview on a VM</title>
            <category>Windows 8</category>
            <link>http://geekswithblogs.net/WinAZ/archive/2012/01/22/installing-windows-8-developer-preview-on-a-vm.aspx</link>
            <description>&lt;p&gt;Installing Windows 8 Developer Preview isn’t always simple.  It was troublesome on a 32-bit machine, but much easier on x64.  &lt;/p&gt;  &lt;p&gt;Since Win8’s debut at Build last September, VirtualBox supports installing Win8 natively, so you’ll want to download the latest version of &lt;a href="https://www.virtualbox.org/" target="_blank"&gt;VirtualBox&lt;/a&gt; to make sure you don’t have problems.  &lt;/p&gt;  &lt;p&gt;Another good option is VMWare.  They have a free product, &lt;a href="http://www.vmware.com/products/player/" target="_blank"&gt;VMWare Player&lt;/a&gt;, that runs well.  The only problem is it doesn’t have native Win8 support, but don’t let that get in the way.  This blog post, &lt;a href="http://www.sysprobs.com/guide-install-windows-8-on-vmware-workstation-with-vmware-tools" target="_blank"&gt;[Guide]Install Windows 8 on VMware Workstation with VMware Tools&lt;/a&gt;, has been helpful for me.  Here’s the real trick to getting this to work, as explained in the blog post: instead of loading the OS right away, check the option that say’s you’ll load it manually later.  Then, in the hardware configuration for New CD, specify the location of the *.iso file.&lt;/p&gt;  &lt;p&gt;Of the two VMs, I prefer VMWare because of it’s display, performance, and ease of use.  VirtualBox is easier to install because of the native Win8 support, but it seems cumbersome with display resolution messages popping up and window sizing.  In contrast, once you get past the VMWare Player install glitch, everything just works perfectly.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://twitter.com/#!/JoeMayo" target="_blank"&gt;@JoeMayo&lt;/a&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/WinAZ/aggbug/148447.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Joe Mayo</dc:creator>
            <guid>http://geekswithblogs.net/WinAZ/archive/2012/01/22/installing-windows-8-developer-preview-on-a-vm.aspx</guid>
            <pubDate>Mon, 23 Jan 2012 05:47:04 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/WinAZ/comments/148447.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/WinAZ/archive/2012/01/22/installing-windows-8-developer-preview-on-a-vm.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/WinAZ/comments/commentRss/148447.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/WinAZ/services/trackbacks/148447.aspx</trackback:ping>
        </item>
        <item>
            <title>An Open Letter to Pearson about SOPA/PIPA</title>
            <link>http://geekswithblogs.net/WinAZ/archive/2012/01/18/an-open-letter-to-pearson-about-sopapipa.aspx</link>
            <description>&lt;p&gt;If you're a Pearson author, you might be interested in signing this: An Open Letter to Pearson about SOPA/PIPA:&lt;a href="http://martinfowler.com/articles/pearson-sopa.html"&gt;http://martinfowler.com/articles/pearson-sopa.html&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://twitter.com/#!/JoeMayo" target="_blank"&gt;@JoeMayo&lt;/a&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/WinAZ/aggbug/148397.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Joe Mayo</dc:creator>
            <guid>http://geekswithblogs.net/WinAZ/archive/2012/01/18/an-open-letter-to-pearson-about-sopapipa.aspx</guid>
            <pubDate>Wed, 18 Jan 2012 20:17:05 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/WinAZ/comments/148397.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/WinAZ/archive/2012/01/18/an-open-letter-to-pearson-about-sopapipa.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/WinAZ/comments/commentRss/148397.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/WinAZ/services/trackbacks/148397.aspx</trackback:ping>
        </item>
        <item>
            <title>101 Async Samples</title>
            <link>http://geekswithblogs.net/WinAZ/archive/2012/01/12/101-async-samples.aspx</link>
            <description>&lt;p&gt;Here’s a site, by Lucian Wischik, that contains 101 Async Samples:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://www.wischik.com/lu/AsyncSilverlight/AsyncSamples.html" href="http://www.wischik.com/lu/AsyncSilverlight/AsyncSamples.html"&gt;http://www.wischik.com/lu/AsyncSilverlight/AsyncSamples.html&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;There are examples in both C# and VB.  Some examples have a selector that lets you toggle between .NET 4.0 and the new Async syntax.  Each example has a run button so you can execute and see the return value. Throughout, you’ll see many different ways to use Async.  I think it’s a very nice resource.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://twitter.com/#!/JoeMayo" target="_blank"&gt;@JoeMayo&lt;/a&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/WinAZ/aggbug/148330.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Joe Mayo</dc:creator>
            <guid>http://geekswithblogs.net/WinAZ/archive/2012/01/12/101-async-samples.aspx</guid>
            <pubDate>Fri, 13 Jan 2012 01:14:02 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/WinAZ/comments/148330.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/WinAZ/archive/2012/01/12/101-async-samples.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/WinAZ/comments/commentRss/148330.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/WinAZ/services/trackbacks/148330.aspx</trackback:ping>
        </item>
        <item>
            <title>Breaking Changes in the LINQ to Twitter Search API</title>
            <link>http://geekswithblogs.net/WinAZ/archive/2012/01/09/breaking-changes-in-the-linq-to-twitter-search-api.aspx</link>
            <description>&lt;p&gt;While adding a new feature to the &lt;a href="http://linqtotwitter.codeplex.com/" target="_blank"&gt;LINQ to Twitter&lt;/a&gt; Search API, I made significant changes to the Search entity that will break existing code. The new feature is support for Tweet Entities, a recent addition to Twitter’s Search API.  I’ll cover Tweet Entities support after explaining what has changed.&lt;/p&gt;  &lt;h4&gt;Motivation for Change&lt;/h4&gt;  &lt;p&gt;When Twitter implemented Tweet Entities for their Search API, they only supported JSON format.  LINQ to Twitter used ATOM for Search API queries; so, I didn’t have a choice on data formats.  What I found during analysis was that the fields of the JSON format differed significantly from the ATOM format.  More specifically, the the ATOM format contains more metadata than what’s necessary in JSON.  Since I had to make the switch anyway, I decided to refactor the naming so it matched the JSON format more closely – the benefit being that if you had to look at the Twitter API docs, the match between LINQ to Twitter Search entity property names and the Twitter API docs would be closer.  That said, in most cases, the property names are very similar or haven’t changed at all.  Overall, the changes, described below, will make the API more approachable and discoverable.&lt;/p&gt;  &lt;h4&gt;List of Changes&lt;/h4&gt;  &lt;ul&gt;   &lt;li&gt;&lt;em&gt;Search&lt;/em&gt; no longer derives from &lt;em&gt;AtomFeed&lt;/em&gt;. Instead, all return properties are members of &lt;em&gt;Search&lt;/em&gt;. (&lt;em&gt;AtomFeed&lt;/em&gt;, &lt;em&gt;AtomEntry&lt;/em&gt;, and &lt;em&gt;AtomAuthor&lt;/em&gt; types still reside in the library, but they aren’t associated with &lt;em&gt;Search&lt;/em&gt; anymore.) &lt;/li&gt;    &lt;li&gt;Returned tweets now reside in the &lt;em&gt;Results&lt;/em&gt; property of the &lt;em&gt;Search&lt;/em&gt; entity (previously &lt;em&gt;Entries&lt;/em&gt; property of &lt;em&gt;AtomFeed&lt;/em&gt;), which is a list of &lt;em&gt;SearchEntry&lt;/em&gt;. &lt;/li&gt;    &lt;li&gt;&lt;em&gt;SearchEntry&lt;/em&gt; has a normal &lt;em&gt;ID&lt;/em&gt;, so you no longer need to parse it out like you did with the &lt;em&gt;ID&lt;/em&gt; property of AtomEntry. &lt;/li&gt;    &lt;li&gt;The &lt;em&gt;ResultType&lt;/em&gt; property is now in a &lt;em&gt;MetaData&lt;/em&gt; property, along with number of recent retweets. &lt;/li&gt;    &lt;li&gt;&lt;em&gt;SearchEntry&lt;/em&gt; has a &lt;em&gt;CreatedAt&lt;/em&gt; property that is a &lt;em&gt;DateTimeOffset&lt;/em&gt; of the time returned from Twitter as opposed to being translated in your local time. &lt;/li&gt;    &lt;li&gt;Most existing properties correspond to existing &lt;em&gt;AtomFeed&lt;/em&gt; properties, but many names have changed. (i.e. instead of using the &lt;em&gt;Content&lt;/em&gt; property, you would now use the &lt;em&gt;Text&lt;/em&gt; property) &lt;/li&gt;    &lt;li&gt;Properties no longer supported (don’t appear in the JSON format) include: &lt;em&gt;Alternate&lt;/em&gt;, &lt;em&gt;Self&lt;/em&gt;, &lt;em&gt;Title&lt;/em&gt;, &lt;em&gt;Updated&lt;/em&gt;, &lt;em&gt;Language&lt;/em&gt; (output), and &lt;em&gt;TwitterWarning&lt;/em&gt;. &lt;/li&gt;    &lt;li&gt;The &lt;em&gt;RawResult&lt;/em&gt; property of &lt;em&gt;TwitterContext&lt;/em&gt; will now contain a JSON formatted response (no longer an ATOM formatted response). &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The impact of this change only affects how your application processes returned results from Twitter searches. All input parameters are still the same.  These changes facilitate support for Tweet Entities, described next.&lt;/p&gt;  &lt;h4&gt;The Tweet Entities Enhancement&lt;/h4&gt;  &lt;p&gt;&lt;a href="https://dev.twitter.com/docs/tweet-entities" target="_blank"&gt;Tweet Entities&lt;/a&gt; are metadata and other bits of information that Twitter extracts from a tweet, saving you the time of parsing the information yourself.  Current entities include hashtags, media, urls, and users.  Each entity has &lt;em&gt;Start&lt;/em&gt; and &lt;em&gt;End&lt;/em&gt; position properties in the tweet where it was extracted in addition to other entity-specific details.  The following codes shows how to find entities, showing counts of each entity type:&lt;/p&gt;  &lt;div style="background-color: white; color: black"&gt;   &lt;pre&gt;        &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; SearchIncludingEntities(TwitterContext twitterCtx)
        {
            &lt;span style="color: blue"&gt;var&lt;/span&gt; searchResults =
                (&lt;span style="color: blue"&gt;from&lt;/span&gt; search &lt;span style="color: blue"&gt;in&lt;/span&gt; twitterCtx.Search
                 &lt;span style="color: blue"&gt;where&lt;/span&gt; search.Type == SearchType.Search &amp;amp;&amp;amp;
                       search.Query == &lt;span style="color: #a31515"&gt;"@rschu"&lt;/span&gt; &amp;amp;&amp;amp;
                       search.IncludeEntities == &lt;span style="color: blue"&gt;true&lt;/span&gt; &amp;amp;&amp;amp;
                       search.PageSize == 100
                 &lt;span style="color: blue"&gt;select&lt;/span&gt; search)
                .SingleOrDefault();

            searchResults.Results.ForEach(entry =&amp;gt;
                {
                    Entities entities = entry.Entities;
                    Console.WriteLine(
                        &lt;span style="color: #a31515"&gt;"-- Entities --\n"&lt;/span&gt; +
                        &lt;span style="color: #a31515"&gt;"User: "&lt;/span&gt; + entities.UserMentions.Count + &lt;span style="color: #a31515"&gt;"\n"&lt;/span&gt; +
                        &lt;span style="color: #a31515"&gt;"Urls: "&lt;/span&gt; + entities.UrlMentions.Count + &lt;span style="color: #a31515"&gt;"\n"&lt;/span&gt; +
                        &lt;span style="color: #a31515"&gt;"Hash: "&lt;/span&gt; + entities.HashTagMentions.Count + &lt;span style="color: #a31515"&gt;"\n"&lt;/span&gt; +
                        &lt;span style="color: #a31515"&gt;"Media: "&lt;/span&gt; + entities.MediaMentions.Count + &lt;span style="color: #a31515"&gt;"\n"&lt;/span&gt;);
                });
        }&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;The &lt;em&gt;Query&lt;/em&gt; searches for results from someone I like to follow and whose tweets contain a variety of entity types.  Notice that I set &lt;em&gt;IncludeEntities&lt;/em&gt; to &lt;em&gt;true&lt;/em&gt; to ensure Twitter populates results with entities.  Here’s the description of the Search entity so you can see some of the structure and how to find entities:&lt;/p&gt;

&lt;p&gt;- Search (this is &lt;em&gt;searchResults&lt;/em&gt; above and contains relevant info for the &lt;em&gt;Search&lt;/em&gt; instance)&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;-- … (other properties)&lt;/p&gt;

  &lt;p&gt;-- &lt;em&gt;Results&lt;/em&gt; (List of &lt;em&gt;SearchResult&lt;/em&gt;, containing info on tweets and metadata)&lt;/p&gt;

  &lt;p&gt;    --- &lt;em&gt;Entities&lt;/em&gt; (Instance of &lt;em&gt;Entities&lt;/em&gt;, containing the different entity types)&lt;/p&gt;

  &lt;p&gt;         ---- &lt;em&gt;UserMentions&lt;/em&gt; (List of &lt;em&gt;UserMention&lt;/em&gt; entities)&lt;/p&gt;

  &lt;p&gt;         ---- &lt;em&gt;UrlMentions&lt;/em&gt; (List of &lt;em&gt;UrlMention&lt;/em&gt; entities)&lt;/p&gt;

  &lt;p&gt;         ---- &lt;em&gt;HashTagMentions&lt;/em&gt; (List of &lt;em&gt;HashTagMention&lt;/em&gt; entities)&lt;/p&gt;

  &lt;p&gt;         ---- &lt;em&gt;MediaMentions&lt;/em&gt; (List of &lt;em&gt;MediaMention&lt;/em&gt; entities)&lt;/p&gt;

  &lt;p&gt;-- … (other properties)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As shown in the code snippet and hierarchy above, the &lt;em&gt;Search.Results.Entities&lt;/em&gt; instance contains the entities you can read and use as necessary.&lt;/p&gt;

&lt;p&gt;If you’ve previously worked with &lt;em&gt;Status&lt;/em&gt; entities in LINQ to Twitter, you might notice similarities.  That’s because both the LINQ to Twitter &lt;em&gt;Status&lt;/em&gt; and &lt;em&gt;Search&lt;/em&gt; entities types are the same.&lt;/p&gt;

&lt;p&gt;These changes haven’t been officially released, but you’re welcome to download the &lt;a href="http://linqtotwitter.codeplex.com/SourceControl/changeset/changes/95269" target="_blank"&gt;LINQ to Twitter source code&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;Summary&lt;/h4&gt;

&lt;p&gt;You’ve seen how I refactored the &lt;em&gt;Search&lt;/em&gt; results and how the LINQ to Twitter Search API now supports Tweet Entities. I hope you’ll see that the changes are for the better, trading a bit of discomfort for new functionality.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://twitter.com/#!/JoeMayo" target="_blank"&gt;@JoeMayo&lt;/a&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/WinAZ/aggbug/148291.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Joe Mayo</dc:creator>
            <guid>http://geekswithblogs.net/WinAZ/archive/2012/01/09/breaking-changes-in-the-linq-to-twitter-search-api.aspx</guid>
            <pubDate>Mon, 09 Jan 2012 20:17:59 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/WinAZ/comments/148291.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/WinAZ/archive/2012/01/09/breaking-changes-in-the-linq-to-twitter-search-api.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/WinAZ/comments/commentRss/148291.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/WinAZ/services/trackbacks/148291.aspx</trackback:ping>
        </item>
        <item>
            <title>Thoughts About the MVP Award</title>
            <link>http://geekswithblogs.net/WinAZ/archive/2012/01/05/thoughts-about-the-mvp-award.aspx</link>
            <description>&lt;p&gt;There’s an ongoing discussion in the community about various aspects of the Microsoft Most Valuable Professional (MVP) awards and this is a quick contribution I’ll make to share a few thoughts.  Recent events in this discussion include MVPs who either weren’t re-awarded and/or declined their award.  There are alignments and differences between their perspectives and mine, particularly in the areas of expectations and values.  This is one of my contributions to that on-going discussion.&lt;/p&gt;  &lt;p&gt;In it’s simplest form, the MVP program is designed to recognize people who have contributed to the community.  Microsoft has provided their &lt;a href="http://mvp.support.microsoft.com/" target="_blank"&gt;definition of an MVP&lt;/a&gt;, which I find to be a humbling experience.  Some people actively regard themselves as “experts” in their field and live the role through their behavior and words.  I’ve met people who describe themselves as “elite” and, regardless of what you think of a person who would make such a declaration, indeed they are often quite capable and their accomplishments are impressive.  Perhaps definition, expectation, and reality don’t always align, but no system is perfect and people will often fail to agree on the virtues of that system. My opinion of the MVP award system might not be unique, but there will be people who disagree.&lt;/p&gt;  &lt;p&gt;I prefer to subscribe to a school of thought that recognizes the “award” part of the system.  Essentially, I did things that Microsoft decides as worthy of recognition.  Therefore, they’ve shown appreciation for my efforts by giving me MVP awards.  While humbled at the association with a group of respected professionals, I’m mostly grateful for the award and thankful for the recognition.  In the United States, we have a common saying, “&lt;a href="http://www.phrases.org.uk/meanings/dont-look-a-gift-horse-in-the-mouth.html" target="_blank"&gt;Don’t look a gift horse in the mouth&lt;/a&gt;.”, which means that you shouldn’t be ungrateful when someone gives you a gift.  So, I don’t question Microsoft’s motivations, compare whether someone else is more or less deserving, or complain about the quality of the gift.  Sometimes it’s good to display grace and thankfulness.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://twitter.com/#!/JoeMayo" target="_blank"&gt;@JoeMayo&lt;/a&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/WinAZ/aggbug/148253.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Joe Mayo</dc:creator>
            <guid>http://geekswithblogs.net/WinAZ/archive/2012/01/05/thoughts-about-the-mvp-award.aspx</guid>
            <pubDate>Thu, 05 Jan 2012 23:06:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/WinAZ/comments/148253.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/WinAZ/archive/2012/01/05/thoughts-about-the-mvp-award.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/WinAZ/comments/commentRss/148253.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/WinAZ/services/trackbacks/148253.aspx</trackback:ping>
        </item>
    </channel>
</rss>
