<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" 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:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
	<title>Channel 9 - Entries tagged with User Controls</title>
    <atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Tags/user+controls/RSS"></atom:link>
    <itunes:summary></itunes:summary>
    <itunes:author>Microsoft</itunes:author>
    <itunes:subtitle></itunes:subtitle>
    <image>
      <url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url>
      <title>Channel 9 - Entries tagged with User Controls</title>
      <link>http://channel9.msdn.com/Tags/user+controls</link>
    </image>
    <itunes:image href=""></itunes:image>
    <itunes:category text="Technology"></itunes:category>
    <description>Channel 9 keeps you up to date with the latest news and behind the scenes info from Microsoft that developers love to keep up with. From LINQ to SilverLight – Watch videos and hear about all the cool technologies coming and the people behind them.</description>
    <link>http://channel9.msdn.com/Tags/user+controls</link>
    <language>en</language>
    <pubDate>Fri, 24 May 2013 20:00:31 GMT</pubDate>
    <lastBuildDate>Fri, 24 May 2013 20:00:31 GMT</lastBuildDate>
    <generator>Rev9</generator>
    <c9:totalResults>4</c9:totalResults>
    <c9:pageCount>1</c9:pageCount>
    <c9:pageSize>25</c9:pageSize>
  <item>
      <title>Let your apps sell themselves!</title>
      <description><![CDATA[<p>Don't miss any opportunity to market your Windows Phone apps!&nbsp; Each one of your apps can serve as an ad for your other apps.&nbsp;&nbsp;&nbsp; Learn how to add a listing of everything you have published in Marketplace to each of your apps.&nbsp; Even better, it will always be up to date!</p><h3>Introduction</h3><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/image%5B2%5D-2.png"><img title="image" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/image_thumb-2.png" alt="image" width="244" height="189" align="left" border="0"></a>I've written a number of Windows Phone apps, and each time I've wanted to let people know about my other apps.&nbsp; While I could mention the other apps somewhere, I wouldn't want to update all of my apps each time I release a new one.&nbsp; It finally occurred to me that I could use the listing of apps directly from Marketplace instead.&nbsp; This provides me with an easy-to-parse XML feed (Atom) of my apps with all of the info that I need.&nbsp; Armed with that, it wasn't too much work to create a user control to let me drop in the list of apps anytime I need it.</p><p>This code doesn't require a physical phone, but it isn't very useful if you don't have a Marketplace account!&nbsp; Ideally, you should have several published apps under your account for this to make much sense.&nbsp; Once you have it in place though, all of your apps will always show your complete list without any special updates.</p><p>If you don't have the software installed, go to <a href="http://create.msdn.com/">create.msdn.com</a>, then click <strong>Download the free tools </strong>to download the Windows Phone Developer Tools (or use the direct download link provided above this Introduction section). This code is written for the Windows Phone Developer Tools 7.1 (Mango).&nbsp; It’s is a mostly online install, and it’s pretty big so expect it to take some time. Even if you don’t have any development tools, this will give you Visual Studio Express, Blend, and XNA Game Studio. If you have the full-version tools already, it will add new templates.</p><h3>Project Basics</h3><p>The intention is to create a user control to display a list of apps from a given publisher (preferably yourself!).&nbsp; This user control will be implemented as a ListBox with individual apps showing up visually similar to the way they do in Marketplace.&nbsp; Touching an app in the list should bring the user directly to the appropriate Marketplace page.&nbsp; It should be as easy as adding a project reference, adding the control to a XAML page, and setting the publisher (this could potentially be set by reading the WMAppManifest.xml file).</p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/MyAppsList7.png"><img title="MyAppsList" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/MyAppsList_thumb3.png" alt="MyAppsList" width="465" height="772" border="0"></a></p><h3>Marketplace Data</h3><p>At first glance, getting Marketplace data programmatically isn't an option.&nbsp; Sadly, there's no API for this.&nbsp; Fortunately, there's a solution!&nbsp; If you're using the Zune app to browse publishers and apps, you can watch the network traffic using Fiddler (<a href="http://fiddler2.com/fiddler2/">http://fiddler2.com/fiddler2/</a>).&nbsp; What's nice is that everything you do in Zune results in a simple HTTP request for the data, which is returned as an XML stream.&nbsp; A simple WebRequest object can do a DownloadStringAsync call to get the data, then the SyndicationFeed class can load and parse it.&nbsp; There are extension elements for rating, release date, and price.&nbsp; Even nicer, is that the image thumbnail can be resized server-side based on the URL query string.&nbsp; This makes it super easy to get exactly what we need.</p><p>The server of interest is catalog.zune.net, and the URL format is:</p><p>&nbsp;</p><pre class="csharpcode"><pre class="brush: text">/v3.2/en-US/apps?q=PublisherName&amp;clientType=WinMobile 7.1&amp;store=zest</pre></pre><p>The &quot;q&quot; parameter just needs to be set to the publisher name of interest.&nbsp; Remember to URL encode yours if you have spaces in it.</p><p>Note the &quot;clientType&quot; parameter.&nbsp; If you change it to WinMobile 7.0 you will get NoDo (pre-Mango) apps only.&nbsp; You may or may not have anything show up for that, but it's not likely you'll want that list.</p><p>The &quot;store&quot; parameter is set to &quot;zest&quot; but we'll just have to take this one on faith!&nbsp; I'm not aware of any other options here.&nbsp; This could vary by country, but I don't have any data on that.</p><p>This will return all apps for Mango.&nbsp; This returns feed information starting with a header:</p><p>&nbsp;</p><pre class="csharpcode"><pre class="brush: xml">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;a:feed xmlns:a=&quot;http://www.w3.org/2005/Atom&quot; xmlns:os=http://a9.com/-/spec/opensearch/1.1/ 
 xmlns=&quot;http://schemas.zune.net/catalog/apps/2008/02&quot;&gt;
  &lt;a:link rel=&quot;self&quot; type=&quot;application/atom&#43;xml&quot; 
    href=&quot;/v3.2/en-US/apps?q=Arian&#43;T.&#43;Kulp&amp;amp;store=zest&amp;amp;clientType=WinMobile&#43;7.1&quot; /&gt;
  &lt;os:startIndex&gt;1&lt;/os:startIndex&gt;
  &lt;os:totalResults&gt;5&lt;/os:totalResults&gt;
  &lt;os:itemsPerPage&gt;5&lt;/os:itemsPerPage&gt;
  &lt;a:updated&gt;2012-01-30T04:21:41.9702941Z&lt;/a:updated&gt;
  &lt;a:title type=&quot;text&quot;&gt;List Of Items&lt;/a:title&gt;
  &lt;a:id&gt;tag:catalog.zune.net,2012-01-30:/apps&lt;/a:id&gt;</pre></pre><p>&nbsp;</p><p>You can pretty much ignore this section.&nbsp; The important stuff comes next!&nbsp; Each Atom entry is one app, along with every bit of metadata that you need to make an interesting view:</p><p>&nbsp;</p><pre class="csharpcode">  <pre class="brush: xml">&lt;a:entry&gt;
    &lt;a:updated&gt;2012-01-30T04:21:41.9858942Z&lt;/a:updated&gt;
    &lt;a:title type=&quot;text&quot;&gt;Metro Lockscreen Creator&lt;/a:title&gt;
    &lt;a:id&gt;urn:uuid:0f5eaaa8-e75e-4a04-a5f9-24db1c176a6b&lt;/a:id&gt;
    &lt;sortTitle&gt;Metro Lockscreen Creator&lt;/sortTitle&gt;
    &lt;releaseDate&gt;2011-07-26T14:30:39.987Z&lt;/releaseDate&gt;
    &lt;version&gt;1.3.0.0&lt;/version&gt;
    &lt;averageUserRating&gt;7.254902&lt;/averageUserRating&gt;
    &lt;userRatingCount&gt;51&lt;/userRatingCount&gt;
    &lt;averageLastInstanceUserRating&gt;5.2&lt;/averageLastInstanceUserRating&gt;
    &lt;lastInstanceUserRatingCount&gt;5&lt;/lastInstanceUserRatingCount&gt;
    &lt;image&gt;
      &lt;id&gt;urn:uuid:cb46389d-6d50-4be0-b4ff-75c968f301ea&lt;/id&gt;
    &lt;/image&gt;
    &lt;categories&gt;
      &lt;category&gt;
        &lt;id&gt;windowsphone.toolsandproductivity&lt;/id&gt;
        &lt;title&gt;tools &#43; productivity&lt;/title&gt;
        &lt;isRoot&gt;True&lt;/isRoot&gt;
      &lt;/category&gt;
    &lt;/categories&gt;
    &lt;tags&gt;
      &lt;tag&gt;apptag.independent&lt;/tag&gt;
    &lt;/tags&gt;
    &lt;offers&gt;
      &lt;offer&gt;
        &lt;offerId&gt;urn:uuid:b8d5cc60-0839-4bcb-b26e-e85ba3e92c8d&lt;/offerId&gt;
        &lt;mediaInstanceId&gt;urn:uuid:2ff871ea-cf8a-488e-b613-286052b90a13&lt;/mediaInstanceId&gt;
        &lt;clientTypes&gt;
          &lt;clientType&gt;WinMobile 7.1&lt;/clientType&gt;
        &lt;/clientTypes&gt;
        &lt;paymentTypes&gt;
          &lt;paymentType&gt;Credit Card&lt;/paymentType&gt;
          &lt;paymentType&gt;Mobile Operator&lt;/paymentType&gt;
        &lt;/paymentTypes&gt;
        &lt;store&gt;Zest&lt;/store&gt;
        &lt;price&gt;0&lt;/price&gt;
        &lt;displayPrice&gt;$0.00&lt;/displayPrice&gt;
        &lt;priceCurrencyCode&gt;USD&lt;/priceCurrencyCode&gt;
        &lt;licenseRight&gt;Purchase&lt;/licenseRight&gt;
      &lt;/offer&gt;
    &lt;/offers&gt;
    &lt;publisher&gt;
      &lt;id&gt;Arian T. Kulp&lt;/id&gt;
      &lt;name&gt;Arian T. Kulp&lt;/name&gt;
    &lt;/publisher&gt;
  &lt;/a:entry&gt;</pre></pre><p>From this block you can get title, release date, rating average and count, category, image ID (easily converted to URL), and price (per market).&nbsp; The <strong>System.ServiceModel.Syndication.SyndicationFeed</strong> class can read from an <strong>XMLReader </strong>object and it handles everything for you.&nbsp; Dealing with the custom Marketplace namespace can lead to some slight complication, but fortunately that's simplified as well.</p><h3>Syndicated Data</h3><p>For standard Atom elements (the ones with the a: namespace here), you can use properties of the <strong>SyndicationItem</strong> class.&nbsp; For some reason, the <strong>SyndicationItem </strong>class isn't actually available in the Windows Phone libraries.&nbsp; I'm not sure why this is the case, but it turns out that you can use the desktop version without a problem.&nbsp; Just add a reference to the &quot;C:\Program Files (x86)\Microsoft SDKs\Silverlight\v3.0\Libraries\Client\System.ServiceModel.Syndication&quot; assembly.&nbsp; You might get a warning when you add it, but it will work fine.&nbsp; If you download the accompanying code, you'll get all the assemblies you need in it.</p><p>The <strong>SyndicationItem </strong>class gets you properties like <em>Title</em> and <em>Id</em>.&nbsp; The other properties are all custom types in the &quot;http://schemas.zune.net/catalog/apps/2008/02&quot; namespace.&nbsp; From these properties, you are interested in <em>shortDescription</em>, <em>userRatingCount</em>, <em>averageUserRating</em>, <em>version</em>, <em>releaseDate</em>, <em>displayPrice</em>, and <em>priceCurrencyCode</em>.&nbsp; Instead of worrying about namespaces, since you know they are custom elements, you can use the <em>ElementExtensions</em> collection on the <strong>SyndicationItem</strong> and query the <em>OuterName</em> property.&nbsp; A simple extension method makes this easy:</p><p><strong>Visual Basic</strong></p><p>&nbsp;</p><pre class="csharpcode"><pre class="brush: vb">Private Shared Function GetExtensionElementValue(Of T)(item As SyndicationItem, extensionElementName As String) As T
  Dim f = (From ee In item.ElementExtensions Where ee.OuterName = extensionElementName).FirstOrDefault()

  Return If(f Is Nothing, Nothing, f.GetObject(Of T)())
End Function</pre></pre><p><strong>Visual C#</strong></p><pre class="csharpcode"><pre class="brush: csharp">private static T GetExtensionElementValue&lt;T&gt;(SyndicationItem item, string extensionElementName)
{
    var f = item.ElementExtensions.Where(ee =&gt; ee.OuterName == extensionElementName).FirstOrDefault();
    return f == null ? default(T) : f.GetObject&lt;T&gt;();
}</pre></pre><p>With this method in place, you can create most of a new MarketplaceApp object with the following code:</p><p><strong>Visual Basic</strong></p><p>&nbsp;</p><pre class="csharpcode"><pre class="brush: vb">Dim app = New MarketplaceApp() With { _
    .Id = id, _
    .AppLink = &quot;http://windowsphone.com/s?appid=&quot; &amp; Convert.ToString(id), _
    .Title = item.Title.Text, _
    .ShortDescription = GetExtensionElementValue(Of String)(item, &quot;shortDescription&quot;), _
    .UserRatingCount = GetExtensionElementValue(Of Integer)(item, &quot;userRatingCount&quot;), _
    .Version = GetExtensionElementValue(Of String)(item, &quot;version&quot;), _
    .AverageUserRating = GetExtensionElementValue(Of Double)(item, &quot;averageUserRating&quot;) / 2.0, _
    .ReleaseDate = GetExtensionElementValue(Of String)(item, &quot;releaseDate&quot;), _
    .PrimaryImageUrl = Root &amp; &quot;/v3.2/en-US/apps/&quot; &amp; Convert.ToString(id) &amp; &quot;/primaryImage?width=95&amp;height=95&amp;resize=true&quot;, _
    .DisplayPrice = &quot;Unknown&quot; _
}</pre></pre><p><strong>Visual C#</strong></p><pre class="csharpcode"><pre class="brush: csharp">var app = new MarketplaceApp
{
    Id = id,
    AppLink = &quot;http://windowsphone.com/s?appid=&quot; &#43; id,
    Title = item.Title.Text,
    ShortDescription = GetExtensionElementValue&lt;string&gt;(item, &quot;shortDescription&quot;),
    UserRatingCount = GetExtensionElementValue&lt;int&gt;(item, &quot;userRatingCount&quot;),
    Version = GetExtensionElementValue&lt;string&gt;(item, &quot;version&quot;),
    AverageUserRating = GetExtensionElementValue&lt;double&gt;(item, &quot;averageUserRating&quot;) / 2.0,
    ReleaseDate = GetExtensionElementValue&lt;string&gt;(item, &quot;releaseDate&quot;),
    PrimaryImageUrl = Root &#43; &quot;/v3.2/en-US/apps/&quot; &#43; id &#43; &quot;/primaryImage?width=95&amp;height=95&amp;resize=true&quot;
};</pre></pre><p>Where it gets a little bit tricky is the &quot;offers&quot; block.&nbsp; This is an XML block within the overall <em>Item</em> block.&nbsp; This requires that you shift over to an <strong>XmlReader </strong>method of parsing.&nbsp; This works by reading the XML sequentially, stopping at elements of interest.&nbsp; You start by finding the &quot;offers&quot; element, but instead of using the <em>GetObject</em> method, you use <em>GetReader</em>.&nbsp; From there, you use a <em>while</em> loop to visit every node, and grab the value if it's of <em>XmlNodeType.Element</em> and either <em>displayPrice</em> or <em>priceCurrencyCode</em>.</p><p><strong>Visual Basic</strong></p><p>&nbsp;</p><pre class="csharpcode"><pre class="brush: vb">Dim offers = (From ee In item.ElementExtensions Where ee.OuterName = &quot;offers&quot;).FirstOrDefault().GetReader()

' TODO: Restrict to current country's offer
If offers.ReadToFollowing(&quot;offer&quot;) Then
    While offers.Read()
        If offers.NodeType = XmlNodeType.Element Then
            If offers.Name = &quot;displayPrice&quot; Then
                app.DisplayPrice = offers.ReadElementContentAsString()
            ElseIf offers.Name = &quot;priceCurrencyCode&quot; Then
                app.PriceCurrencyCode = offers.ReadElementContentAsString()
            End If
        End If
    End While
End If</pre></pre><p><strong>Visual C#</strong></p><pre class="csharpcode"><pre class="brush: csharp">var offers = item.ElementExtensions.
    Where(ee =&gt; ee.OuterName == &quot;offers&quot;).FirstOrDefault().GetReader();

// TODO: Restrict to current country's offer
if (offers.ReadToFollowing(&quot;offer&quot;))
{
    while(offers.Read())
    {
        if (offers.NodeType == XmlNodeType.Element)
        {
            if (offers.Name == &quot;displayPrice&quot;)
                app.DisplayPrice = offers.ReadElementContentAsString();
            else if (offers.Name == &quot;priceCurrencyCode&quot;)
                app.PriceCurrencyCode = offers.ReadElementContentAsString();
        }
    }
}</pre></pre><p>Notice the &quot;TODO&quot; block.&nbsp; If you are offering your app for sale at different prices in different markets, this will only grab the first offer.&nbsp; Ideally, this should grab the offer for the user's location, but that's another topic!</p><h3>Creating the Control</h3><p>Creating a user control makes it easy to add your list of apps anywhere.&nbsp; I like to add it to a PivotItem in my About page.&nbsp; There are really three things to do:</p><p>&nbsp;</p><ol><li>Download the XML </li><li>Parse the XML into model objects </li><li>Bind the collection of items to a list </li></ol><p>Of course, before you can show anything, you'll want to create a template to serve as the ItemTemplate in the control.&nbsp; This will use databinding to point back at the properties of the marketplace entries to display the name, price, image, etc.&nbsp; This can be created inline within the ListBox markup, or in the UserControl.Resources block (as it is in this case).&nbsp; The root element is a Grid.&nbsp; The Image shows the app's icon, and the StackPanel displays the title, price, and rating information.</p><pre class="csharpcode"><pre class="brush: xml">&lt;DataTemplate x:Key=&quot;AppTemplate&quot;&gt;
    &lt;Grid x:Name=&quot;LayoutRoot&quot; Margin=&quot;0,0,0,4&quot; Width=&quot;450&quot; Background=&quot;Transparent&quot;&gt;
        &lt;Grid.ColumnDefinitions&gt;
            &lt;ColumnDefinition Width=&quot;95&quot;/&gt;
            &lt;ColumnDefinition Width=&quot;1*&quot; /&gt;
        &lt;/Grid.ColumnDefinitions&gt;

        &lt;Image Source=&quot;{Binding PrimaryImageUrl}&quot; Margin=&quot;0,0,20,10&quot; /&gt;
        &lt;StackPanel Grid.Column=&quot;1&quot;&gt;
            &lt;TextBlock Text=&quot;{Binding Title}&quot; /&gt;
            &lt;Controls1:RatingControl Max=&quot;5&quot; Total=&quot;{Binding UserRatingCount}&quot;
Score=&quot;{Binding AverageUserRating}&quot; /&gt;
            &lt;TextBlock Text=&quot;{Binding DisplayPrice}&quot; /&gt;
        &lt;/StackPanel&gt;
    &lt;/Grid&gt;
&lt;/DataTemplate&gt;</pre></pre><p>With the template complete, you just need a ListBox with the ItemTemplate set to the above template.&nbsp;</p><pre class="csharpcode"><pre class="brush: xml">&lt;Grid&gt;
    &lt;ListBox x:Name=&quot;listBox&quot; ItemsSource=&quot;{Binding Apps}&quot;
ItemTemplate=&quot;{StaticResource AppTemplate}&quot;SelectionChanged=&quot;ListBox_SelectionChanged&quot; /&gt;
    &lt;StackPanel x:Name=&quot;LoadingView&quot; HorizontalAlignment=&quot;Center&quot;
VerticalAlignment=&quot;Center&quot;Visibility=&quot;Collapsed&quot;&gt;
        &lt;TextBlock TextWrapping=&quot;Wrap&quot; Text=&quot;Loading list of apps...&quot;
d:LayoutOverrides=&quot;Height&quot;FontWeight=&quot;Black&quot;/&gt;
        &lt;ProgressBar Margin=&quot;0,0,0,6&quot; Height=&quot;5&quot; IsIndeterminate=&quot;True&quot;/&gt;
    &lt;/StackPanel&gt;
    &lt;StackPanel x:Name=&quot;ErrorView&quot; Orientation=&quot;Vertical&quot; VerticalAlignment=&quot;Center&quot;
HorizontalAlignment=&quot;Center&quot; Visibility=&quot;Collapsed&quot;&gt;
        &lt;TextBlock HorizontalAlignment=&quot;Left&quot; TextWrapping=&quot;Wrap&quot;
Text=&quot;Sorry, there was an error reading the list of apps.&quot; FontStyle=&quot;Italic&quot;/&gt;
    &lt;/StackPanel&gt;
&lt;/Grid&gt;</pre></pre><p>The other elements are used to display a loading message and an error message.&nbsp; Switching between the list, loading, or error message is accomplished using VisualStateManager with the &quot;Normal,&quot; &quot;Loading,&quot; or &quot;Error&quot; states accordingly.</p><p>The only other methods needed in the code-behind are to handle selection and caching.&nbsp; When an item is selected, you create a <strong>MarketplaceDetailTask </strong>object, set the <em>ContentIdentifier</em> to the app's unique ID, and call Show().&nbsp; Set the <em>SelectedIndex</em> property back to -1 to prevent a problem where a user can't press the same item twice in the row.</p><p>The caching is important so the app doesn't cause data access on every single visit to the control.&nbsp; It's currently set to reload once per day, but this could be changed (or better yet, made configurable).&nbsp; Even if it's more than a day, if there's an error downloading the data it will always fallback to cache.</p><p><strong>Visual Basic</strong></p><p>&nbsp;</p><pre class="csharpcode"><pre class="brush: vb">Dim items As IEnumerable(Of MarketplaceApp) = Nothing

If IsolatedStorageSettings.ApplicationSettings.Contains(&quot;PublisherAppsControls.Items&quot;) Then
  items = DirectCast(IsolatedStorageSettings.ApplicationSettings( _
    &quot;PublisherAppsControls.Items&quot;), IEnumerable(Of MarketplaceApp)) 
  ' Use the cache if within a day...
  Dim dt = CType(IsolatedStorageSettings.ApplicationSettings( _ 
    &quot;PublisherAppsControls.Items.DateTime&quot;), DateTime)

  If DateTime.Now.Subtract(dt).TotalDays &lt; 1 Then
    ctrl.Apps.Clear()
    For Each i In items
      ctrl.Apps.Add(i)
    Next
    Return
  End If
End If</pre></pre><p><strong>Visual C#</strong></p><pre class="csharpcode"><pre class="brush: csharp">IEnumerable&lt;MarketplaceApp&gt; items = null;

if (IsolatedStorageSettings.ApplicationSettings.Contains(&quot;PublisherAppsControls.Items&quot;))
{
    items = (IEnumerable&lt;MarketplaceApp&gt;)
             IsolatedStorageSettings.ApplicationSettings[&quot;PublisherAppsControls.Items&quot;];
    // Use the cache if within a day...
    var dt = (DateTime)IsolatedStorageSettings.
               ApplicationSettings[&quot;PublisherAppsControls.Items.DateTime&quot;];
    if (DateTime.Now.Subtract(dt).TotalDays &lt; 1)
    {
        ctrl.Apps.Clear();
        foreach (var i in items) ctrl.Apps.Add(i);
        return;
    }
}</pre></pre><h3>Next Steps</h3><p>I haven't tested this app against publishers with large numbers of apps.&nbsp; I'm not sure if they would all come back in the response or if there would be more requests to make.&nbsp; It would also be good to filter out the currently running app.&nbsp; This could be obtained from the WMAppManifest.xml file.&nbsp; As mentioned in the article, it would also be good to restrict the offer to the current country, but I really don't know how to do that without using the location API, which seems too heavy-handed.</p><p>It would be nice to create a general-purpose library for Zune Marketplace data.&nbsp; There are some good starts out there from the likes of Brandon Watson and Jesse Liberty, a CodePlex library, and even another Coding4Fun project, but much of that is based on general catalog data, or specialized for music entries.&nbsp; Even better would be if Microsoft can put out their own API!&nbsp; That would ensure a better experience if/when formats change over time.</p><h3>Conclusion</h3><p>XML has made the world of data so much easier to consume!&nbsp; As soon as I saw structured data as the foundation for Zune I knew this would be a pretty easy project.&nbsp; Being able to advertise all of your apps in each of your apps provides a great way to promote with a minimum of effort.</p><h3>About the Author</h3><p><a href="http://www.ariankulp.com/">Arian Kulp</a> is a software developer living in Western Oregon. He creates samples, screencasts, demos, labs, and articles, speaks at programming events, and enjoys hiking and other outdoor adventures with his family.</p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/user+controls/RSS&WT.dl=0&WT.entryid=Entry:RSSView:f3231d90e6ca4435ade49ff2014347ff">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/articles/Let-your-apps-sell-themselves</comments>
      <itunes:summary>Don&#39;t miss any opportunity to market your Windows Phone apps!&amp;nbsp; Each one of your apps can serve as an ad for your other apps.&amp;nbsp;&amp;nbsp;&amp;nbsp; Learn how to add a listing of everything you have published in Marketplace to each of your apps.&amp;nbsp; Even better, it will always be up to date! IntroductionI&#39;ve written a number of Windows Phone apps, and each time I&#39;ve wanted to let people know about my other apps.&amp;nbsp; While I could mention the other apps somewhere, I wouldn&#39;t want to update all of my apps each time I release a new one.&amp;nbsp; It finally occurred to me that I could use the listing of apps directly from Marketplace instead.&amp;nbsp; This provides me with an easy-to-parse XML feed (Atom) of my apps with all of the info that I need.&amp;nbsp; Armed with that, it wasn&#39;t too much work to create a user control to let me drop in the list of apps anytime I need it. This code doesn&#39;t require a physical phone, but it isn&#39;t very useful if you don&#39;t have a Marketplace account!&amp;nbsp; Ideally, you should have several published apps under your account for this to make much sense.&amp;nbsp; Once you have it in place though, all of your apps will always show your complete list without any special updates. If you don&#39;t have the software installed, go to create.msdn.com, then click Download the free tools to download the Windows Phone Developer Tools (or use the direct download link provided above this Introduction section). This code is written for the Windows Phone Developer Tools 7.1 (Mango).&amp;nbsp; It’s is a mostly online install, and it’s pretty big so expect it to take some time. Even if you don’t have any development tools, this will give you Visual Studio Express, Blend, and XNA Game Studio. If you have the full-version tools already, it will add new templates. Project BasicsThe intention is to create a user control to display a list of apps from a given publisher (preferably yourself!).&amp;nbsp; This user control will be implemented as a ListBox with individual apps showing </itunes:summary>
      <link>http://channel9.msdn.com/coding4fun/articles/Let-your-apps-sell-themselves</link>
      <pubDate>Mon, 13 Feb 2012 22:05:25 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/articles/Let-your-apps-sell-themselves</guid>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/ed932a8a-a783-4663-9c54-8cf9c7cc5575.png" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/1e09ad22-2ccf-48b8-a6e4-54c7d077dff7.png" height="165" width="220"></media:thumbnail>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/efb8601c-2d6d-47f1-9f50-6172395cba27.png" height="240" width="320"></media:thumbnail>      
      <dc:creator>atkulp</dc:creator>
      <itunes:author>atkulp</itunes:author>
      <slash:comments>9</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/coding4fun/articles/Let-your-apps-sell-themselves/RSS</wfw:commentRss>
      <category>Phone 7</category>
      <category>User Controls</category>
      <category>Phone</category>
    </item>
  <item>
      <title>Window Phone 7 Developer Tools + controls!</title>
      <description><![CDATA[
<p>Today the Windows Phone team released the final bits for Windows Phone 7!&nbsp; The tooling is free and will integrate with Visual Studio 2010 and Expression Blend 4 if you have them installed as well.&nbsp; Head over to
<a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=04704acf-a63a-4f97-952c-8b51b34b00ce" title="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=04704acf-a63a-4f97-952c-8b51b34b00ce">
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=04704acf-a63a-4f97-952c-8b51b34b00ce</a> to get the RTM tooling.</p>
<p>Here is also a little list I’ve been keeping with useful controls around the internet!</p>
<table cellpadding="2" cellspacing="0" border="0">
<tbody>
<tr>
<td width="250" valign="top">
<h2>Controls</h2>
</td>
<td width="250" valign="top">
<h2>Random Resources</h2>
</td>
</tr>
<tr>
<td width="250" valign="top">
<p><strong>Silverlight Tool kit <br>
GestureService/GestureListener <br>
ContextMenu <br>
DatePicker <br>
TimePicker <br>
ToggleSwitch <br>
WrapPanel <br>
</strong><a href="http://bit.ly/aBZWSQ">http://bit.ly/aBZWSQ</a> </p>
<p><strong>Wheel Control</strong> <br>
<a href="http://bit.ly/bDcyFL">http://bit.ly/bDcyFL</a> </p>
<p><strong>Swipe Title</strong> <br>
<a href="http://bit.ly/balUu1">http://bit.ly/balUu1</a> </p>
<p><strong>Picker (Combo box) <br>
</strong><a href="http://bit.ly/coyJ1F">http://bit.ly/coyJ1F</a> </p>
<p><strong>Progress Bar <br>
</strong><a href="http://bit.ly/aAWd4K">http://bit.ly/aAWd4K<strong> </strong></a></p>
<p><strong>More Complex splash screen</strong> <br>
<a href="http://bit.ly/bGH93w">http://bit.ly/bGH93w</a> </p>
<p><strong>Touch tilting</strong> <br>
<a href="http://bit.ly/bptbs9">http://bit.ly/bptbs9</a> </p>
<p><strong>Clearable Textbox <br>
</strong><a href="http://bit.ly/csSidM">http://bit.ly/csSidM</a> </p>
<p><strong>Image Caching</strong> <br>
<a href="http://bit.ly/cktA7N">http://bit.ly/cktA7N</a></p>
</td>
<td width="250" valign="top">
<p><strong>Great list of resources <br>
</strong><a href="http://bit.ly/bVvIRn">http://bit.ly/bVvIRn</a> </p>
<p><strong>Detect if a listbox is done scrolling</strong> <br>
<a href="http://bit.ly/b1WfPO">http://bit.ly/b1WfPO</a> </p>
<p><strong>Pass data between pages <br>
</strong><a href="http://bit.ly/akIzLO">http://bit.ly/akIzLO</a> </p>
<p><strong>relative date time converter</strong> <br>
<a href="http://bit.ly/9F0gzP">http://bit.ly/9F0gzP</a> </p>
<p>Phone Styles <br>
accent color would be Style=&quot;{StaticResource PhoneAccentBrush}&quot; <br>
<a href="http://bit.ly/cUmhGi">http://bit.ly/cUmhGi</a></p>
</td>
</tr>
</tbody>
</table>
 <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/user+controls/RSS&WT.dl=0&WT.entryid=Entry:RSSView:ff5ae0ea67b341fda7e29e7600c887e0">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/blog/Window-Phone-7-Developer-Tools--controls</comments>
      <itunes:summary>
Today the Windows Phone team released the final bits for Windows Phone 7!&amp;nbsp; The tooling is free and will integrate with Visual Studio 2010 and Expression Blend 4 if you have them installed as well.&amp;nbsp; Head over to

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=04704acf-a63a-4f97-952c-8b51b34b00ce to get the RTM tooling. 
Here is also a little list I’ve been keeping with useful controls around the internet! 




Controls


Random Resources




Silverlight Tool kit 
GestureService/GestureListener 
ContextMenu 
DatePicker 
TimePicker 
ToggleSwitch 
WrapPanel 
http://bit.ly/aBZWSQ  
Wheel Control 
http://bit.ly/bDcyFL  
Swipe Title 
http://bit.ly/balUu1  
Picker (Combo box) 
http://bit.ly/coyJ1F  
Progress Bar 
http://bit.ly/aAWd4K  
More Complex splash screen 
http://bit.ly/bGH93w  
Touch tilting 
http://bit.ly/bptbs9  
Clearable Textbox 
http://bit.ly/csSidM  
Image Caching 
http://bit.ly/cktA7N 


Great list of resources 
http://bit.ly/bVvIRn  
Detect if a listbox is done scrolling 
http://bit.ly/b1WfPO  
Pass data between pages 
http://bit.ly/akIzLO  
relative date time converter 
http://bit.ly/9F0gzP  
Phone Styles 
accent color would be Style=&amp;quot;{StaticResource PhoneAccentBrush}&amp;quot; 
http://bit.ly/cUmhGi 




</itunes:summary>
      <link>http://channel9.msdn.com/coding4fun/blog/Window-Phone-7-Developer-Tools--controls</link>
      <pubDate>Thu, 16 Sep 2010 14:13:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/blog/Window-Phone-7-Developer-Tools--controls</guid>      
      <dc:creator>Clint Rutkas</dc:creator>
      <itunes:author>Clint Rutkas</itunes:author>
      <slash:comments>0</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/coding4fun/blog/Window-Phone-7-Developer-Tools--controls/RSS</wfw:commentRss>
      <category>Silverlight</category>
      <category>User Controls</category>
      <category>XAML</category>
      <category>XNA</category>
      <category>XNA framework</category>
    </item>
  <item>
      <title>Druckbetankung - Die Show :: Silverlight Teil III</title>
      <description><![CDATA[In Teil 3 unserer Serie &quot;Druckbetankung - Die Show&quot; geht es um Beautifying, Templates, Ressourcen, Styling und Skinning.&nbsp;Oliver Scheer und ich haben in den vorangegegangenen Webcasts bereits eine fertige Anwendung aus Entwicklersicht gebaut, denn alle
 wichtigen Funktionen sind integriert. Aber so richtig benutzbar und schön ist das Ganze noch nicht. Also nochmal ran mit Expression Blend und die Anwendung mit eigens entworfenen&nbsp;Buttons, einem animierten User Control für die Zeit des Nachladens und ein paar
 Farbverläufe sollten auch noch drin sein. Danach sieht die Anwendung aus wie aus dem Ei gepellt, wenn auch stellenweise etwas arg 70er.<br>
Zwischendurch wird auch nochmal der Entwickler in uns gefordert und&nbsp;Visual Studio für die Hintergrund-Logik des User Controls bemüht.
 <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/user+controls/RSS&WT.dl=0&WT.entryid=Entry:RSSView:bfdd654781e8440796059deb016ec1b1">]]></description>
      <comments>http://channel9.msdn.com/Blogs/kitano/Silverlight-Druckbetankung-Die-Show-Teil-III</comments>
      <itunes:summary>In Teil 3 unserer Serie &amp;quot;Druckbetankung - Die Show&amp;quot; geht es um Beautifying, Templates, Ressourcen, Styling und Skinning.&amp;nbsp;Oliver Scheer und ich haben in den vorangegegangenen Webcasts bereits eine fertige Anwendung aus Entwicklersicht gebaut, denn alle
 wichtigen Funktionen sind integriert. Aber so richtig benutzbar und sch&#246;n ist das Ganze noch nicht. Also nochmal ran mit Expression Blend und die Anwendung mit eigens entworfenen&amp;nbsp;Buttons, einem animierten User Control f&#252;r die Zeit des Nachladens und ein paar
 Farbverl&#228;ufe sollten auch noch drin sein. Danach sieht die Anwendung aus wie aus dem Ei gepellt, wenn auch stellenweise etwas arg 70er.
Zwischendurch wird auch nochmal der Entwickler in uns gefordert und&amp;nbsp;Visual Studio f&#252;r die Hintergrund-Logik des User Controls bem&#252;ht.
</itunes:summary>
      <itunes:duration>3529</itunes:duration>
      <link>http://channel9.msdn.com/Blogs/kitano/Silverlight-Druckbetankung-Die-Show-Teil-III</link>
      <pubDate>Fri, 08 May 2009 06:58:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/kitano/Silverlight-Druckbetankung-Die-Show-Teil-III</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/100/466867_100x75.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/220/466867_220x165.jpg" height="165" width="220"></media:thumbnail>
      <media:thumbnail url="http://mschnlnine.vo.llnwd.net/d1/ch9/7/6/8/6/6/4/DruckbetankungSilverlightTeil3_large_ch9.png" height="240" width="320"></media:thumbnail>
      <media:thumbnail url="http://mschnlnine.vo.llnwd.net/d1/ch9/7/6/8/6/6/4/DruckbetankungSilverlightTeil3_small_ch9.png" height="64" width="85"></media:thumbnail>
      <media:group>
        <media:content url="http://mschnlnine.vo.llnwd.net/d1/ch9/7/6/8/6/6/4/DruckbetankungSilverlightTeil3_2MB_ch9.wmv" expression="full" duration="3529" fileSize="163834048" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://mschnlnine.vo.llnwd.net/d1/ch9/7/6/8/6/6/4/DruckbetankungSilverlightTeil3_ch9.mp3" expression="full" duration="3529" fileSize="28234219" type="audio/mp3" medium="audio"></media:content>
        <media:content url="http://mschnlnine.vo.llnwd.net/d1/ch9/7/6/8/6/6/4/DruckbetankungSilverlightTeil3_ch9.mp4" expression="full" duration="3529" fileSize="129463240" type="video/mp4" medium="video"></media:content>
        <media:content url="http://mschnlnine.vo.llnwd.net/d1/ch9/7/6/8/6/6/4/DruckbetankungSilverlightTeil3_ch9.wma" expression="full" duration="3529" fileSize="57096009" type="audio/x-ms-wma" medium="audio"></media:content>
        <media:content url="http://mschnlnine.vo.llnwd.net/d1/ch9/7/6/8/6/6/4/DruckbetankungSilverlightTeil3_ch9.wmv" expression="full" duration="3529" fileSize="135866617" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://mschnlnine.vo.llnwd.net/d1/ch9/7/6/8/6/6/4/DruckbetankungSilverlightTeil3_Zune_ch9.wmv" expression="full" duration="3529" fileSize="132058597" type="video/x-ms-wmv" medium="video"></media:content>
      </media:group>      
      <enclosure url="http://mschnlnine.vo.llnwd.net/d1/ch9/7/6/8/6/6/4/DruckbetankungSilverlightTeil3_ch9.wmv" length="135866617" type="video/x-ms-wmv"></enclosure>
      <dc:creator>Jan Schenk</dc:creator>
      <itunes:author>Jan Schenk</itunes:author>
      <slash:comments>0</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/kitano/Silverlight-Druckbetankung-Die-Show-Teil-III/RSS</wfw:commentRss>
      <category>Beautifying</category>
      <category>Buttons</category>
      <category>de-de</category>
      <category>Druckbetankung</category>
      <category>Expression Blend</category>
      <category>Silverlight</category>
      <category>Skinning</category>
      <category>Styling</category>
      <category>User Controls</category>
      <category>Visual Studio</category>
    </item>
  <item>
      <title>ASP.NET Codeclip - User Controls, oder &quot;Ade Includes&quot;!</title>
      <description><![CDATA[Mit User Controls kann man den klassischen Includes getrost Ade sagen, denn User Controls können alles, was das Herz begehrt. Mehrfach autark&nbsp;innerhalb einer Seite verwendbar, steuerbar und anpassbar, bei Bedarf zur Laufzeit und aus der integrierenden
 Seite heraus. <br>
<br>
Im Video findet ihr ein Beispiel zur Verwendung von User Controls, viel Spass damit, nachmachen erlaubt. Aber ich erwarte natürlich, dass ihr das besser und sinnvoller einsetzt als ich <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-5.gif' alt='Wink' /><br>
<br>
Codesnippets findet ihr auf meinem Blog unter:<br>
(kommt gleich)<br>
<br>
Viele Grüße,<br>
jan  <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/user+controls/RSS&WT.dl=0&WT.entryid=Entry:RSSView:b0199785e51a4f3f89c49deb016ee9b8">]]></description>
      <comments>http://channel9.msdn.com/Blogs/kitano/ASPNET-Codeclip-User-Controls-oder-Ade-Includes</comments>
      <itunes:summary>Mit User Controls kann man den klassischen Includes getrost Ade sagen, denn User Controls k&#246;nnen alles, was das Herz begehrt. Mehrfach autark&amp;nbsp;innerhalb einer Seite verwendbar, steuerbar und anpassbar, bei Bedarf zur Laufzeit und aus der integrierenden
 Seite heraus. 

Im Video findet ihr ein Beispiel zur Verwendung von User Controls, viel Spass damit, nachmachen erlaubt. Aber ich erwarte nat&#252;rlich, dass ihr das besser und sinnvoller einsetzt als ich 

Codesnippets findet ihr auf meinem Blog unter:
(kommt gleich)

Viele Gr&#252;&#223;e,
jan </itunes:summary>
      <itunes:duration>452</itunes:duration>
      <link>http://channel9.msdn.com/Blogs/kitano/ASPNET-Codeclip-User-Controls-oder-Ade-Includes</link>
      <pubDate>Tue, 03 Feb 2009 18:37:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/kitano/ASPNET-Codeclip-User-Controls-oder-Ade-Includes</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/100/455622_100x75.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/220/455622_220x165.jpg" height="165" width="220"></media:thumbnail>
      <media:thumbnail url="http://mschnlnine.vo.llnwd.net/d1/ch9/2/2/6/5/5/4/ASPNETUserControls_large_ch9.jpg" height="240" width="320"></media:thumbnail>
      <media:thumbnail url="http://mschnlnine.vo.llnwd.net/d1/ch9/2/2/6/5/5/4/ASPNETUserControls_small_ch9.jpg" height="64" width="85"></media:thumbnail>
      <media:group>
        <media:content url="http://mschnlnine.vo.llnwd.net/d1/ch9/2/2/6/5/5/4/ASPNETUserControls_2MB_ch9.wmv" expression="full" duration="452" fileSize="8832627" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://mschnlnine.vo.llnwd.net/d1/ch9/2/2/6/5/5/4/ASPNETUserControls_ch9.mp4" expression="full" duration="452" fileSize="11886086" type="video/mp4" medium="video"></media:content>
        <media:content url="http://mschnlnine.vo.llnwd.net/d1/ch9/2/2/6/5/5/4/ASPNETUserControls_ch9.wma" expression="full" duration="452" fileSize="7331743" type="audio/x-ms-wma" medium="audio"></media:content>
        <media:content url="http://mschnlnine.vo.llnwd.net/d1/ch9/2/2/6/5/5/4/ASPNETUserControls_ch9.wmv" expression="full" duration="452" fileSize="11176153" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://mschnlnine.vo.llnwd.net/d1/ch9/2/2/6/5/5/4/ASPNETUserControls_Zune_ch9.wmv" expression="full" duration="452" fileSize="9912133" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="mms://mschnlnine.wmod.llnwd.net/a1809/d1/ch9/2/2/6/5/5/4/ASPNETUserControls_s_ch9.wmv" expression="full" duration="452" fileSize="216" type="video/x-ms-wmv" medium="video"></media:content>
      </media:group>      
      <enclosure url="http://mschnlnine.vo.llnwd.net/d1/ch9/2/2/6/5/5/4/ASPNETUserControls_ch9.wmv" length="11176153" type="video/x-ms-wmv"></enclosure>
      <dc:creator>Jan Schenk</dc:creator>
      <itunes:author>Jan Schenk</itunes:author>
      <slash:comments>1</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/kitano/ASPNET-Codeclip-User-Controls-oder-Ade-Includes/RSS</wfw:commentRss>
      <category>ASP.NET</category>
      <category>Controls</category>
      <category>de-de</category>
      <category>Include</category>
      <category>User Controls</category>
    </item>    
</channel>
</rss>