<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/"><channel><title>Adam Kinney posts tagged with 'xboxfriendswatch'</title><description>Adam Kinney blog posts filtered by a specific tag</description><link>http://adamkinney.com/blog/tags/xboxfriendswatch/default.aspx</link><language>en-us</language><pubDate>Sat, 19 Jul 2008 19:07:22 GMT</pubDate><generator>Oxite</generator><item><title>Xbox Gamercard updated for Silverlight 2 Beta 2</title><description>&lt;p style="float: right; margin-bottom: 10px; margin-left: 10px"&gt;&lt;a title="Xbox Friends Watch Gamercard by adKinn, on Flickr" href="http://www.flickr.com/photos/adamkinney/2386366218/"&gt;&lt;img height="166" alt="Xbox Friends Watch Gamercard" src="http://farm3.static.flickr.com/2249/2386366218_e7a0b20b81_o.png" width="210" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;After a few changes the &lt;a href="http://adamkinney.com/studios/xboxfriendswatch/gamercard.html"&gt;Xbox Friends Watch Gamercard&lt;/a&gt; now runs on Beta 2.&amp;#160; The few changes I had to make included&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;updating the project file in Visual Studio to match Beta 2&lt;/li&gt;    &lt;li&gt;Adding System.Net as a reference since the WebClient class has moved there&lt;/li&gt;    &lt;li&gt;Changing Storyboard.GetClockState to &lt;em&gt;AnimationInstance&lt;/em&gt;.GetCurrentState to match the API update.&lt;/li&gt;    &lt;li&gt;Moving from ToolTips to the ToolTipService on the HyperlinkButtons.&lt;/li&gt;    &lt;li&gt;Changing MouseLeftButtonDown event handlers to handle the Click event on Buttons, now that MouseLeftButtonDown event no longer fire.&lt;/li&gt;    &lt;li&gt;The final change had to do with adding a setting in the AppManifest.xml to allow the XAP to be hosted on a different server than the page its embedded on and still make the cross domain call.&amp;#160; Emil Stoychev has more detail about the &lt;a href="http://www.silverlightshow.net/items/Silverlight-X-Domain-Scenario.aspx"&gt;X-Domain Scenario on SilverlightShow&lt;/a&gt;.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Get your own &lt;a href="http://adamkinney.com/studios/xboxfriendswatch/gamercard.html"&gt;Gamercard on the script builder page&lt;/a&gt;.&amp;#160; Even if you already have the Gamercard on your page, you will still need to update your embed code to reflect the new changes.&lt;/p&gt;  &lt;p&gt;Now to find the time to play the Xbox...&lt;/p&gt;&lt;img src="http://adamkinney.com/blog/342/aggviewbug/default.aspx" alt="" /&gt;</description><comments>http://adamkinney.com/blog/342/default.aspx</comments><link>http://adamkinney.com/blog/342/default.aspx</link><pubDate>Thu, 26 Jun 2008 18:34:00 GMT</pubDate><guid isPermaLink="true">http://adamkinney.com/blog/342/default.aspx</guid><dc:creator>Adam Kinney</dc:creator><slash:comments>6</slash:comments><trackback:ping>http://adamkinney.com/blog/342/trackback/default.aspx</trackback:ping><category>demo</category><category>gaming</category><category>Silverlight</category><category>Xbox</category><category>XboxFriendsWatch</category></item><item><title>Building the Gamercard Part 3, Updating the UI</title><description>&lt;p&gt;This is Part 3 in a series covering how the &lt;a href="http://adamkinney.com/blog/322/default.aspx"&gt;Xbox Gamercard&lt;/a&gt; application was made using Silverlight 2.&amp;#160; In this part I will cover how the interface is updated once the data is retrieved.&lt;/p&gt;  &lt;p&gt;In the first part of the series I showed a few highlights of how the UI was created.&amp;#160; In the second part, I showed the call to the web service and how the results were parsed using LINQ to create a .NET object.&amp;#160; In this part, I will show how an instance of the custom &lt;em&gt;XboxInfo&lt;/em&gt; class is used as the data source for Data Binding the UI Elements.&lt;/p&gt;  &lt;h2&gt;Data Binding&lt;/h2&gt;  &lt;p&gt;Returning to the parsing code from &lt;a href="http://adamkinney.com/blog/326/default.aspx"&gt;part 2&lt;/a&gt;, the web service results are returned as a string which is handed to a parsing method.&amp;#160; Within the method an &lt;em&gt;XDocument&lt;/em&gt; is created that a LINQ query is run against that returns an &lt;em&gt;XboxInfo&lt;/em&gt; class instance.&amp;#160; The DataContext is then set to the instance and this is where the Data binding magic begins.&lt;/p&gt; &lt;code&gt;XDocument xDoc = XDocument.Parse(xmlContent);    &lt;br /&gt;XboxInfo gamer = ...//LINQ query     &lt;br /&gt;this.DataContext = gamer;&lt;/code&gt;   &lt;p&gt;In the above code, &lt;em&gt;this&lt;/em&gt; is referring to an instance of my XboxGamerCard.Page class which is the UserControl used as the main or RootVisual control of the application.&amp;#160; This class is where the main UI is declared in XAML including the main Grid control from &lt;a href="http://adamkinney.com/blog/325/default.aspx"&gt;Part 1&lt;/a&gt;.&amp;#160; Rather than writing the familiar manual &lt;em&gt;lnkGamerTag.Text = gamer.GamerTag &lt;/em&gt;type code we can use Data Binding to update the UI.&lt;/p&gt;  &lt;p&gt;A simple example of the binding is shown below.&amp;#160; The Content property of the HyperlinkButton is set to a GamerTag property of the DataContext.&amp;#160; Once the DataContext of the UserControl is set, the Bindings are notified and the values are updated.&amp;#160; In the case of the Binding below, the DataContext is checked for a GamerTag property.&amp;#160; If it exists the value of the HyperlinkButton.Content property is set automatically to the GamerTag value.&amp;#160; If the DataContext GamerTag property were to change again, the Content property would be updated as well.&amp;#160; The target property and the data source are now connected via the Binding instance.&lt;/p&gt;  &lt;div style="float: right; margin-bottom: 10px; margin-left: 10px"&gt;&lt;a href="http://adamkinney.com/blog/322/default.aspx"&gt;&lt;img src="http://adamkinney.com/studios/xboxfriendswatch/images/xbf_gamercard.png" /&gt;&lt;/a&gt; &lt;/div&gt;  &lt;p&gt;&lt;code&gt;&amp;lt;HyperlinkButton Content=&amp;quot;{Binding GamerTag}&amp;quot; ... /&amp;gt;&lt;/code&gt; &lt;/p&gt;  &lt;p&gt;Another interesting feature of Data Binding is converting values.&amp;#160; The screenshot of the Gamercard to the right shows four green lights indicating that the status of this Quemark person is online rather than offline, which is indicated by a single red light.&lt;/p&gt;  &lt;p&gt;Using the Binding syntax below, the Canvas.Visibility property is bound to the StatusText property and a custom converter is set.&amp;#160;&amp;#160; Notice in the syntax, that StatusText is preceded by PresenceInfo.&amp;#160; A property of the XboxInfo class, PresenceInfo is a custom class as well with a string property titled StatusText.&amp;#160; With the &amp;quot;.&amp;quot; notation you can navigate the property chain.&lt;/p&gt;  &lt;p&gt;&lt;code&gt;&amp;lt;Canvas Visibility=&amp;quot;{Binding PresenceInfo.StatusText,      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/code&gt;&lt;code&gt;Converter={StaticResource StatusVisiblityConverter}}&amp;quot;&amp;gt;...&amp;lt;/Canvas&amp;gt;&lt;/code&gt; &lt;/p&gt;  &lt;p&gt;The StatusText property is a string but the Visibility property is an enum of type System.Windows.Visibility.&amp;#160; By implementing the &lt;em&gt;IValueConverter &lt;/em&gt;the custom converter class can be used to check a string value and return a Visibility enum value.&amp;#160; The code is simple to write and looks like the following:&lt;/p&gt;  &lt;p&gt;&lt;code&gt;public class StatusVisiblity : IValueConverter      &lt;br /&gt;{       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; public object Convert(object value, Type targetType, object parameter, CultureInfo culture)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; string statusText = (string)value;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (statusText == &amp;quot;Offline&amp;quot;)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return Visibility.Collapsed;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; else       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return Visibility.Visible;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }&amp;#160; &lt;br /&gt;}&lt;/code&gt;&lt;/p&gt;  &lt;p&gt;One other interesting area is RecentGames, a property of the XboxInfo class of type List&amp;lt;XboxUserGameInfo&amp;gt;.&amp;#160; In order to show this collection, The RecentGames property is used as the datasource for an ItemsSource property of ItemsControl added to the page.&amp;#160; When bound, each item in the collection is shown using the the defined ItemTemplate where Binding are defined using the properties of the XboxUserGameInfo class.&lt;/p&gt; &lt;code&gt;&amp;lt;ItemsControl ItemsSource=&amp;quot;{Binding RecentGames}&amp;quot; ...&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; ...     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;ItemsControl.ItemTemplate&amp;gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;DataTemplate&amp;gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Grid ...&amp;gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Rectangle ... /&amp;gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Image Width=&amp;quot;32&amp;quot; Height=&amp;quot;32&amp;quot; Source=&amp;quot;{Binding Game.Image32Url}&amp;quot;&amp;gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ...     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/Image&amp;gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/Grid&amp;gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/DataTemplate&amp;gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/ItemsControl.ItemTemplate&amp;gt;     &lt;br /&gt;&amp;lt;/ItemsControl&amp;gt;&lt;/code&gt;   &lt;p&gt;Databinding can be very useful and is definitely worth looking more into.&amp;#160; Not only does it save the developer some lines of code, it can also be useful during design-time due to the Data Binding support within Expression Blend.&amp;#160; That sounds like another blog post in the works...&lt;/p&gt;  &lt;p&gt;For more information on Data Binding check out Jesse Liberty's &lt;a href="http://silverlight.net/learn/tutorials/databinding.aspx"&gt;Data Binding Tutorial&lt;/a&gt;.&lt;/p&gt;  &lt;h2&gt;Refreshing the Data&lt;/h2&gt;  &lt;div style="float: right; margin-bottom: 10px; margin-left: 10px"&gt;&lt;a href="http://adamkinney.com/studios/xboxfriendswatch/gamercard.html"&gt;&lt;img src="http://adamkinney.com/images/xbfgc/scriptpage.jpg" /&gt;&lt;/a&gt; &lt;/div&gt;  &lt;p&gt;The last piece I am going to talk about covers browser integration.&amp;#160; The &lt;a href="http://adamkinney.com/studios/xboxfriendswatch/gamercard.html"&gt;Gamercard Script Builder&lt;/a&gt; page (pictured to the right), has a textbox where you enter your Gamertag and when you TAB out of it the embed script is added to the textarea below.&amp;#160; In addition the Gamercard application to the right is updated and you see a preview of what your card will look like.&lt;/p&gt;  &lt;p&gt;Due to the awesome browser integration available in Silverlight 2 this was very simple to do.&amp;#160; The first step is to expose the &lt;em&gt;RequestGamerXml&lt;/em&gt; method (explained in &lt;a href="http://adamkinney.com/blog/326/default.aspx"&gt;Part 2&lt;/a&gt;) to JavaScript which is done by adding an attribute to the public method and registering the class instance as a ScriptableObject.&lt;/p&gt; &lt;code&gt;   &lt;p&gt;[ScriptableMember]      &lt;br /&gt;public void RequestGamerXml(string gamerTag){...}&lt;/p&gt;    &lt;p&gt;void Page_Loaded(object sender, RoutedEventArgs e)      &lt;br /&gt;{       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; HtmlPage.RegisterScriptableObject(&amp;quot;GamerCard&amp;quot;, this);       &lt;br /&gt;}&lt;/p&gt; &lt;/code&gt;  &lt;p&gt;Then in the JavaScript function call into that object and pass a variable to the exposed method.&amp;#160; &lt;em&gt;slPlugIn&lt;/em&gt; is the id of the object tag used to instantiate the Silverlight application.&lt;/p&gt; &lt;code&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;    &lt;br /&gt;function genScript(){     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; ...     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; document.getElementById(&amp;quot;slPlugin&amp;quot;).content.GamerCard.RequestGamerXml(tagEntered);     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; ...     &lt;br /&gt;}     &lt;br /&gt;&amp;lt;/script&amp;gt;&lt;/code&gt;   &lt;p&gt;And that's it!&amp;#160; Now every time the Gamertag entered changes, the RequestGamerXml method is called and the DataContext is reset.&amp;#160; Thanks to the Bindings in place the interface Elements are updated to stay in synch with the data source.&lt;/p&gt;  &lt;p&gt;For more information on browser integration try the &lt;a href="http://download.microsoft.com/download/9/4/e/94e080c7-d462-4118-b07a-55578d64bc43/Silverlight%202%20Beta%201%20-%20Browser%20Integration.zip"&gt;Browser Integration Hands-on Lab&lt;/a&gt; from MIX08.&lt;/p&gt;  &lt;h2&gt;Conclusion&lt;/h2&gt;  &lt;p&gt;This was a fun project and the ideas keep on coming.&amp;#160; Expect to see more in the future from the &lt;a href="http://adamkinney.com/studios/xboxfriendswatch/"&gt;Xbox Friends Watch Lab&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Other parts in this series are available:&lt;/p&gt;  &lt;li&gt;&lt;a href="http://adamkinney.com/blog/325/default.aspx"&gt;Building the Gamercard Part 1, Composing the UI&lt;/a&gt; &lt;/li&gt;  &lt;li&gt;&lt;a href="http://adamkinney.com/blog/326/default.aspx"&gt;Building the Gamercard Part 2, Retrieving the Data&lt;/a&gt;     &lt;p&gt;&amp;#160;&lt;/p&gt;    &lt;p&gt;&lt;img style="border-top-style: none; border-right-style: none; border-left-style: none; border-bottom-style: none" alt="my diigo links" src="http://www.diigo.com/images/ii_blue.gif" /&gt;&amp;#160;&lt;a title="more info on Silverlight controls" href="http://www.diigo.com/user/adamkinney/silverlight+databinding"&gt;silverlight+databinding&lt;/a&gt;, &lt;a title="more info on Silverlight controls" href="http://www.diigo.com/user/adamkinney/silverlight"&gt;silverlight&lt;/a&gt;&lt;/p&gt; &lt;/li&gt;&lt;img src="http://adamkinney.com/blog/327/aggviewbug/default.aspx" alt="" /&gt;</description><comments>http://adamkinney.com/blog/327/default.aspx</comments><link>http://adamkinney.com/blog/327/default.aspx</link><pubDate>Thu, 17 Apr 2008 23:41:00 GMT</pubDate><guid isPermaLink="true">http://adamkinney.com/blog/327/default.aspx</guid><dc:creator>Adam Kinney</dc:creator><slash:comments>0</slash:comments><trackback:ping>http://adamkinney.com/blog/327/trackback/default.aspx</trackback:ping><category>databinding</category><category>Silverlight</category><category>XboxFriendsWatch</category></item><item><title>Building the Gamercard Part 2, Retrieving the Data</title><description>&lt;div style="float: right; margin-bottom: 10px; margin-left: 10px"&gt;&lt;a href="http://adamkinney.com/blog/322/default.aspx"&gt;&lt;img src="http://adamkinney.com/studios/xboxfriendswatch/images/xbf_gamercard.png" /&gt;&lt;/a&gt; &lt;/div&gt;  &lt;p&gt;This is Part 2 in a series covering how the &lt;a href="http://adamkinney.com/blog/322/default.aspx"&gt;Xbox Gamercard&lt;/a&gt; application was made using Silverlight 2.&amp;#160; In this part I will cover how the data is retrieved.&lt;/p&gt;  &lt;p&gt;First off, the &lt;a href="http://adamkinney.com/studios/xboxfriendswatch/"&gt;Xbox Friends Watch&lt;/a&gt; series of experiments would not be possible without the existence of the &lt;a href="http://duncanmackenzie.net/blog/put-up-a-rest-api-for-xbox-gamertag-data/default.aspx"&gt;Xbox Gamertag Data Service&lt;/a&gt;.&amp;#160; The service provides both SOAP and REST based access and I'll being showing you how the REST-based service was used within the application.&lt;/p&gt;  &lt;h2&gt;Get the data&lt;/h2&gt;  &lt;p&gt;When the application loads it looks within the &lt;a href="http://msdn2.microsoft.com/en-us/library/bb980046.aspx"&gt;InitParams&lt;/a&gt; parameters for a &lt;em&gt;gamertag&lt;/em&gt; Key.&amp;#160; The value is then passed to a RequestGamerXML function that creates a &lt;a href="http://msdn2.microsoft.com/en-us/library/system.net.webclient(VS.95).aspx"&gt;WebClient&lt;/a&gt; instance and queues and asynchronous request to the Gamertag Data service.&lt;/p&gt; &lt;code&gt;public void RequestGamerXml(string gamerTag)    &lt;br /&gt;{     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; string xboxUrl = string.Format(&amp;quot;http://duncanmackenzie.net/services/GetXboxInfo.aspx?GamerTag={0}&amp;quot;, gamerTag);     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; WebClient xboxService = new WebClient();     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; xboxService.DownloadStringCompleted += new DownloadStringCompletedEventHandler(xboxService_DownloadStringCompleted);     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; xboxService.DownloadStringAsync(new Uri(xboxUrl));     &lt;br /&gt;}&lt;/code&gt;   &lt;p&gt;The completed event handler is then called once the request is complete, providing the opportunity to handle errors and pass the result string to a parsing function.&lt;/p&gt; &lt;code&gt;private void xboxService_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)    &lt;br /&gt;{     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; if (e.Error == null)     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; loadGamer(e.Result);     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; else{...}     &lt;br /&gt;}&lt;/code&gt;   &lt;p&gt;The WebClient class is perfect for simple requests like this, but for more advanced network requests check otu the &lt;a href="http://msdn2.microsoft.com/en-us/library/system.net.httpwebrequest(VS.95).aspx"&gt;HttpWebRequest&lt;/a&gt; class.&lt;/p&gt;  &lt;p&gt;For more information on Networking check out Karen Corby's two networking part series (&lt;a href="http://scorbs.com/2008/04/05/silverlight-http-networking-stack-part-1-site-of-origin-communication"&gt;Part 1&lt;/a&gt;, &lt;a href="http://scorbs.com/2008/04/15/silverlight-http-networking-stack-part-2-cross-domain-communication-overview"&gt;Part 2&lt;/a&gt;) and Laurent Bugnion's &lt;a href="http://www.galasoft.ch/mydotnet/articles/article-2008032301.html"&gt;Downloading Zipped files&lt;/a&gt;&lt;/p&gt;  &lt;h2&gt;From XML to objects&lt;/h2&gt;  &lt;p&gt;Now that the data has been returned from the REST service as string, the values need to be parsed for display.&amp;#160; Luckily there just happens to be a new simple and fun way to do this using &lt;a href="http://msdn2.microsoft.com/en-us/netframework/aa904594.aspx"&gt;LINQ&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;LINQ, new in Silverlight 2, is a huge topic in and of itself and there are many &lt;a href="http://channel9.msdn.com/Showforum.aspx?forumid=14&amp;amp;tagid=58"&gt;videos&lt;/a&gt;, &lt;a href="http://channel9.msdn.com/Showforum.aspx?forumid=38&amp;amp;tagid=58"&gt;screencasts&lt;/a&gt; and &lt;a href="http://www.technorati.com/search/linq?authority=a4"&gt;blog posts&lt;/a&gt; about it.&amp;#160; In the context of the Gamercard application it is interesting because you can perform powerful language-integrated queries, sets and transforms.&amp;#160; Specifically turning the string results into an &lt;em&gt;XboxInfo&lt;/em&gt; class with all of its property values set and sub classes created and populated as well.&lt;/p&gt;  &lt;p&gt;First take a look at the XML response: &lt;a title="http://duncanmackenzie.net/services/GetXboxInfo.aspx?GamerTag=festive%20turkey" href="http://duncanmackenzie.net/services/GetXboxInfo.aspx?GamerTag=festive%20turkey"&gt;http://duncanmackenzie.net/services/GetXboxInfo.aspx?GamerTag=festive%20turkey&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Looking at the XML you can get an idea of the backing classes needed to serialize and deserialize that data.&amp;#160; The classes I've created have typed properties but otherwise very closely match to the XML result's schema.&lt;/p&gt;  &lt;p&gt;The XML string is used to create a new &lt;em&gt;XDocument&lt;/em&gt; instance which can then be queried against to return an &lt;em&gt;XboxInfo&lt;/em&gt; instance:&lt;/p&gt; &lt;code&gt;   &lt;p&gt;XDocument xDoc = XDocument.Parse(xmlContent); &lt;/p&gt;    &lt;p&gt;XboxInfo gamer = (from XboxInfo in xDoc.Descendants(&amp;quot;XboxInfo&amp;quot;)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; select new XboxInfo       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PresenceInfo = new PresenceInfo()       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Info = (string)XboxInfo.Element(&amp;quot;PresenceInfo&amp;quot;).Element(&amp;quot;Info&amp;quot;),       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Info2 = (string)XboxInfo.Element(&amp;quot;PresenceInfo&amp;quot;).Element(&amp;quot;Info2&amp;quot;),       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Online = (string)XboxInfo.Element(&amp;quot;PresenceInfo&amp;quot;).Element(&amp;quot;Online&amp;quot;),       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; StatusText = (string)XboxInfo.Element(&amp;quot;PresenceInfo&amp;quot;).Element(&amp;quot;StatusText&amp;quot;)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; },       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; GamerTag = (string)XboxInfo.Element(&amp;quot;Gamertag&amp;quot;),       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ProfileUrl = (string)XboxInfo.Element(&amp;quot;ProfileUrl&amp;quot;),       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; TileUrl = (string)XboxInfo.Element(&amp;quot;TileUrl&amp;quot;),       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; GamerScore = (string)XboxInfo.Element(&amp;quot;GamerScore&amp;quot;),       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Zone = (string)XboxInfo.Element(&amp;quot;Zone&amp;quot;),       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; RecentGames = (from XboxUserGameInfo in XboxInfo.Element(&amp;quot;RecentGames&amp;quot;).Descendants(&amp;quot;XboxUserGameInfo&amp;quot;)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; select new XboxUserGameInfo       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Game = new Game()       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Name = (string)XboxUserGameInfo.Element(&amp;quot;Game&amp;quot;).Element(&amp;quot;Name&amp;quot;),       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Image32Url = (string)XboxUserGameInfo.Element(&amp;quot;Game&amp;quot;).Element(&amp;quot;Image32Url&amp;quot;),       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Image64Url = (string)XboxUserGameInfo.Element(&amp;quot;Game&amp;quot;).Element(&amp;quot;Image64Url&amp;quot;),&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; TotalAchievements = (string)XboxUserGameInfo.Element(&amp;quot;Game&amp;quot;).Element(&amp;quot;TotalAchievements&amp;quot;),       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; TotalGamerScore = (string)XboxUserGameInfo.Element(&amp;quot;Game&amp;quot;).Element(&amp;quot;TotalGamerScore&amp;quot;)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; },       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Achievements = (string)XboxUserGameInfo.Element(&amp;quot;Achievements&amp;quot;),       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; GamerScore = (string)XboxUserGameInfo.Element(&amp;quot;GamerScore&amp;quot;),       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; DetailsURL = (string)XboxUserGameInfo.Element(&amp;quot;DetailsURL&amp;quot;),       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; LastPlayed = (DateTime)XboxUserGameInfo.Element(&amp;quot;LastPlayed&amp;quot;)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }).Take(5).ToList&amp;lt;XboxUserGameInfo&amp;gt;()       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }).First();&lt;/p&gt; &lt;/code&gt;  &lt;p&gt;That may look like a mouthful but if you compare the XML results and the query you can see the relationship between the two.&amp;#160; The end result a fully populated XboxInfo object that can be used to update the interface.&lt;/p&gt;  &lt;p&gt;For more information on LINQ read the &lt;a href="http://msdn2.microsoft.com/en-us/library/bb308959.aspx"&gt;overview on MSDN&lt;/a&gt; and Scott Guthrie's tutorial &lt;a href="http://weblogs.asp.net/scottgu/archive/2006/05/14/Using-LINQ-with-ASP.NET-_2800_Part-1_2900_.aspx"&gt;Using LINQ with ASP.NET&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Other parts in this series are available:&lt;/p&gt;  &lt;li&gt;&lt;a href="http://adamkinney.com/blog/325/default.aspx"&gt;Building the Gamercard Part 1, Composing the UI&lt;/a&gt; &lt;/li&gt;  &lt;li&gt;&lt;a href="http://adamkinney.com/blog/327/default.aspx"&gt;Building the Gamercard Part 3, Updating the UI&lt;/a&gt;     &lt;p&gt;&amp;#160;&lt;/p&gt;    &lt;p&gt;&lt;img style="border-top-style: none; border-right-style: none; border-left-style: none; border-bottom-style: none" alt="my diigo links" src="http://www.diigo.com/images/ii_blue.gif" /&gt;&amp;#160;&lt;a title="more info on Silverlight controls" href="http://www.diigo.com/user/adamkinney/silverlight+networking"&gt;silverlight+networking&lt;/a&gt;, &lt;a title="more info on Silverlight controls" href="http://www.diigo.com/user/adamkinney/silverlight"&gt;silverlight&lt;/a&gt;&lt;/p&gt; &lt;/li&gt;&lt;img src="http://adamkinney.com/blog/326/aggviewbug/default.aspx" alt="" /&gt;</description><comments>http://adamkinney.com/blog/326/default.aspx</comments><link>http://adamkinney.com/blog/326/default.aspx</link><pubDate>Thu, 17 Apr 2008 23:40:00 GMT</pubDate><guid isPermaLink="true">http://adamkinney.com/blog/326/default.aspx</guid><dc:creator>Adam Kinney</dc:creator><slash:comments>0</slash:comments><trackback:ping>http://adamkinney.com/blog/326/trackback/default.aspx</trackback:ping><category>networking</category><category>Silverlight</category><category>XboxFriendsWatch</category></item><item><title>Building the Gamercard Part 1, Composing the UI</title><description>&lt;p&gt;I recently published an &lt;a href="http://adamkinney.com/blog/322/default.aspx"&gt;Xbox Gamercard&lt;/a&gt; based on &lt;a href="http://silverlight.net/"&gt;Silverlight&lt;/a&gt; 2 Beta 1.&amp;#160; In that post a talked a little bit about the XAP model which now allows you to embed Silverlight applications via the object.&amp;#160; In Silverlight 1.0 application instantiation was handled via JavaScript and HTML with loose files.&amp;#160; Now with the XAP model we have a single file and object tag support which allows for simpler embedding of an application.&amp;#160; Especially by a non-developer web user, which is the main audience for the Gamercard application.&lt;/p&gt;  &lt;p&gt;In this three part series I will highlight a few of the new features in Silverlight 2 and how the application was built. In this first part, I'll cover how the interface for the application was composed.&lt;/p&gt;  &lt;h2&gt;First stop the Grid&lt;/h2&gt;  &lt;div style="float: right; margin-bottom: 10px; margin-left: 10px"&gt;&lt;img src="http://adamkinney.com/images/xbfgc/gridlines.jpg" /&gt; &lt;/div&gt;  &lt;p&gt;Ah, the mighty &lt;a href="http://msdn2.microsoft.com/en-us/library/system.windows.controls.grid(VS.95).aspx"&gt;Grid&lt;/a&gt;, master of layout panels.&amp;#160; The Grid is the embodiment of what you always wanted from the HTML table. That is, of course, back in the&amp;#160; old days when you were still using the table for layout.&lt;/p&gt;  &lt;p&gt;The screenshot to the right shows the Grid used for the Gamercard with the &lt;a href="http://msdn2.microsoft.com/en-us/library/system.windows.controls.grid.showgridlines(VS.95).aspx"&gt;ShowGridLines&lt;/a&gt; property turned on.&amp;#160; GridLines can be very useful as an aid when in design mode, whether you're working in Blend or Visual Studio.&amp;#160; The Grid is the main container of all the elements seen on the screen.&lt;/p&gt;  &lt;div style="clear: both"&gt;&lt;/div&gt;  &lt;div style="float: right; margin-bottom: 10px"&gt;&lt;img src="http://adamkinney.com/images/xbfgc/grid_rows_and_span.jpg" /&gt;&lt;/div&gt;  &lt;div style="float: right; margin-bottom: 2px; margin-left: 10px"&gt;&lt;img src="http://adamkinney.com/images/xbfgc/grid_columns.jpg" /&gt;&lt;/div&gt;  &lt;p&gt;Like the HTML table, the Grid is made up of Columns and Rows and elements can span multiple Columns or Rows using ColumnSpan and RowSpan, respectively.&lt;/p&gt;  &lt;p&gt;Unlike the HTML table there is no table cell concept.&amp;#160; Each Element&amp;#160; defines its location using &lt;a href="http://msdn2.microsoft.com/en-us/library/system.windows.controls.grid_attachedproperties(VS.95).aspx"&gt;attached properties provided by the Grid class&lt;/a&gt; instead.&lt;/p&gt;  &lt;p&gt;The TextBlock at the bottom of the grid with the text value of &amp;quot;Shadowrun (G 885/1000)&amp;quot; is defined in XAML as:&lt;/p&gt; &lt;code&gt;&amp;lt;TextBlock Grid.Row=&amp;quot;4&amp;quot; Grid.ColumnSpan=&amp;quot;2&amp;quot; ...&amp;#160; /&amp;gt;&lt;/code&gt;   &lt;p&gt;This places the TextBlock in the first column (0) which is the default value of Grid.Column and in the fourth Row based on the value set.&amp;#160; It also spans both columns to make room for longer text that would not fit in the first column which has a width of 76 pixels.&lt;/p&gt;  &lt;div style="clear: both"&gt;&lt;/div&gt;  &lt;div style="float: right; margin-bottom: 10px; margin-left: 10px"&gt;&lt;img src="http://adamkinney.com/images/xbfgc/grid_lengths.jpg" /&gt; &lt;/div&gt;  &lt;p&gt;Columns and Rows are defined and their values are set using the &lt;a href="http://msdn2.microsoft.com/en-us/library/system.windows.controls.grid.columndefinitions(VS.95).aspx"&gt;ColumnDefinitions&lt;/a&gt; and &lt;a href="http://msdn2.microsoft.com/en-us/library/system.windows.controls.grid.rowdefinitions(VS.95).aspx"&gt;RowDefinitions&lt;/a&gt;. In the case of the Gamercard, the height and width of each column and row is set to a specific value except for the last one which is set using the star (*) syntax.&lt;/p&gt;  &lt;p&gt;The star denotes proportional sizing, which means here the last Row and Column take up the remaining space in the Grid not yet claimed by other Columns or Rows.&lt;/p&gt;  &lt;p&gt;Proportional sizing can also be used across Columns or Rows.&amp;#160; For example, the width of the first column could be set to &amp;quot;*&amp;quot; and the second set to &amp;quot;2*&amp;quot;.&amp;#160; If the Grid was 150 pixels wide, the first column would end up being 50 pixels wide and the second column would be 100 pixels wide.&lt;/p&gt;  &lt;p&gt;For more on Grids check out Jesse Liberty's &lt;a href="http://silverlight.net/learn/tutorials/controls.aspx"&gt;Controls Tutorial&lt;/a&gt; or his &lt;a href="http://silverlight.net/learn/learnvideo.aspx?video=33733"&gt;Grids and Stack panels&lt;/a&gt; video.&lt;/p&gt;  &lt;h2&gt;Composing Controls&lt;/h2&gt;  &lt;div style="clear: both"&gt;&lt;/div&gt;  &lt;div style="float: right; margin-bottom: 2px; margin-left: 10px"&gt;&lt;img src="http://adamkinney.com/images/xbfgc/linkcomposition.jpg" /&gt; &lt;/div&gt;  &lt;p&gt;Another great feature of Silverlight is the ability to compose controls.&amp;#160; In the Gamercard application, a &lt;a href="http://msdn2.microsoft.com/en-us/library/system.windows.controls.hyperlinkbutton(VS.95).aspx"&gt;HyperlinkButton&lt;/a&gt; control is used to link to the Gamertag profile page.&amp;#160; Rather than simply using text for the link, in this case I wanted to use the the Profile Image which was easily accomplished using the XAML below:&lt;/p&gt; &lt;code&gt;&amp;lt;HyperlinkButton ....&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;HyperlinkButton.ToolTip&amp;gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;ToolTip Content=&amp;quot;View Profile&amp;quot; /&amp;gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/HyperlinkButton.ToolTip&amp;gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Canvas&amp;gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Rectangle Width=&amp;quot;64&amp;quot; Height=&amp;quot;64&amp;quot; RadiusX=&amp;quot;3&amp;quot; RadiusY=&amp;quot;3&amp;quot; Fill=&amp;quot;#333&amp;quot; /&amp;gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Image Width=&amp;quot;64&amp;quot; Height=&amp;quot;64&amp;quot; ...&amp;gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Image.Clip&amp;gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;RectangleGeometry RadiusX=&amp;quot;3&amp;quot; RadiusY=&amp;quot;3&amp;quot; Rect=&amp;quot;1,1,62,62&amp;quot; /&amp;gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/Image.Clip&amp;gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/Image&amp;gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/Canvas&amp;gt;     &lt;br /&gt;&amp;lt;/HyperlinkButton&amp;gt;&lt;/code&gt;   &lt;p&gt;The first child element is the attached property for &lt;a href="http://msdn2.microsoft.com/en-us/library/system.windows.controls.tooltip(VS.95).aspx"&gt;ToolTip&lt;/a&gt;, similar to the Grid.Row property mentioned above.&amp;#160; Although not a part of the HyperlinkButton's composition, this shows a simple version of implementing the Content property.&amp;#160; The same property is available on the HyperLinkButton control which could be set to a string value, which is how we would define a simple text link.&lt;/p&gt;  &lt;p&gt;As mentioned though, we want to customize the Template of the Content property which is done implicitly when child nodes that are not attached properties or added within the Control.&amp;#160; Content can only hold a single child, which was why the Canvas element is added first as a simple container.&amp;#160; After that a Rectangle and an Image control is added to provide the custom look.&amp;#160; And due to the composing functionality, the Hyperlink links to the profile page whether you click the Rectangle or the Image.&lt;/p&gt;  &lt;p&gt;The extra attributes on Rectangle and Image provide the round corners as well as clipping the raster image so it appears that it has transparent round corners.&amp;#160; I found the clipping method to be very useful when customizing images provided by an external service.&lt;/p&gt;  &lt;p&gt;...pausing to think about more mashup possibilities...&lt;/p&gt;  &lt;p&gt;For more on Composing Controls check out Jesse Liberty's &lt;a href="http://silverlight.net/learn/tutorials/controls.aspx"&gt;Controls Tutorial&lt;/a&gt;.&amp;#160; And if you have not watched it yet please check out &lt;a href="http://scorbs.com/2008/03/09/mix08-creating-rich-dynamic-user-interfaces-with-silverlight-2-controls/"&gt;Karen Corby's Controls presentation at MIX08&lt;/a&gt;.&amp;#160; The slides and sample code is available and she does a great job showing off how to compose, style and skin controls. &lt;/p&gt;  &lt;div style="clear: both"&gt;&lt;/div&gt;  &lt;p&gt;Other parts in this series are available:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://adamkinney.com/blog/326/default.aspx"&gt;Building the Gamercard Part 2, Retrieving the Data&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://adamkinney.com/blog/327/default.aspx"&gt;Building the Gamercard Part 3, Updating the UI&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;img style="border-top-style: none; border-right-style: none; border-left-style: none; border-bottom-style: none" alt="my diigo links" src="http://www.diigo.com/images/ii_blue.gif" /&gt;&amp;#160;&lt;a title="more info on XAP" href="http://www.diigo.com/user/adamkinney/xap"&gt;XAP&lt;/a&gt;, &lt;a title="more info on Silverlight controls" href="http://www.diigo.com/user/adamkinney/silverlight+controls"&gt;silverlight+controls&lt;/a&gt;, &lt;a title="more info on Silverlight controls" href="http://www.diigo.com/user/adamkinney/silverlight"&gt;silverlight&lt;/a&gt;&lt;/p&gt;&lt;img src="http://adamkinney.com/blog/325/aggviewbug/default.aspx" alt="" /&gt;</description><comments>http://adamkinney.com/blog/325/default.aspx</comments><link>http://adamkinney.com/blog/325/default.aspx</link><pubDate>Thu, 17 Apr 2008 23:39:00 GMT</pubDate><guid isPermaLink="true">http://adamkinney.com/blog/325/default.aspx</guid><dc:creator>Adam Kinney</dc:creator><slash:comments>2</slash:comments><trackback:ping>http://adamkinney.com/blog/325/trackback/default.aspx</trackback:ping><category>controls</category><category>Silverlight</category><category>XboxFriendsWatch</category></item><item><title>Silverlight Sidebar Gadgets on Windows Vista 64-bit edition</title><description>&lt;p style="float: right"&gt;&lt;a title="Silverlight-based Sidebar gadgets by adKinn, on Flickr" href="http://www.flickr.com/photos/adamkinney/2388288652/"&gt;&lt;img height="512" alt="Silverlight-based Sidebar gadgets" src="http://farm3.static.flickr.com/2110/2388288652_fddb6e385a_o.jpg" width="155" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;At this time (version 2 Beta 1), in the life of Silverlight there is no 64-bit support.&amp;nbsp; I'm not certain if or when 64-bit support will appear, but I don't think Vista 64-bit users should go without Silverlight. And the good news is they don't have to.&lt;/p&gt; &lt;p&gt;In most cases, running Silverlight applications should not be an issue.&amp;nbsp; IE7 and Firefox run in 32-bit mode by default allowing Silverlight to run as expected.&lt;/p&gt; &lt;p&gt;A different scenario which needs some attention is Sidebar Gadgets that use Silverlight.&amp;nbsp; The Windows Sidebar application (sidebar.exe) runs by default in 64-bit mode and in order to use a Silverlight-based gadget you need to run sidebar.exe in 32-bit mode.&lt;/p&gt; &lt;p&gt;You can do this simply by closing the default Sidebar and navigating to &lt;em&gt;C:\Program Files (x86)\Windows Sidebar&lt;/em&gt; and double-clicking &lt;em&gt;sidebar.exe&lt;/em&gt;.&amp;nbsp; Now you can successfully run the new &lt;a href="http://duncanmackenzie.net/blog/sidebar-gadgets-for-channel-9-channel-8-and-more/default.aspx"&gt;Channel 9 gadget&lt;/a&gt; or &lt;a href="http://adamkinney.com/studios/xboxfriendswatch"&gt;Xbox Friends Watch&lt;/a&gt; in your sidebar and enjoy knowing what the latest C9 video or or when your Xbox friends are online.&lt;/p&gt; &lt;p&gt;If you're happy with the results, you can make sure the 32-bit version of Sidebar is added to your system startup by following the step below:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;If you are still running the 64-bit Sidebar, right-click the Sidebar and select Properties.  &lt;li&gt;Uncheck the &lt;em&gt;Start Sidebar when Windows starts &lt;/em&gt;option and hit OK  &lt;li&gt;Open &lt;em&gt;C:\Program Files (x86)\Windows Sidebar&lt;/em&gt; in Windows Explorer  &lt;li&gt;Right-click &lt;em&gt;sidebar.exe&lt;/em&gt; and select Copy  &lt;li&gt;Right-click the Windows Orb and select Explore&lt;br&gt;&lt;img alt="Windows Orb" src="http://www.microsoft.com/windows/Framework/images/vista/windows-vista.gif" /&gt;  &lt;li&gt;In Windows Explorer navigate to the folder entitled &lt;em&gt;..Programs/Startup&lt;/em&gt;  &lt;li&gt;Right-click in the folder and select Paste Shortcut&lt;/li&gt;&lt;/ol&gt;&lt;img src="http://adamkinney.com/blog/323/aggviewbug/default.aspx" alt="" /&gt;</description><comments>http://adamkinney.com/blog/323/default.aspx</comments><link>http://adamkinney.com/blog/323/default.aspx</link><pubDate>Fri, 04 Apr 2008 23:03:00 GMT</pubDate><guid isPermaLink="true">http://adamkinney.com/blog/323/default.aspx</guid><dc:creator>Adam Kinney</dc:creator><slash:comments>5</slash:comments><trackback:ping>http://adamkinney.com/blog/323/trackback/default.aspx</trackback:ping><category>Channel 10</category><category>Channel 9</category><category>gadgets</category><category>Sidebar Gadgets</category><category>Silverlight</category><category>Windows Vista</category><category>XboxFriendsWatch</category></item><item><title>Xbox Friends Watch - releasing v1 of the new Gamercard</title><description>&lt;h2&gt;Xaps&lt;/h2&gt;  &lt;p&gt;One of my favorite new features of Silverlight 2 is the new Application model.&amp;#160; Moving on from version 1.0, where JavaScript instantiation was the only way to start your app and you were restricted to the same origin as the web page, enter the Xap.&amp;#160; The new packaging model, not only bundles your assets into one file enabling simpler deployment, it also enables application instantiation via the object tag.&amp;#160; Plus, the Xap can live on a separate server than the web page, which enables the creation of embeddable applications with Silverlight. &lt;/p&gt;  &lt;p&gt;&amp;lt;applause!&amp;gt;&lt;/p&gt;  &lt;p&gt;- &lt;a href="http://www.diigo.com/user/adamkinney/xap?tab=250"&gt;More information about Xaps and the new Application Model&lt;/a&gt;&lt;/p&gt;  &lt;h2&gt;Xbox Friends Watch Gamercard&lt;/h2&gt;  &lt;p&gt;In celebration of this functionality, I've expanded on the &lt;a href="http://adamkinney.com/studios/xboxfriendswatch/"&gt;Xbox Friends Watch&lt;/a&gt; line and added a new &lt;a href="http://adamkinney.com/studios/xboxfriendswatch/gamercard.html"&gt;Gamercard&lt;/a&gt;.&amp;#160; &lt;a href="http://www.xbox.com"&gt;Xbox.com&lt;/a&gt; currently offers a gamercard which renders a fairly static set of html and images which is embedded via an iframe.&amp;#160; Using Silverlight for its interactivity, data stack and portability and the &lt;a href="http://duncanmackenzie.net/blog/put-up-a-rest-api-for-xbox-gamertag-data/default.aspx"&gt;Xbox Gamertag Data Service&lt;/a&gt; I thought I would be able to enhance the experience as well as expose the status information provided by the Data Service.&lt;/p&gt;  &lt;p&gt;Below is the result of my experiment and using the &lt;a href="http://adamkinney.com/studios/xboxfriendswatch/gamercard.html"&gt;Gamercard page&lt;/a&gt; you can create a script to add the Gamercard to your site.&lt;/p&gt;  &lt;p&gt;&lt;object data="data:application/x-silverlight," type="application/x-silverlight-2-b1" width="204" height="160"&gt;&lt;param name="source" value="http://adamkinney.com/xbf/XboxGamerCard.xap" /&gt;&lt;param name="background" value="#00000000" /&gt;&lt;param name="Windowless" value="True" /&gt;&lt;param name="enableHtmlAccess" value="True" /&gt;&lt;param name="initParams" value="gamertag=quemark" /&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=108182" style="text-decoration: none;"&gt;&lt;img src="http://adamkinney.com/xbf/gci.jpg" alt="Get Microsoft Silverlight" style="border-style: none" /&gt;&lt;/a&gt;&lt;/object&gt;&lt;/p&gt;  &lt;p&gt;- &lt;a href="http://adamkinney.com/studios/xboxfriendswatch/gamercard.html"&gt;Add the Gamercard to your page&lt;/a&gt;&lt;/p&gt;  &lt;h2&gt;Next Steps&lt;/h2&gt;  &lt;p&gt;My next post will include some of the technical details covering how the Gamercard was created and some of the techniques I used to work with Silverlight 2.&lt;/p&gt;  &lt;p&gt;If you're interested in following the saga of the Xbox Friends Watch components you can subscribe to &lt;a href="http://adamkinney.com/blog/tags/XboxFriendsWatch/rss/default.aspx"&gt;my XBF feed&lt;/a&gt;, follow &lt;a href="http://twitter.com/xbf"&gt;XBF on Twitter&lt;/a&gt; or follow &lt;a href="http://www.facebook.com/pages/Xbox-Friends-Watch/8849870070"&gt;XBF on Facebook&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://adamkinney.com/blog/322/aggviewbug/default.aspx" alt="" /&gt;</description><comments>http://adamkinney.com/blog/322/default.aspx</comments><link>http://adamkinney.com/blog/322/default.aspx</link><pubDate>Thu, 03 Apr 2008 06:50:00 GMT</pubDate><guid isPermaLink="true">http://adamkinney.com/blog/322/default.aspx</guid><dc:creator>Adam Kinney</dc:creator><slash:comments>5</slash:comments><trackback:ping>http://adamkinney.com/blog/322/trackback/default.aspx</trackback:ping><category>demo</category><category>gaming</category><category>Silverlight</category><category>Xbox</category><category>XboxFriendsWatch</category></item><item><title>Xbox Friends Watch - v1.2 has been posted</title><description>&lt;p&gt;&lt;a href="http://adamkinney.com/studios/xboxfriendswatch/XboxFriendsWatch.gadget"&gt;Download 1.2 now&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;This is a very small update that is the same as version 1.1, except that a fix has been added to allow the sidebar gadget to run if you have installed the &lt;a href="http://silverlight.net/GetStarted/"&gt;Silverlight 2 Beta 1 runtime&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;There was a small bug in path resolution that the team is aware of and will hopefully be able to fix in future releases.&lt;/p&gt;  &lt;p&gt;When setting the source parameter during application initialization the workaround involves making the path absolute using the gadget protocol. &lt;/p&gt;  &lt;p&gt;Old code:&lt;/p&gt;  &lt;p&gt;&lt;code&gt;source: &amp;quot;xaml/SideBar.xaml&amp;quot;&lt;/code&gt;&lt;/p&gt;  &lt;p&gt;New code:&lt;/p&gt;  &lt;p&gt;&lt;code&gt;source: &amp;quot;x-gadget:///xaml/SideBar.xaml&amp;quot;&lt;/code&gt;&lt;/p&gt;  &lt;p&gt;I know this is not the promised version 2 that many of you are looking for, but getting past this bug is a step in the right direction.&lt;/p&gt;  &lt;p&gt;Thanks to &lt;a href="http://livegadgets.net/"&gt;Donovan&lt;/a&gt; for finding the solution!&lt;/p&gt;&lt;img src="http://adamkinney.com/blog/320/aggviewbug/default.aspx" alt="" /&gt;</description><comments>http://adamkinney.com/blog/320/default.aspx</comments><link>http://adamkinney.com/blog/320/default.aspx</link><pubDate>Wed, 26 Mar 2008 19:03:00 GMT</pubDate><guid isPermaLink="true">http://adamkinney.com/blog/320/default.aspx</guid><dc:creator>Adam Kinney</dc:creator><slash:comments>7</slash:comments><trackback:ping>http://adamkinney.com/blog/320/trackback/default.aspx</trackback:ping><category>Sidebar Gadgets</category><category>Silverlight</category><category>XboxFriendsWatch</category></item><item><title>Xbox Friends Watch - v1.1 has been posted</title><description>&lt;p&gt;&lt;a href="http://adamkinney.com/studios/xboxfriendswatch/XboxFriendsWatch.gadget"&gt;Download 1.1 Now&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Performance Improvements&lt;/strong&gt;    &lt;br /&gt;A week ago, I posted the first version of the &lt;a href="http://adamkinney.com/blog/272/default.aspx"&gt;Xbox Friends Watch Gadget&lt;/a&gt;.&amp;#xA0; I received a lot of great feedback and feature suggestions.&amp;#xA0; The most noticeable was the excessive amount of memory consumed for some people.&amp;#xA0; I've gone through and optimized, &lt;a href="http://www.jslint.com/"&gt;linted&lt;/a&gt; and crunched the code.&amp;#xA0; I've run this version for a few days now and although it still runs higher than I'd like(20k) that's a lot better than the (300k) I had seen before.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://duncanmackenzie.net/"&gt;Duncan&lt;/a&gt; has also optimized and compressed the REST service, the size of the data downloaded is much smaller.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Version Check     &lt;br /&gt;&lt;/strong&gt;Another big feature, is that the gadget now checks to see if it has the latest version.&amp;#xA0; Definitely something I wish I had added with the initial release. I'm guessing 70% of the people who downloaded the gadget's first release won't find this new release or any consecutive ones.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Next Steps     &lt;br /&gt;&lt;/strong&gt;I've added a &lt;a href="http://adamkinney.com/studios/xboxfriendswatch/"&gt;page just for the Gadget&lt;/a&gt; and will be adding Suggestions as well as FAQ.&amp;#xA0; And then I will work on the next update where I will target &amp;quot;access to the gadget context menu&amp;quot;, &amp;quot;loading screens&amp;quot; and &amp;quot;more than five friends displayed&amp;quot;.&lt;/p&gt;&lt;img src="http://adamkinney.com/blog/279/aggviewbug/default.aspx" alt="" /&gt;</description><comments>http://adamkinney.com/blog/279/default.aspx</comments><link>http://adamkinney.com/blog/279/default.aspx</link><pubDate>Fri, 02 Nov 2007 15:25:00 GMT</pubDate><guid isPermaLink="true">http://adamkinney.com/blog/279/default.aspx</guid><dc:creator>Adam Kinney</dc:creator><slash:comments>33</slash:comments><trackback:ping>http://adamkinney.com/blog/279/trackback/default.aspx</trackback:ping><category>Sidebar Gadgets</category><category>Silverlight</category><category>Xbox</category><category>XboxFriendsWatch</category></item><item><title>Lots of good Gadget feedback</title><description>&lt;p&gt;Wow, so much feedback on the &lt;a href="http://adamkinney.com/blog/272/default.aspx"&gt;Xbox Friends Watch&lt;/a&gt; Gadget its crazy.&amp;nbsp; &lt;a href="http://www.majornelson.com/archive/2007/10/25/xbox-friends-watch-a-sidebar-gadget-using-silverlight.aspx"&gt;Major Nelson did end up posting a link&lt;/a&gt; to the gadget (thanks &lt;a href="http://duncanmackenzie.net/"&gt;Duncan&lt;/a&gt;) and the flood gates opened.&amp;nbsp; 47 comments so far on my post, 120 comments on Major Nelson's, 1,388 views on the &lt;a href="http://channel9.msdn.com/Showpost.aspx?postid=350414"&gt;demo screencast on Channel 9&lt;/a&gt; and according to my server logs it appears the gadget has been &lt;strong&gt;downloaded 2,471 times&lt;/strong&gt;.&lt;/p&gt; &lt;p&gt;That's awesome.&lt;/p&gt; &lt;p&gt;But what's not awesome is the gadget doesn't run too well.&amp;nbsp; I originally wrote it as a &lt;a href="http://adamkinney.com/blog/266/default.aspx"&gt;demo for a presentation&lt;/a&gt; and it's the first sidebar gadget I have written.&amp;nbsp; I don't want all of this momentum to go to waste though, especially since the gadget appears like it could be really useful to a lot of people.&amp;nbsp; My plan is to work on an update that will cover a few of the major bugs/feature requests.&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;Performance&lt;/strong&gt; - The JavaScript was never optimized and I need to look into the best practices for running with in the Sidebar.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Error Handling &lt;/strong&gt;- another missing important piece.&amp;nbsp; Currently the render will fail on a Gamer who is in private mode.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;More than 5 Friends&lt;/strong&gt; - One person posted a hack to resize the gadget by changing the html, but I think in docked mode a scrollable list would be best.&amp;nbsp; Then in undocked mode, I'd like to show at at least twice the height, still adding the scroll functionality.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Access to the gadget right-click menu &lt;/strong&gt;- most requested for opacity.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;and Custom Colors &lt;/strong&gt;- if everything else goes smoothly (crosses fingers)&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;And now to address a FAQs:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;It doesn't work on 64-bit Vista?&lt;br&gt;&lt;/strong&gt; Unfortunately Silverlight does not provide&amp;nbsp; 64-bit support, but you can run the Sidebar in 32-bit mode if you want to use the gadget by &lt;a href="http://adamkinney.com/blog/272/default.aspx#comment-22"&gt;following the instructions Shane posted in the comments&lt;/a&gt;.&lt;br&gt;&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Why Silverlight?&lt;br&gt;&lt;/strong&gt;No it did not &lt;em&gt;have&lt;/em&gt; to be Silverlight, but that was the original point of the demo.&amp;nbsp; Not only am I a big fan of SIlverlight, but you will also find I am a bit biased due to my current position at Microsoft.&amp;nbsp; Bias aside, I think Silverlight can work really well as the UI for Sidebar Gadgets.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Look for version 1.5 coming soon, I'll update the &lt;a href="http://adamkinney.com/blog/272/default.aspx"&gt;original post&lt;/a&gt; once its available.&lt;/p&gt;&lt;img src="http://adamkinney.com/blog/273/aggviewbug/default.aspx" alt="" /&gt;</description><comments>http://adamkinney.com/blog/273/default.aspx</comments><link>http://adamkinney.com/blog/273/default.aspx</link><pubDate>Sat, 27 Oct 2007 08:04:00 GMT</pubDate><guid isPermaLink="true">http://adamkinney.com/blog/273/default.aspx</guid><dc:creator>Adam Kinney</dc:creator><slash:comments>5</slash:comments><trackback:ping>http://adamkinney.com/blog/273/trackback/default.aspx</trackback:ping><category>gadgets</category><category>Sidebar Gadgets</category><category>Silverlight</category><category>Xbox</category><category>XboxFriendsWatch</category></item><item><title>Xbox Friends Watch - a Sidebar Gadget using Silverlight</title><description>&lt;p&gt;[&lt;strong&gt;UPDATE: &lt;/strong&gt;&lt;a href="http://adamkinney.com/blog/279/default.aspx"&gt;version 1.1 has been posted&lt;/a&gt;, performance improvements and an auto version checker now included.]&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.flickr.com/photos/adamkinney/1740762008/"&gt;&lt;img id="id" src="http://farm3.static.flickr.com/2226/1740762008_37e32fee86.jpg?v=0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;HALO 3 is out and my Xbox is now getting the love it truly deserves.&amp;#xA0; Multiplayer mode in HALO is a lot of fun and even more fun when you can play with friends.&amp;#xA0; Thus, a perfect opportunity was born to create a useful sidebar gadget.&lt;/p&gt;

&lt;p&gt;I've recorded a demo on &lt;a href="http://channel9.msdn.com/ShowPost.aspx?PostID=350414"&gt;how the gadget works available on Channel 9&lt;/a&gt; and you can &lt;a href="http://adamkinney.com/studios/xboxfriendswatch/XboxFriendsWatch.gadget"&gt;&lt;strong&gt;download the gadget&lt;/strong&gt;&lt;/a&gt; directly from my server, although I will be posting it to the &lt;a href="http://gallery.live.com/"&gt;Gadget Gallery&lt;/a&gt; shortly.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Just make sure that before you run the gadget you &lt;a href="http://go.microsoft.com/fwlink/?LinkID=89015&amp;amp;clcid=0x409"&gt;install Silverlight 1.0&lt;/a&gt;, otherwise the gadget will not work.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;My data source for Xbox Live information is coming from &lt;a href="http://duncanmackenzie.net/blog/put-up-a-rest-api-for-xbox-gamertag-data/default.aspx"&gt;Duncan Mackenzie's REST service&lt;/a&gt; and the UI is done completely in Silverlight 1.0.&amp;#xA0; This turned out to be a really fun project and the Sidebar hosting environment was a great place for a Silverlight application.&amp;#xA0; &lt;/p&gt;

&lt;p&gt;One of the most obvious benefits is that within the Sidebar you can make cross-domain calls, no need for any server-side proxies.&amp;#xA0; You also gain access to certain System properties and a small data storage model all through the Gadget API.&lt;/p&gt;

&lt;p&gt;I foresee more Silverlight-based Sidebar Gadgets in the future, I'm looking at you Twitter API...&lt;/p&gt;
&lt;img src="http://adamkinney.com/blog/272/aggviewbug/default.aspx" alt="" /&gt;</description><comments>http://adamkinney.com/blog/272/default.aspx</comments><link>http://adamkinney.com/blog/272/default.aspx</link><pubDate>Thu, 25 Oct 2007 06:42:00 GMT</pubDate><guid isPermaLink="true">http://adamkinney.com/blog/272/default.aspx</guid><dc:creator>Adam Kinney</dc:creator><slash:comments>76</slash:comments><trackback:ping>http://adamkinney.com/blog/272/trackback/default.aspx</trackback:ping><category>HALO</category><category>Sidebar Gadgets</category><category>Silverlight</category><category>Xbox</category><category>XboxFriendsWatch</category></item></channel></rss>