<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" 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:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>Andrej Tozon's blog</title>
    <description>In the Attic</description>
    <link>http://www.tozon.info/blog/</link>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>BlogEngine.NET 2.0.0.36</generator>
    <language>en-GB</language>
    <blogChannel:blogRoll>http://www.tozon.info/blog/opml.axd</blogChannel:blogRoll>
    <blogChannel:blink>http://www.dotnetblogengine.net/syndication.axd</blogChannel:blink>
    <dc:creator>Andrej Tozon</dc:creator>
    <dc:title>Andrej Tozon's blog</dc:title>
    <geo:lat>0.000000</geo:lat>
    <geo:long>0.000000</geo:long>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/TheAttic" /><feedburner:info uri="theattic" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><geo:lat>46.106922</geo:lat><geo:long>14.526415</geo:long><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2FTheAttic" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FTheAttic" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/TheAttic" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FTheAttic" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FTheAttic" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FTheAttic" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:feedFlare href="http://www.live.com/?add=http%3A%2F%2Ffeeds.feedburner.com%2FTheAttic" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><feedburner:browserFriendly>This is an XML content feed. It is intended to be viewed in a newsreader or syndicated to another site.</feedburner:browserFriendly><item>
      <title>Announcing a new user group</title>
      <description>&lt;div id="AdnTop"&gt;&lt;div class="AdnTopLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnTopRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Dear Slovenian developers and UI enthusiasts, mark your calendars for 8th of November 2011 as that’s the day we’re launching a new user group targeting the UI/UX professionals.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;a href="http://tozon.info/images/blog/0d42b2c73deb_34/SIUX-Logo.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top: 0px; border-right: 0px; padding-top: 0px" title="SIUX Logo" border="0" alt="SIUX Logo" align="left" src="http://tozon.info/images/blog/0d42b2c73deb_34/SIUX-Logo_thumb.png" width="100" height="100" /&gt;&lt;/a&gt;SIUX – Slovenian UX User Group&lt;/strong&gt; – a sister user group (or a Siamese twin group as we fondly call it &lt;img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://tozon.info/images/blog/0d42b2c73deb_34/wlEmoticon-smile.png" /&gt;) of now years-running SLODUG, Slovenian Developers User Group (SLODUG), where we’ll focus on technologies and areas like WPF, Silverlight, HTML5, Kinect, Windows Phone, Windows 8; talk through their visual and interaction design aspects; explore user interface examples, usability and related factors.&lt;/p&gt;  &lt;p&gt;SLODUG and SIUX will share their members and meeting place. As mentioned, the first, inaugural meeting, will take place on &lt;strong&gt;Tuesday, 8th of November 2011&lt;/strong&gt;, starting at 17h. Two talks are scheduled for the meeting: &lt;strong&gt;Developing for XBox Kinect&lt;/strong&gt; by Sašo Zagoranski and &lt;strong&gt;Metro: the UI of the future?&lt;/strong&gt;&amp;#160; by me. The meeting will take place in Microsoft Lecture room at Šmartinska 140.&lt;/p&gt;  &lt;p&gt;Full agenda:&lt;/p&gt;  &lt;p&gt;17:00: Intro &amp;amp; announcements   &lt;br /&gt;17:15 – 18:00: &lt;strong&gt;Developing for XBox Kinect&lt;/strong&gt;, Sašo Zagoranski / Semantika d.o.o.    &lt;br /&gt;18:15 – 19:00: &lt;strong&gt;Metro: UI of the future?&lt;/strong&gt;, Andrej Tozon / ANT Andrej Tozon s.p.    &lt;br /&gt;19:00: Discussion over pizza &amp;amp;&amp;#160; beer&lt;/p&gt;  &lt;p&gt;We’re also looking for speakers – if you’re interested or&amp;#160; know anybody from the field, please contact me and we’re schedule your talk in one of our next meetings.&lt;/p&gt;  &lt;p&gt;Hope to see you!&lt;/p&gt;  &lt;p&gt;Until then, you can &lt;a href="https://twitter.com/#!/siux_ug" target="_blank"&gt;follow us on Twitter&lt;/a&gt; or join our &lt;a href="https://www.facebook.com/groups/siux.ug/" target="_blank"&gt;Facebook group&lt;/a&gt;.&lt;/p&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt; tweetmeme_url = 'http://tozon.info/blog/post/2011/10/28/Announcing-a-new-user-group.aspx'; tweetmeme_source = 'andrejt'; &lt;/script&gt; &lt;script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;div id="AdnBottom"&gt;&lt;div class="AdnBottomLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnBottomRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=MxySoaoMhNs:mxnm63gIOjE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=MxySoaoMhNs:mxnm63gIOjE:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=MxySoaoMhNs:mxnm63gIOjE:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=MxySoaoMhNs:mxnm63gIOjE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=MxySoaoMhNs:mxnm63gIOjE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=MxySoaoMhNs:mxnm63gIOjE:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=MxySoaoMhNs:mxnm63gIOjE:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=MxySoaoMhNs:mxnm63gIOjE:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=MxySoaoMhNs:mxnm63gIOjE:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=MxySoaoMhNs:mxnm63gIOjE:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=MxySoaoMhNs:mxnm63gIOjE:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=MxySoaoMhNs:mxnm63gIOjE:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=MxySoaoMhNs:mxnm63gIOjE:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=MxySoaoMhNs:mxnm63gIOjE:V-t1I-SPZMU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=V-t1I-SPZMU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=MxySoaoMhNs:mxnm63gIOjE:Jwdi1b3fU3Q"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=Jwdi1b3fU3Q" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TheAttic/~4/MxySoaoMhNs" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheAttic/~3/MxySoaoMhNs/post.aspx</link>
      <comments>http://www.tozon.info/blog/post/2011/10/28/Announcing-a-new-user-group.aspx#comment</comments>
      <guid isPermaLink="false">http://www.tozon.info/blog/post.aspx?id=760f9871-6fd7-45cb-be53-261adcf6898c</guid>
      <pubDate>Fri, 28 Oct 2011 11:06:56 +0100</pubDate>
      <category>Community</category>
      <category>User Experience</category>
      <category>Windows 8</category>
      <category>Software</category>
      <category>Silverlight</category>
      <category>WinRT</category>
      <category>WPF</category>
      <category>WP7</category>
      <category>Tech</category>
      <category>Talks</category>
      <category>Metro</category>
      <category>General</category>
      <dc:publisher>andrej</dc:publisher>
      <pingback:server>http://www.tozon.info/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.tozon.info/blog/post.aspx?id=760f9871-6fd7-45cb-be53-261adcf6898c</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.tozon.info/blog/trackback.axd?id=760f9871-6fd7-45cb-be53-261adcf6898c</trackback:ping>
      <wfw:comment>http://www.tozon.info/blog/post/2011/10/28/Announcing-a-new-user-group.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.tozon.info/blog/syndication.axd?post=760f9871-6fd7-45cb-be53-261adcf6898c</wfw:commentRss>
    <feedburner:origLink>http://www.tozon.info/blog/post.aspx?id=760f9871-6fd7-45cb-be53-261adcf6898c</feedburner:origLink></item>
    <item>
      <title>New Windows Phone App: MapSnapper</title>
      <description>&lt;div id="AdnTop"&gt;&lt;div class="AdnTopLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnTopRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;My latest Windows Phone application was published to the marketplace a few days ago:&lt;/p&gt;  &lt;p&gt;MapSnapper is a simple utility application that utilizes static Bing maps feature to capture a favorite piece of Earth with your Windows Phone.&lt;/p&gt;  &lt;p&gt;In its essence, the application lets you navigate a map of the world, using aerial or roads view, zoom in and out until you find&amp;#160; that perfect place you wanted to take a snap of. After taking a snap, the application serves you with not a bitmap image of the snapped location, but the link to a static Bing image that will correspond to the specific view you were looking at when taking a snap. You can specify the dimensions of the final snap and share the link through the email.&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://tozon.info/images/blog/New-Windows-Phone-App-MapSnapper_140EF/MapSnapper_10-10-2011_9.27.36.416.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="MapSnapper_10-10-2011_9.27.36.416" border="0" alt="MapSnapper_10-10-2011_9.27.36.416" src="http://tozon.info/images/blog/New-Windows-Phone-App-MapSnapper_140EF/MapSnapper_10-10-2011_9.27.36.416_thumb.png" width="292" height="484" /&gt;&lt;/a&gt;&amp;#160;&amp;#160; &lt;a href="http://tozon.info/images/blog/New-Windows-Phone-App-MapSnapper_140EF/MapSnapper_10-10-2011_9.27.47.822.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="MapSnapper_10-10-2011_9.27.47.822" border="0" alt="MapSnapper_10-10-2011_9.27.47.822" src="http://tozon.info/images/blog/New-Windows-Phone-App-MapSnapper_140EF/MapSnapper_10-10-2011_9.27.47.822_thumb.png" width="292" height="484" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I developed the application because I needed to get to a number of specific links to certain Bing static images for some other application I’m doing. This application helped me a lot so I decided to make it public. It’s free and you can download it from the Windows Phone marketplace right now!&lt;/p&gt;  &lt;p&gt;&lt;a href="https://www.windowsphone.com/en-US/apps/5603e03f-d397-4907-92a0-f6bf5ae839be/ValidatePurchase/a0784a4f-7df0-476f-a059-4b49b6d17b50?appType=Regular&amp;amp;purchaseFlowStart=App" target="_blank"&gt;&lt;img style="display: inline; float: left" align="left" src="http://catalog.zune.net/v3.2/en-US/apps/5603e03f-d397-4907-92a0-f6bf5ae839be/primaryImage?width=100&amp;amp;height=100&amp;amp;resize=true" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160; &lt;a href="https://www.windowsphone.com/en-US/apps/5603e03f-d397-4907-92a0-f6bf5ae839be/ValidatePurchase/a0784a4f-7df0-476f-a059-4b49b6d17b50?appType=Regular&amp;amp;purchaseFlowStart=App" target="_blank"&gt;Get MapSnapper&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;&amp;#160;&lt;/p&gt;      &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Please let me know if you find the application useful.&lt;/p&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt; tweetmeme_url = 'http://tozon.info/blog/post/2011/10/25/New-Windows-Phone-App-MapSnapper.aspx'; tweetmeme_source = 'andrejt'; &lt;/script&gt; &lt;script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;div id="AdnBottom"&gt;&lt;div class="AdnBottomLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnBottomRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=3JQB_vCX7es:tdzhGqD0UCs:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=3JQB_vCX7es:tdzhGqD0UCs:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=3JQB_vCX7es:tdzhGqD0UCs:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=3JQB_vCX7es:tdzhGqD0UCs:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=3JQB_vCX7es:tdzhGqD0UCs:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=3JQB_vCX7es:tdzhGqD0UCs:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=3JQB_vCX7es:tdzhGqD0UCs:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=3JQB_vCX7es:tdzhGqD0UCs:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=3JQB_vCX7es:tdzhGqD0UCs:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=3JQB_vCX7es:tdzhGqD0UCs:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=3JQB_vCX7es:tdzhGqD0UCs:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=3JQB_vCX7es:tdzhGqD0UCs:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=3JQB_vCX7es:tdzhGqD0UCs:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=3JQB_vCX7es:tdzhGqD0UCs:V-t1I-SPZMU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=V-t1I-SPZMU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=3JQB_vCX7es:tdzhGqD0UCs:Jwdi1b3fU3Q"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=Jwdi1b3fU3Q" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TheAttic/~4/3JQB_vCX7es" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheAttic/~3/3JQB_vCX7es/post.aspx</link>
      <comments>http://www.tozon.info/blog/post/2011/10/25/New-Windows-Phone-App-MapSnapper.aspx#comment</comments>
      <guid isPermaLink="false">http://www.tozon.info/blog/post.aspx?id=1c85c5d3-e42b-4648-b97b-465abf53dea1</guid>
      <pubDate>Tue, 25 Oct 2011 22:05:30 +0100</pubDate>
      <category>Development</category>
      <category>Community</category>
      <category>Software</category>
      <category>WP7</category>
      <dc:publisher>andrej</dc:publisher>
      <pingback:server>http://www.tozon.info/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.tozon.info/blog/post.aspx?id=1c85c5d3-e42b-4648-b97b-465abf53dea1</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.tozon.info/blog/trackback.axd?id=1c85c5d3-e42b-4648-b97b-465abf53dea1</trackback:ping>
      <wfw:comment>http://www.tozon.info/blog/post/2011/10/25/New-Windows-Phone-App-MapSnapper.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.tozon.info/blog/syndication.axd?post=1c85c5d3-e42b-4648-b97b-465abf53dea1</wfw:commentRss>
    <feedburner:origLink>http://www.tozon.info/blog/post.aspx?id=1c85c5d3-e42b-4648-b97b-465abf53dea1</feedburner:origLink></item>
    <item>
      <title>Windows 8 Metro declarations: User Tile Provider</title>
      <description>&lt;div id="AdnTop"&gt;&lt;div class="AdnTopLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnTopRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;This blog post is part of my Windows 8 metro-style application declarations series. Read more about declarations in the &lt;a href="http://tozon.info/blog/post/2011/09/30/Windows-8-Metro-style-application-manifest.aspx" target="_blank"&gt;introductory post&lt;/a&gt; about application manifest.&lt;/p&gt;  &lt;p&gt;User Tile Provider declaration allows you to register your application as a user tile provider. That means that user will be able to use your application to change her user tile.&lt;/p&gt;  &lt;p&gt;One of many ways of changing the user tile can is by clicking your personal tile (avatar) on Windows 8 Start screen – four options are currently displayed, one of them is “Change user tile”:&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://tozon.info/images/blog/fa88d23fdb4c_98B1/image.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/fa88d23fdb4c_98B1/image_thumb.png" width="392" height="350" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Selecting the first option will take you to Control Panel’s Personalize page, set on User Tile:&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://tozon.info/images/blog/fa88d23fdb4c_98B1/image_3.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/fa88d23fdb4c_98B1/image_thumb_3.png" width="600" height="338" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="left"&gt;2 options for changing the tile already available: the user can browse through her pictures and select the one that she likes or she can take a new one with the help of her web cam.&lt;/p&gt;  &lt;h2 align="left"&gt;Your own application as a user tile provider&lt;/h2&gt;  &lt;p align="left"&gt;As with other declarations, you declare your application as a user tile provider in the application manifest. The easiest way to do that is through the manifest editor. You’ll see that when you add the &lt;em&gt;User Tile &lt;/em&gt;&lt;em&gt;Provider&lt;/em&gt; declaration to the &lt;em&gt;Supported Declarations&lt;/em&gt; list, there are no declaration specific options to be set.&lt;/p&gt;  &lt;p align="left"&gt;&lt;a href="http://tozon.info/images/blog/fa88d23fdb4c_98B1/image_4.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/fa88d23fdb4c_98B1/image_thumb_4.png" width="600" height="352" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="left"&gt;That’s good. After setting the declaration, run or just deploy your application and return to the Control Panel. You should now be looking at something like this:&lt;/p&gt;  &lt;p align="left"&gt;&lt;a href="http://tozon.info/images/blog/fa88d23fdb4c_98B1/image_5.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/fa88d23fdb4c_98B1/image_thumb_5.png" width="600" height="440" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="left"&gt;Your application is now registered as the &lt;em&gt;official&lt;/em&gt; user tile provider and by clicking on the application tile it will be launched. &lt;/p&gt;  &lt;p align="left"&gt;And fail. &lt;/p&gt;  &lt;p align="left"&gt;Of course, there is some wiring you have to do in your code to make this work properly.&lt;/p&gt;  &lt;h2 align="left"&gt;Wiring the application logic&lt;/h2&gt;  &lt;p align="left"&gt;There isn’t a special kind of activation reserved for this type of activation, it’s activated through the special Protocol activation - &lt;a href="http://tozon.info/blog/post/2011/10/06/Windows-8-Metro-declarations-Protocol.aspx" target="_blank"&gt;I covered Protocol activation before&lt;/a&gt; – if you set up Protocol activation as described in that blog post, you can check for specific protocol in the &lt;em&gt;OnProtocolActivated&lt;/em&gt; handler; you’ll see that Uri, passed in through provided arguments, looks something like &lt;em&gt;UserTileProvider://&lt;/em&gt;, so you just have to check for a particular protocol to see how or why your application was invoked:&lt;/p&gt;  &lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;private void OnProtocolActivated(ProtocolActivatedEventArgs args)
{
    if (args.Uri.Scheme == &amp;quot;usertileprovider&amp;quot;)
    {
        PhotoView page = new PhotoView();
        page.SetProfileImage();
        Window.Current.Content = page;
        Window.Current.Activate();
        return;
    }

    // ... other protocol handlers
}&lt;/pre&gt;

&lt;p&gt;Here I’m bringing up a new PhotoView page (also discussed in &lt;a href="http://tozon.info/blog/post/2011/10/11/Windows-8-Metro-declarations-File-Type-Associations.aspx" target="_blank"&gt;my previous blog post&lt;/a&gt;) whenever my application is invoked for choosing a user tile.&lt;/p&gt;

&lt;h2&gt;Changing the user tile&lt;/h2&gt;

&lt;p align="left"&gt;OK, so application now responds to the user tile change call. But how do we actually change the tile? Well, there’s an API for that. You can get and set current user tile through asynchronous &lt;strong&gt;GetUserImageAsync() &lt;/strong&gt;and &lt;strong&gt;SetUserImageAsync()&lt;/strong&gt; methods of the &lt;strong&gt;UserInformation&lt;/strong&gt; object.&lt;/p&gt;

&lt;p align="left"&gt;In my demo application, I get the user tile from her profile, rotate it by 90° and display it to the user:&lt;/p&gt;

&lt;p align="left"&gt;&lt;a href="http://tozon.info/images/blog/fa88d23fdb4c_98B1/image_6.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/fa88d23fdb4c_98B1/image_thumb_6.png" width="300" height="180" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p align="left"&gt;After user taps (selects) the image, she is first prompted for confirmation:&lt;/p&gt;

&lt;p align="left"&gt;&lt;a href="http://tozon.info/images/blog/fa88d23fdb4c_98B1/image_7.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/fa88d23fdb4c_98B1/image_thumb_7.png" width="604" height="264" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p align="left"&gt;And if user confirms that (she can opt out by clicking somewhere outside of the dialog), the new image is set as her new user tile.&lt;/p&gt;

&lt;p align="left"&gt;&lt;a href="http://tozon.info/images/blog/fa88d23fdb4c_98B1/image_8.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/fa88d23fdb4c_98B1/image_thumb_8.png" width="600" height="428" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p align="left"&gt;&lt;em&gt;&lt;strong&gt;Quick tip&lt;/strong&gt;: if you're using your Windows Live ID as your Windows 8 login, changing your user tile will change your general Windows Live display picture as well (in Windows Live Messenger, Live Profile, etc.)&lt;/em&gt;&lt;/p&gt;

&lt;p align="left"&gt;The code for dealing with images is a bit messy – I got it working but I suspect this will get easier as we progress towards the final runtime bits:&lt;/p&gt;

&lt;p align="left"&gt;&lt;strong&gt;Read the user tile&lt;/strong&gt;, rotate it by 90° and set as the Image source:&lt;/p&gt;

&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;public async void SetProfileImage()
{
    StorageFile file = UserInformation.GetUserImage(UserImageKind.LargeBitmap);
    BitmapDecoder decoder = await BitmapDecoder.CreateAsync(await file.OpenAsync(FileAccessMode.Read));
    BitmapTransform transform = new BitmapTransform();
    transform.Rotation = BitmapRotation.Clockwise90Degrees;
    PixelDataProvider pixelData = await decoder.GetPixelDataAsync(BitmapPixelFormat.Rgba8, decoder.BitmapAlphaMode, transform, ExifOrientationMode.RespectExifOrientation, ColorManagementMode.DoNotColorManage);
    WriteableBitmap bitmap = new WriteableBitmap((int)decoder.PixelWidth, (int)decoder.PixelHeight);
    pixelStream = bitmap.PixelBuffer.AsStream();
    pixelStream.Seek(0, SeekOrigin.Begin);
    pixelBuffer = pixelData.DetachPixelData();
    pixelStream.Write(pixelBuffer, 0, (int)pixelStream.Length);
    bitmap.Invalidate();

    Viewer.Source = bitmap;
}&lt;/pre&gt;

&lt;p&gt;Get the image from Image source, save it to a temporary file, &lt;strong&gt;set the user tile&lt;/strong&gt; and delete the temporary file:&lt;/p&gt;

&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;private async void SetUserTile()
{
    WriteableBitmap bitmap = Viewer.Source as WriteableBitmap;

    StorageFile file = await Windows.Storage.ApplicationData.Current.TemporaryFolder.CreateFileAsync(&amp;quot;temp&amp;quot;);
    BitmapEncoder encoder = await BitmapEncoder.CreateAsync(BitmapEncoder.PngEncoderId, await file.OpenAsync(FileAccessMode.ReadWrite));
    encoder.SetPixelData(BitmapPixelFormat.Rgba8, BitmapAlphaMode.Straight, (uint)bitmap.PixelWidth, (uint)bitmap.PixelHeight, 72.0, 72.0, pixelBuffer);
    await encoder.FlushAsync();
    await Windows.System.UserProfile.UserInformation.SetUserImageAsync(file);
    await file.DeleteAsync();
}&lt;/pre&gt;

&lt;p align="left"&gt;Noticed a lot of asynchronous / await calls? Plenty of those in WinRT &lt;img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-winkingsmile" alt="Winking smile" src="http://tozon.info/images/blog/fa88d23fdb4c_98B1/wlEmoticon-winkingsmile.png" /&gt;&lt;/p&gt;

&lt;p align="left"&gt;There’s still many quirks and missing bits around the User Tile Provider declaration implementation, it’s obviously not complete yet. But the ability to provide users with your own application to change their user tiles just feels overwhelming. I bet we’ll get some pretty creative applications in this space when Windows 8 marketplace ships.&lt;/p&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt; tweetmeme_url = 'http://tozon.info/blog/post/2011/10/18/Windows-8-Metro-declarations-User-Tile-Provider.aspx'; tweetmeme_source = 'andrejt'; &lt;/script&gt; &lt;script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;div id="AdnBottom"&gt;&lt;div class="AdnBottomLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnBottomRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=uLsAYoIl0F8:LJWq0Ap7HhA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=uLsAYoIl0F8:LJWq0Ap7HhA:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=uLsAYoIl0F8:LJWq0Ap7HhA:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=uLsAYoIl0F8:LJWq0Ap7HhA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=uLsAYoIl0F8:LJWq0Ap7HhA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=uLsAYoIl0F8:LJWq0Ap7HhA:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=uLsAYoIl0F8:LJWq0Ap7HhA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=uLsAYoIl0F8:LJWq0Ap7HhA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=uLsAYoIl0F8:LJWq0Ap7HhA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=uLsAYoIl0F8:LJWq0Ap7HhA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=uLsAYoIl0F8:LJWq0Ap7HhA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=uLsAYoIl0F8:LJWq0Ap7HhA:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=uLsAYoIl0F8:LJWq0Ap7HhA:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=uLsAYoIl0F8:LJWq0Ap7HhA:V-t1I-SPZMU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=V-t1I-SPZMU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=uLsAYoIl0F8:LJWq0Ap7HhA:Jwdi1b3fU3Q"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=Jwdi1b3fU3Q" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TheAttic/~4/uLsAYoIl0F8" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheAttic/~3/uLsAYoIl0F8/post.aspx</link>
      <comments>http://www.tozon.info/blog/post/2011/10/18/Windows-8-Metro-declarations-User-Tile-Provider.aspx#comment</comments>
      <guid isPermaLink="false">http://www.tozon.info/blog/post.aspx?id=4ab35b24-17c9-426c-aeed-6baa69a31af4</guid>
      <pubDate>Tue, 18 Oct 2011 11:51:29 +0100</pubDate>
      <category>Development</category>
      <category>Metro</category>
      <category>User Experience</category>
      <category>WinRT</category>
      <category>Windows 8</category>
      <dc:publisher>andrej</dc:publisher>
      <pingback:server>http://www.tozon.info/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.tozon.info/blog/post.aspx?id=4ab35b24-17c9-426c-aeed-6baa69a31af4</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.tozon.info/blog/trackback.axd?id=4ab35b24-17c9-426c-aeed-6baa69a31af4</trackback:ping>
      <wfw:comment>http://www.tozon.info/blog/post/2011/10/18/Windows-8-Metro-declarations-User-Tile-Provider.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.tozon.info/blog/syndication.axd?post=4ab35b24-17c9-426c-aeed-6baa69a31af4</wfw:commentRss>
    <feedburner:origLink>http://www.tozon.info/blog/post.aspx?id=4ab35b24-17c9-426c-aeed-6baa69a31af4</feedburner:origLink></item>
    <item>
      <title>Windows 8 Metro declarations: File Type Associations</title>
      <description>&lt;div id="AdnTop"&gt;&lt;div class="AdnTopLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnTopRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;This blog post is part of my Windows 8 metro-style application declarations series. Read more about declarations in the &lt;a href="http://tozon.info/blog/post/2011/09/30/Windows-8-Metro-style-application-manifest.aspx" target="_blank"&gt;introductory post&lt;/a&gt; about application manifest.&lt;/p&gt;  &lt;p&gt;File Type Associations Declaration is very similar to &lt;a href="http://tozon.info/blog/post/2011/10/06/Windows-8-Metro-declarations-Protocol.aspx" target="_blank"&gt;Protocol Declaration&lt;/a&gt;. Similar in a way that it defines an OS-wide declaration that’s used to launch your application. What this declaration does should be familiar to most Windows users as it’s been a part of the system from the very beginning.&lt;/p&gt;  &lt;p&gt;Every file extension can be associated with a particular application that can handle the content of such file. Most text editors, for example, know how to handle files with .txt extension , file formats like .jpg, .png, and .bmp, are handled by graphics applications like Paint or PhotoShop, etc.&lt;/p&gt;  &lt;p&gt;File Type Associations Declaration lets you declare specific file extension(s) that your application will be able to handle. It can be an existing, well-known extension such as .txt, or you can come up with your very own extension and/or file format and register that. For this example, I’ll declare two extensions – &lt;strong&gt;.jpg&lt;/strong&gt; (well-known graphics format extension, and &lt;strong&gt;.jpgx&lt;/strong&gt; – a made up extension that will serve just as an example for this blog post) - my sample application will display the same photo viewer for both extensions.&lt;/p&gt;  &lt;h2&gt;Setting up the photo viewer page&lt;/h2&gt;  &lt;p&gt;I’ve created a new blank page in my application and put the &lt;em&gt;Image&lt;/em&gt; control on it. That’ll serve as my simple photo viewer.&lt;/p&gt;  &lt;p&gt;I’ve also added a method that will help me set the image. The method takes a parameter of type &lt;strong&gt;StorageFile&lt;/strong&gt;, which is a new class in windows runtime that takes care of wrapping file info and does basic file manipulation.&lt;/p&gt;  &lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;public async void SetPhoto(StorageFile storageFile)
{
    BitmapImage image = new BitmapImage();
    IRandomAccessStream stream = await storageFile.OpenAsync(FileAccessMode.Read);
    image.SetSource(stream);
    Viewer.Source = image;
}&lt;/pre&gt;

&lt;p&gt;The above snippet shows a very basic way to asynchronously open a file. The stream is set as an image source after the file contents are fully read.&lt;/p&gt;

&lt;h2&gt;Application activation&lt;/h2&gt;

&lt;p&gt;Similar to Protocol example from my last post, the application is notified when user launches a file with associated extension, but the API behaves a bit differently here. The &lt;em&gt;OnProtocolActivated&lt;/em&gt; method is already built into the Application class and you only have to override it in App class derivate to handle the activation. This behavior is most likely to change in one of the future versions of &lt;em&gt;WinRT&lt;/em&gt;, but I currently have no idea whether we’ll get a separate method (&lt;em&gt;OnXXXActivated&lt;/em&gt;) for each activation kind, or will there be a single method &lt;em&gt;OnActivated&lt;/em&gt;, that will provide the activation kind through one of its parameters. Currently, there’s a weird mixture of both approaches.&lt;/p&gt;

&lt;p&gt;Here’s how the overridden &lt;em&gt;OnFileActivated&lt;/em&gt; method looks like:&lt;/p&gt;

&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;protected override void OnFileActivated(FileActivatedEventArgs args)
{
    PhotoView page = new PhotoView();
    page.SetPhoto(args.Files[0] as StorageFile);
    Window.Current.Content = page;
    Window.Current.Activate();
}&lt;/pre&gt;

&lt;p&gt;Interesting things to note about the provided FileActivatedEventArgs class are:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;args.&lt;em&gt;Files&lt;/em&gt; contains a collection of files that were used in activation. In this example, I’m only using the first one.&lt;/li&gt;

  &lt;li&gt;args.PreviousExecutionState will tell you the state the application was in before activation. It can be either &lt;em&gt;NotRunning&lt;/em&gt;, &lt;em&gt;Running&lt;/em&gt;, &lt;em&gt;Suspended&lt;/em&gt; and &lt;em&gt;Terminated&lt;/em&gt;.&lt;/li&gt;

  &lt;li&gt;args.Verb is the action that was used for activating the app. Should be set to &lt;em&gt;Open&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And that’s it for the code. The last thing is setting up the Declaration in the application manifest.&lt;/p&gt;

&lt;h2&gt;Application Manifest&lt;/h2&gt;

&lt;p&gt;&lt;a href="http://tozon.info/images/blog/Windows-8-Metro-declarations-Protocol_D1FA/image.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/Windows-8-Metro-declarations-Protocol_D1FA/image_thumb.png" width="600" height="362" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the first part of the File Type Association Declaration Page. &lt;em&gt;DisplayName&lt;/em&gt; is a localizable string that will be displayed to the user as associated file a handler and the graphics can be changed by specifying a new &lt;em&gt;Logo&lt;/em&gt;. &lt;em&gt;Info Tip&lt;/em&gt; should contain the text that will be displayed in a tooltip when user hovers a mouse over the application’s associated file extension. &lt;em&gt;Name&lt;/em&gt; is a unique name of the association.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Edit Flags&lt;/em&gt; specify what type of security prompt will be displayed to the user when she launches the associated file. &lt;em&gt;OpenIsSafe&lt;/em&gt; will show a standard warning dialog, while &lt;em&gt;AlwaysUnsafe&lt;/em&gt; will display a security warning dialog.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&amp;#160;&lt;a href="http://tozon.info/images/blog/Windows-8-Metro-declarations-Protocol_D1FA/image_3.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/Windows-8-Metro-declarations-Protocol_D1FA/image_thumb_3.png" width="600" height="415" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The second part of the Declaration configuration lets you set the supported file types. You can add as many file extensions as you want your application to handle and you can specify an optional content type for each of them. In the above example, extensions .jpg and .jpgx are registered.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Application Settings&lt;/em&gt; section lets you configure application’s entry point settings.&lt;/p&gt;

&lt;h2&gt;Running the application&lt;/h2&gt;

&lt;p&gt;Run (or just deploy) your application, then launch a .&lt;em&gt;jpg &lt;/em&gt;file of your choice that’s on your disk. The following dialog should appear, asking you to select the default application that will handle that file extension in the future:&lt;/p&gt;

&lt;p align="center"&gt;&lt;a href="http://tozon.info/images/blog/Windows-8-Metro-declarations-Protocol_D1FA/image_4.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/Windows-8-Metro-declarations-Protocol_D1FA/image_thumb_4.png" width="403" height="307" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After selecting your app as the default, it should be launched (or activated if already running) and display the image.&lt;/p&gt;

&lt;p&gt;Renaming a .jpg file to (previously unassociated extension) .jpgx and launching that, for example, will give you the following dialog:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://tozon.info/images/blog/Windows-8-Metro-declarations-Protocol_D1FA/image_5.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/Windows-8-Metro-declarations-Protocol_D1FA/image_thumb_5.png" width="571" height="473" /&gt;&lt;/a&gt;&lt;/p&gt;









&lt;p&gt;You can check (and change) the default application for each of the file extensions through the Control Panel. Both .jpg and .jpgx are associated with my demo application:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://tozon.info/images/blog/Windows-8-Metro-declarations-Protocol_D1FA/image_6.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/Windows-8-Metro-declarations-Protocol_D1FA/image_thumb_6.png" width="494" height="120" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Congratulations, you’ve just created your first file extension handling Metro application &lt;img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://tozon.info/images/blog/Windows-8-Metro-declarations-Protocol_D1FA/wlEmoticon-smile.png" /&gt;&lt;/p&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt; tweetmeme_url = 'http://tozon.info/blog/post/2011/10/11/Windows-8-Metro-declarations-File-Type-Associations.aspx'; tweetmeme_source = 'andrejt'; &lt;/script&gt; &lt;script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;div id="AdnBottom"&gt;&lt;div class="AdnBottomLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnBottomRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=MuwlOQGpqC0:RYxmD6DFlbQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=MuwlOQGpqC0:RYxmD6DFlbQ:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=MuwlOQGpqC0:RYxmD6DFlbQ:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=MuwlOQGpqC0:RYxmD6DFlbQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=MuwlOQGpqC0:RYxmD6DFlbQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=MuwlOQGpqC0:RYxmD6DFlbQ:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=MuwlOQGpqC0:RYxmD6DFlbQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=MuwlOQGpqC0:RYxmD6DFlbQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=MuwlOQGpqC0:RYxmD6DFlbQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=MuwlOQGpqC0:RYxmD6DFlbQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=MuwlOQGpqC0:RYxmD6DFlbQ:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=MuwlOQGpqC0:RYxmD6DFlbQ:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=MuwlOQGpqC0:RYxmD6DFlbQ:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=MuwlOQGpqC0:RYxmD6DFlbQ:V-t1I-SPZMU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=V-t1I-SPZMU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=MuwlOQGpqC0:RYxmD6DFlbQ:Jwdi1b3fU3Q"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=Jwdi1b3fU3Q" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TheAttic/~4/MuwlOQGpqC0" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheAttic/~3/MuwlOQGpqC0/post.aspx</link>
      <comments>http://www.tozon.info/blog/post/2011/10/11/Windows-8-Metro-declarations-File-Type-Associations.aspx#comment</comments>
      <guid isPermaLink="false">http://www.tozon.info/blog/post.aspx?id=2b45dd1d-d2e2-40eb-a290-5234649d99a4</guid>
      <pubDate>Tue, 11 Oct 2011 09:37:03 +0100</pubDate>
      <category>Metro</category>
      <category>Development</category>
      <category>WinRT</category>
      <category>Windows 8</category>
      <dc:publisher>andrej</dc:publisher>
      <pingback:server>http://www.tozon.info/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.tozon.info/blog/post.aspx?id=2b45dd1d-d2e2-40eb-a290-5234649d99a4</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.tozon.info/blog/trackback.axd?id=2b45dd1d-d2e2-40eb-a290-5234649d99a4</trackback:ping>
      <wfw:comment>http://www.tozon.info/blog/post/2011/10/11/Windows-8-Metro-declarations-File-Type-Associations.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.tozon.info/blog/syndication.axd?post=2b45dd1d-d2e2-40eb-a290-5234649d99a4</wfw:commentRss>
    <feedburner:origLink>http://www.tozon.info/blog/post.aspx?id=2b45dd1d-d2e2-40eb-a290-5234649d99a4</feedburner:origLink></item>
    <item>
      <title>Windows 8 Metro declarations: Protocol</title>
      <description>&lt;div id="AdnTop"&gt;&lt;div class="AdnTopLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnTopRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;I touched on the Metro-style application declarations in my previous &lt;a href="http://tozon.info/blog/post/2011/09/30/Windows-8-Metro-style-application-manifest.aspx"&gt;blog entry&lt;/a&gt; where I wrote about application manifest. I’m continuing the series with exploring the currently available declarations, starting with Protocol. I’ll be using C# Windows Metro style application samples throughout the whole series.&lt;/p&gt;  &lt;p&gt;I imagined an application that would respond to the specific URL requests. Let’s say that invoking a URL like “&lt;strong&gt;locx&lt;/strong&gt;://aerial/47.639747~-122.129731” should show me an aerial map, centered to a geographical point of (47.639747, -122.129731).&lt;/p&gt;  &lt;h2&gt;Displaying a Map&lt;/h2&gt;  &lt;p&gt;Let’s first figure out how to display the map. There isn’t any native WinRT maps component yet, so the simplest way to display a map is using &lt;a href="www.bing.com/maps" target="_blank"&gt;Bing maps&lt;/a&gt; in a &lt;strong&gt;WebView&lt;/strong&gt; Xaml control. WebView is a control that can display HTML, either passed in by string or by navigating to actual web site. Think of it as a very lightweight WebBrowser control, without all the chrome and other clutter.&lt;/p&gt;  &lt;p&gt;So I put a WebView control on the &lt;em&gt;MainPage&lt;/em&gt;, made sure it fills the whole page and altered its default constructor a bit:&lt;/p&gt;  &lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;public MainPage()
{
    InitializeComponent();
    WebView.Navigate(new Uri(&amp;quot;http://www.bing.com/maps&amp;quot;));
}&lt;/pre&gt;

&lt;p&gt;Run the application – it should display a nice map of the world. If you have a touch screen, try manipulating the map with your fingers – it' feels nice &lt;img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-winkingsmile" alt="Winking smile" src="http://tozon.info/images/blog/c2857bee850a_B0D5/wlEmoticon-winkingsmile.png" /&gt;&lt;/p&gt;

&lt;h2&gt;Metro-style application can be configured to handle any URL protocol&lt;/h2&gt;

&lt;p&gt;Back to the subject. Open the application manifest configuration screen and navigate to the Declarations tab. Open the Available Declarations dropdown and select Protocol. The protocol will be added to Supported Declarations list box when you click the Add button.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://tozon.info/images/blog/c2857bee850a_B0D5/image.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/c2857bee850a_B0D5/image_thumb.png" width="600" height="385" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Handling declaration properties for Protocol is pretty simple. You’re only required to name the protocol you want your application to handle. For this example, I’m using “&lt;strong&gt;locx&lt;/strong&gt;”.&lt;/p&gt;

&lt;p&gt;An optional custom graphics can be used as an application icon whenever the protocol declaration association needs to be displayed to the user (e.g. Control Panel). If not set, application’s Logo image will be used.&lt;/p&gt;

&lt;p&gt;Once configured, open &lt;em&gt;App.xaml.cs&lt;/em&gt; and override the &lt;em&gt;OnActivated&lt;/em&gt; method. This method will get called whenever application is activated. Because an application can be activated for the various reasons, you have to check against the passed arguments for the specific activation kind.&lt;/p&gt;

&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;protected override void OnActivated(IActivatedEventArgs args)
{
    if (args.Kind == ActivationKind.Protocol)
    {
        OnProtocolActivated((ProtocolActivatedEventArgs)args);
    }
}&lt;/pre&gt;

&lt;p&gt;When application is Protocol-activated, the activation arguments should be of the &lt;em&gt;ProtocolActivatedEventArgs&lt;/em&gt; type and it should be safe to cast to that. I’ve created the &lt;em&gt;OnProtocolActivated&lt;/em&gt; method to handle those cases separately. Note that some other activation scenarios have their equivalent activation methods already built in.&lt;/p&gt;

&lt;p&gt;In the &lt;em&gt;OnProtocolActivated&lt;/em&gt; method, you’ll have to resolve the Uri that was used for activation. I declared the following Uri format: &lt;strong&gt;locx://[view]/[latitude]~[longitude]&lt;/strong&gt;, where view is either roads or aerial. Here’s the method that parses the Uri and calls a specific constructor of the &lt;em&gt;MainPage&lt;/em&gt;. That latitude and longitude should be provided using the currently set culture format (commas vs. dots) so they could be parsed into doubles.&lt;/p&gt;

&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;private void OnProtocolActivated(ProtocolActivatedEventArgs args)
{
    string type = args.Uri.Host;
    double lat;
    double lng;

    string[] latlng = args.Uri.LocalPath.Substring(1).Split(new[] { &amp;quot;~&amp;quot; }, StringSplitOptions.RemoveEmptyEntries);

    if (latlng.Length != 2 || !double.TryParse(latlng[0], out lat) || !double.TryParse(latlng[1], out lng))
    {
        Exit();
        return;
    }

    Window.Current.Content = new MainPage(type, lat, lng);
    Window.Current.Activate();
}&lt;/pre&gt;

&lt;p&gt;In overridden &lt;em&gt;MainPage&lt;/em&gt; constructor, a Bing maps query is composed and navigated to. Invariant culture is used to convert latitude and longitude to the proper format.&lt;/p&gt;

&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;public MainPage(string type, double lat, double lng)
{
    InitializeComponent();
    string uri = string.Format(&amp;quot;http://www.bing.com/maps/default.aspx?cp={0}~{1}&amp;amp;lvl=10&amp;amp;style={2}&amp;quot;, lat.ToString(CultureInfo.InvariantCulture), lng.ToString(CultureInfo.InvariantCulture), type.ToLower()[0]);
    WebView.Navigate(new Uri(uri));
}&lt;/pre&gt;

&lt;h2&gt;Activation Registration&lt;/h2&gt;

&lt;p&gt;A very positive thing about activating declarations is that protocol registration will be done when you deploy the application to your computer. That means you don’t need to run the application (as in – the first time) to register the protocol. You can even choose that your application will only support activation and do nothing when launched the ordinary way.&lt;/p&gt;

&lt;p&gt;After deploying, you can test your application by invoking the following link from the command line (or Run prompt):&lt;/p&gt;

&lt;p&gt;&lt;a href="http://tozon.info/images/blog/c2857bee850a_B0D5/image_3.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/c2857bee850a_B0D5/image_thumb_3.png" width="413" height="213" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://tozon.info/images/blog/c2857bee850a_B0D5/image_4.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/c2857bee850a_B0D5/image_thumb_4.png" width="604" height="364" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Of course application will handle any subsequent protocol requests while it’s already running too.&lt;/p&gt;

&lt;p&gt;Metro-style application declarations promise a simple integration with the OS through predefined contracts, Protocol is just one of those extensibility points. I’ll look into others in my next posts.&lt;/p&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt; tweetmeme_url = 'http://tozon.info/blog/post/2011/10/06/Windows-8-Metro-declarations-Protocol.aspx'; tweetmeme_source = 'andrejt'; &lt;/script&gt; &lt;script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;div id="AdnBottom"&gt;&lt;div class="AdnBottomLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnBottomRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=oUkGcf8JcHA:irnVnZN9Drw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=oUkGcf8JcHA:irnVnZN9Drw:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=oUkGcf8JcHA:irnVnZN9Drw:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=oUkGcf8JcHA:irnVnZN9Drw:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=oUkGcf8JcHA:irnVnZN9Drw:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=oUkGcf8JcHA:irnVnZN9Drw:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=oUkGcf8JcHA:irnVnZN9Drw:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=oUkGcf8JcHA:irnVnZN9Drw:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=oUkGcf8JcHA:irnVnZN9Drw:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=oUkGcf8JcHA:irnVnZN9Drw:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=oUkGcf8JcHA:irnVnZN9Drw:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=oUkGcf8JcHA:irnVnZN9Drw:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=oUkGcf8JcHA:irnVnZN9Drw:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=oUkGcf8JcHA:irnVnZN9Drw:V-t1I-SPZMU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=V-t1I-SPZMU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=oUkGcf8JcHA:irnVnZN9Drw:Jwdi1b3fU3Q"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=Jwdi1b3fU3Q" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TheAttic/~4/oUkGcf8JcHA" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheAttic/~3/oUkGcf8JcHA/post.aspx</link>
      <comments>http://www.tozon.info/blog/post/2011/10/06/Windows-8-Metro-declarations-Protocol.aspx#comment</comments>
      <guid isPermaLink="false">http://www.tozon.info/blog/post.aspx?id=287c3422-6211-4135-8ca2-7591dad3428b</guid>
      <pubDate>Thu, 06 Oct 2011 13:43:11 +0100</pubDate>
      <category>Development</category>
      <category>Geolocation</category>
      <category>Metro</category>
      <category>User Experience</category>
      <category>WinRT</category>
      <category>Windows 8</category>
      <dc:publisher>andrej</dc:publisher>
      <pingback:server>http://www.tozon.info/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.tozon.info/blog/post.aspx?id=287c3422-6211-4135-8ca2-7591dad3428b</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.tozon.info/blog/trackback.axd?id=287c3422-6211-4135-8ca2-7591dad3428b</trackback:ping>
      <wfw:comment>http://www.tozon.info/blog/post/2011/10/06/Windows-8-Metro-declarations-Protocol.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.tozon.info/blog/syndication.axd?post=287c3422-6211-4135-8ca2-7591dad3428b</wfw:commentRss>
    <feedburner:origLink>http://www.tozon.info/blog/post.aspx?id=287c3422-6211-4135-8ca2-7591dad3428b</feedburner:origLink></item>
    <item>
      <title>Windows 8 Metro-style application manifest</title>
      <description>&lt;div id="AdnTop"&gt;&lt;div class="AdnTopLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnTopRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;When you create a new Windows Metro style application, Visual Studio will automatically create the application manifest for you. The file will be called Package.appxmanifest and will be included in the root of the project. Looking at it closer reveals that it’s a plain XML file that can be generated manually or with the help of some other tool as well.&lt;/p&gt;  &lt;p&gt;Visual Studio, however, offers a nice GUI editor for editing the application manifest file. This is a quick walk through its tab pages. To invoke the editor, simply double-click on the manifest file or choose &lt;em&gt;Store | Edit App Manifest&lt;/em&gt; from the menu.&lt;/p&gt;  &lt;h2&gt;Application UI&lt;/h2&gt;  &lt;p&gt;&lt;a href="http://tozon.info/images/blog/Windows-8-Metro-style-application-manife_9BF1/image.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/Windows-8-Metro-style-application-manife_9BF1/image_thumb.png" width="600" height="368" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The tab for application menu hosts the basic info about your application.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Display Name&lt;/strong&gt; is the title of your application. It will appear on the start screen, search page, etc., wherever the user can see. It can be localized.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Entry Point&lt;/strong&gt; should point to the application’s activatable class id. It should be set to project’s App class, but in current build of Visual Studio, changing it to invalid value doesn’t currently seem to affect anything.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt; contains a longer description of your application, but it shouldn’t exceed 2048 characters. It can be localized as well.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Tiles (Logo, Wide Logo and Small Logo)&lt;/strong&gt; represent the graphics you want to present your application with. The logo is also used as the main tile and the Small Logo is used for lists, etc. The Wide Logo is used when the app requires the wide format tile. Valid format for all graphics are .png and .jpg.&lt;/p&gt;  &lt;p&gt;Further down, there are even more options…&lt;/p&gt;  &lt;p&gt;&lt;a href="http://tozon.info/images/blog/Windows-8-Metro-style-application-manife_9BF1/image_3.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/Windows-8-Metro-style-application-manife_9BF1/image_thumb_3.png" width="600" height="372" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Show Name&lt;/strong&gt; and &lt;strong&gt;Short Name&lt;/strong&gt; work in together with the above Display Name. Setting Show Name to Yes and leaving Short Name empty, the Display Name will be displayed on the application tile as an overlay. Set Short name to a custom name and Short Name will be displayed as the overlay.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Foreground Text&lt;/strong&gt; sets the color of the text displayed on the application tile. In can be set to Light or Dark, for&amp;#160; best fit with the tile graphics.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Background Color&lt;/strong&gt; specifies the tile’s background color. Can be either named or the ‘#’ color.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Notifications&lt;/strong&gt; control how the notifications look and work.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Badge Logo&lt;/strong&gt; points to the graphics that will be displayed on the lock screen as a notification from your application.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Lock Screen Notifications&lt;/strong&gt; specify what kind of notifications your application will support when the system is locked. Can be set to Tile Text, Badge or both.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Toast Capable&lt;/strong&gt; should be set to true when you want to send alerts from your application.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Splash Screen options (Splash Screen and Background Color)&lt;/strong&gt; control the appearance of the splash screen. Splash Screen should point to the splash screen graphics and Background Color specifies the background color for that screen (transparency effects).&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Initial Rotation&lt;/strong&gt; specifies the initial rotation when the application starts. Can be set to all four possible rotations (Portrait, Landscape, Portrait and Flipped, Landscape and Flipped.&lt;/p&gt;  &lt;h2&gt;Capabilities&lt;/h2&gt;  &lt;p&gt;The next tab in application manifest editor allows you to set the protected resources you want to allow your application to access. Your application will not have the access to those capabilities if you don’t explicitly set them here, nor they won’t be accessible in cases when hardware does not support it, are blocked through other security policies, or when explicitly denied access by the user herself. Note that the user is prompted about those capability requirements when she is installing your application and can deny those requests. Even later…&lt;/p&gt;  &lt;p&gt;Here’s the current list of those capabilities:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://tozon.info/images/blog/Windows-8-Metro-style-application-manife_9BF1/image_4.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/Windows-8-Metro-style-application-manife_9BF1/image_thumb_4.png" width="600" height="362" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h2&gt;Declarations&lt;/h2&gt;  &lt;p&gt;Declarations are your application’s extensibility points, for better integration with the system and/or other installed applications. Some of those extensibility points include:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;Contact Picker&lt;/strong&gt; (your application serves as a contact picker for other applications),&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;File Type Associations&lt;/strong&gt; (registers your app as a (default) handler for a specific file type), &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;File Picker&lt;/strong&gt; (your app serves as a content picker for other apps; think choosers in Windows Phone), &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Protocol&lt;/strong&gt; (your app registers as a URL Protocol handler),&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Search&lt;/strong&gt; (provides searching functionality), &lt;/li&gt;    &lt;li&gt;     &lt;div align="left"&gt;&lt;strong&gt;ShareTarget&lt;/strong&gt; (for your next social networking application &lt;img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://tozon.info/images/blog/Windows-8-Metro-style-application-manife_9BF1/wlEmoticon-smile.png" /&gt;),&lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p align="left"&gt;… and a few more. All declarations have their own options and settings.&lt;/p&gt;  &lt;p align="left"&gt;&lt;a href="http://tozon.info/images/blog/Windows-8-Metro-style-application-manife_9BF1/image_5.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/Windows-8-Metro-style-application-manife_9BF1/image_thumb_5.png" width="600" height="305" /&gt;&lt;/a&gt;&lt;/p&gt;    &lt;h2&gt;Packaging&lt;/h2&gt;  &lt;p&gt;The Packaging tab holds the info, relevant to deploying and publishing your application.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://tozon.info/images/blog/Windows-8-Metro-style-application-manife_9BF1/image_6.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/Windows-8-Metro-style-application-manife_9BF1/image_thumb_6.png" width="600" height="252" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Package Name&lt;/strong&gt; uniquely identifies the package and therefore your application too. It’s a GUID.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Package Display Name&lt;/strong&gt; is a localizable package title that is displayed to the users.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Logo&lt;/strong&gt; points to the application store logo.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Publisher&lt;/strong&gt; describes the application publisher and matches the publisher subject information from the certificate that is used for signing the application manifest. The value is set automatically when choosing an existing certificate or create a new test certificate.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Publisher Display Name&lt;/strong&gt; and &lt;strong&gt;Package Family Name&lt;/strong&gt; are also derived from the chosen certificate. Publisher Display Name can be changed and even localized.&lt;/p&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt; tweetmeme_url = 'http://tozon.info/blog/post/2011/09/30/Windows-8-Metro-style-application-manifest.aspx'; tweetmeme_source = 'andrejt'; &lt;/script&gt; &lt;script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;div id="AdnBottom"&gt;&lt;div class="AdnBottomLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnBottomRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=HES6piGIIFM:QjARJ1fdw3w:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=HES6piGIIFM:QjARJ1fdw3w:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=HES6piGIIFM:QjARJ1fdw3w:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=HES6piGIIFM:QjARJ1fdw3w:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=HES6piGIIFM:QjARJ1fdw3w:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=HES6piGIIFM:QjARJ1fdw3w:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=HES6piGIIFM:QjARJ1fdw3w:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=HES6piGIIFM:QjARJ1fdw3w:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=HES6piGIIFM:QjARJ1fdw3w:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=HES6piGIIFM:QjARJ1fdw3w:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=HES6piGIIFM:QjARJ1fdw3w:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=HES6piGIIFM:QjARJ1fdw3w:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=HES6piGIIFM:QjARJ1fdw3w:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=HES6piGIIFM:QjARJ1fdw3w:V-t1I-SPZMU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=V-t1I-SPZMU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=HES6piGIIFM:QjARJ1fdw3w:Jwdi1b3fU3Q"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=Jwdi1b3fU3Q" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TheAttic/~4/HES6piGIIFM" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheAttic/~3/HES6piGIIFM/post.aspx</link>
      <comments>http://www.tozon.info/blog/post/2011/09/30/Windows-8-Metro-style-application-manifest.aspx#comment</comments>
      <guid isPermaLink="false">http://www.tozon.info/blog/post.aspx?id=9029a093-7bd5-4104-aa7b-87b2b5a77d81</guid>
      <pubDate>Fri, 30 Sep 2011 12:00:07 +0100</pubDate>
      <category>Development</category>
      <category>Metro</category>
      <category>WinRT</category>
      <category>Windows 8</category>
      <dc:publisher>andrej</dc:publisher>
      <pingback:server>http://www.tozon.info/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.tozon.info/blog/post.aspx?id=9029a093-7bd5-4104-aa7b-87b2b5a77d81</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.tozon.info/blog/trackback.axd?id=9029a093-7bd5-4104-aa7b-87b2b5a77d81</trackback:ping>
      <wfw:comment>http://www.tozon.info/blog/post/2011/09/30/Windows-8-Metro-style-application-manifest.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.tozon.info/blog/syndication.axd?post=9029a093-7bd5-4104-aa7b-87b2b5a77d81</wfw:commentRss>
    <feedburner:origLink>http://www.tozon.info/blog/post.aspx?id=9029a093-7bd5-4104-aa7b-87b2b5a77d81</feedburner:origLink></item>
    <item>
      <title>Windows 8 applications and JSON data</title>
      <description>&lt;div id="AdnTop"&gt;&lt;div class="AdnTopLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnTopRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;For anyone that wants to call various JSON data service endpoints in a Windows 8 (Metro style?) application, there’s a couple of changes in “.NET APIs for Metro style apps” (using MSDN terminology here) that needs to be looked into. For this blog post I’m using &lt;a href="http://flickr.com" target="_blank"&gt;flickr&lt;/a&gt; API as an example of how to fetch and parse &lt;a href="http://en.wikipedia.org/wiki/Json" target="_blank"&gt;JSON&lt;/a&gt; data.&lt;/p&gt;  &lt;h2&gt;Where’s my WebClient?&lt;/h2&gt;  &lt;p&gt;No, there is no WebClient class in the new API. But…&lt;/p&gt;  &lt;p&gt;There’s a HttpClient class that works similar, or even better, by providing an asynchronous method to fetch data. If you’ve looked into the &lt;a href="http://msdn.microsoft.com/en-gb/vstudio/async.aspx" target="_blank"&gt;Async CTP bits&lt;/a&gt;, the new method should look very familiar. &lt;/p&gt;  &lt;p&gt;The new HttpClient class itself resides into the System.Net.Http namespace. Jumping right into the code:&lt;/p&gt;  &lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;public async Task&amp;lt;string&amp;gt; GetPhotosStream()
{
    HttpClient client = new HttpClient();
    string url = &amp;quot;http://www.flickr.com/services/rest/?method=flickr.photos.search&amp;amp;format=json&amp;amp;nojsoncallback=1&amp;amp;api_key=&amp;lt;yourkey&amp;gt;&amp;amp;text=buildwindows&amp;quot;;
    HttpResponseMessage response = await client.GetAsync(url);
    return response.Content.ReadAsString();
}&lt;/pre&gt;

&lt;p&gt;Shall anyone need it, there is also a synchronous method called Get() that will block until full response message is returned and read on the client.&lt;/p&gt;

&lt;p&gt;Other than Get(Async), there are three method pairs more – &lt;strong&gt;Get(Async)&lt;/strong&gt;, together with &lt;strong&gt;Put(Async)&lt;/strong&gt;, &lt;strong&gt;Post(Async)&lt;/strong&gt; and &lt;strong&gt;Delete(Async)&lt;/strong&gt; forms the full set of verbs supported by &lt;a href="http://en.wikipedia.org/wiki/Representational_State_Transfer" target="_blank"&gt;REST&lt;/a&gt; (Representational state transfer) to manipulate data.&lt;/p&gt;

&lt;p&gt;GetAsync() will return a HttpResponseMessage, which contains the returned status code, response headers and returned content, which can be read in a variety of ways.&lt;/p&gt;

&lt;h2&gt;Parsing JSON&lt;/h2&gt;

&lt;p&gt;I have rarely used native framework JSON classes (I prefer using &lt;a href="http://json.codeplex.com/" target="_blank"&gt;JSON.Net&lt;/a&gt;), but looking at the new API it looks like there’s quite a few changes here as well.&lt;/p&gt;

&lt;p&gt;A returned string can be fed to the JsonObject in its constructor or using Parse() method on its instance. Either way will result in an exception if the JSON string is invalid and couldn’t be parsed.&lt;/p&gt;

&lt;p&gt;Once parsed, you’ve got full access to it’s structure. Before I show the code to access it, let’s look at snippet of the returned JSON string:&lt;/p&gt;

&lt;pre class="brush: plain; gutter: false; toolbar: false;"&gt;{
  &amp;quot;photos&amp;quot;:
  {
    &amp;quot;page&amp;quot;:1, 
    &amp;quot;pages&amp;quot;:1, 
    &amp;quot;perpage&amp;quot;:100, 
    &amp;quot;total&amp;quot;:&amp;quot;13&amp;quot;, 
    &amp;quot;photo&amp;quot;:
    [
      {&amp;quot;id&amp;quot;:&amp;quot;6146549133&amp;quot;, ..., &amp;quot;title&amp;quot;:&amp;quot;20 Microsoft interns (three from Olin) at this week's BUILD conference&amp;quot;, ...},
      {&amp;quot;id&amp;quot;:&amp;quot;6146244616&amp;quot;, ..., &amp;quot;title&amp;quot;:&amp;quot;Internet Explorer&amp;quot;, ...},
      ...
      ...
    ]
  },
  &amp;quot;stat&amp;quot;:&amp;quot;ok&amp;quot;
}&lt;/pre&gt;

&lt;p&gt;And this is how you would read the titles of returned photos:&lt;/p&gt;

&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;private static List&amp;lt;string&amp;gt; titles = new List&amp;lt;string&amp;gt;();

public static async void ExaminePhotos()
{
    string responseText = await GetPhotosStream();
    JsonObject root = new JsonObject(responseText);
    bool isSuccess = root.GetNamedString(&amp;quot;stat&amp;quot;) == &amp;quot;ok&amp;quot;;
    JsonObject info = root.GetNamedObject(&amp;quot;photos&amp;quot;);
    int page = (int)info.GetNamedNumber(&amp;quot;page&amp;quot;);
    int totalPages = (int)info.GetNamedNumber(&amp;quot;pages&amp;quot;);
    JsonArray photos = info.GetNamedArray(&amp;quot;photo&amp;quot;);
    for (uint i = 0; i &amp;lt; photos.Count; i++)
    {
        string title = photos.GetObjectAt(i).GetNamedString(&amp;quot;title&amp;quot;);
        titles.Add(title);
    }
}&lt;/pre&gt;

&lt;p&gt;While the “Named*&amp;quot; methods return typed values (GetNamedString() returns a string, GetNamedNumber() a double, etc.), it’s also possible to get the JSON value by string indexer and later call to its typed value, e.g. &lt;font face="Courier New"&gt;json[“stat”].GetString()&lt;/font&gt;, which gets useful if you want to check for its type first.&lt;/p&gt;

&lt;p&gt;The second part deals with a JsonArray named &lt;em&gt;photo&lt;/em&gt;, which gets enumerated and read in a similar manner.&lt;/p&gt;

&lt;h2&gt;Wait, isn’t this supposed to be simpler?&lt;/h2&gt;

&lt;p&gt;Of course, the DataContractJsonSerializer is still here. In fact, it appears to be the same class, just moved into a separate assembly.&lt;/p&gt;

&lt;p&gt;To use it, create appropriate classes from the JSON structure (&lt;a href="http://json2csharp.com/" target="_blank"&gt;one of utilities that can help&lt;/a&gt;) and deserialize JSON string with the help of DataContractJsonSerializer:&lt;/p&gt;

&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;string responseText = await GetPhotosStream();

DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(RootObject));
RootObject root;
using (MemoryStream stream = new MemoryStream(Encoding.Unicode.GetBytes(responseText)))
{
    root = serializer.ReadObject(stream) as RootObject;
}&lt;/pre&gt;

&lt;p&gt;The result is a full object tree that was deserialized from the flickr API JSON string.&lt;/p&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt; tweetmeme_url = 'http://tozon.info/blog/post/2011/09/21/Windows-8-applications-and-JSON-data.aspx'; tweetmeme_source = 'andrejt'; &lt;/script&gt; &lt;script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;div id="AdnBottom"&gt;&lt;div class="AdnBottomLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnBottomRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=rlq6S9rrzao:NPr4qvTgiJM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=rlq6S9rrzao:NPr4qvTgiJM:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=rlq6S9rrzao:NPr4qvTgiJM:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=rlq6S9rrzao:NPr4qvTgiJM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=rlq6S9rrzao:NPr4qvTgiJM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=rlq6S9rrzao:NPr4qvTgiJM:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=rlq6S9rrzao:NPr4qvTgiJM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=rlq6S9rrzao:NPr4qvTgiJM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=rlq6S9rrzao:NPr4qvTgiJM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=rlq6S9rrzao:NPr4qvTgiJM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=rlq6S9rrzao:NPr4qvTgiJM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=rlq6S9rrzao:NPr4qvTgiJM:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=rlq6S9rrzao:NPr4qvTgiJM:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=rlq6S9rrzao:NPr4qvTgiJM:V-t1I-SPZMU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=V-t1I-SPZMU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=rlq6S9rrzao:NPr4qvTgiJM:Jwdi1b3fU3Q"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=Jwdi1b3fU3Q" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TheAttic/~4/rlq6S9rrzao" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheAttic/~3/rlq6S9rrzao/post.aspx</link>
      <comments>http://www.tozon.info/blog/post/2011/09/21/Windows-8-applications-and-JSON-data.aspx#comment</comments>
      <guid isPermaLink="false">http://www.tozon.info/blog/post.aspx?id=4f8f5d42-8cd8-4b41-96b7-f313213f2c51</guid>
      <pubDate>Wed, 21 Sep 2011 00:57:58 +0100</pubDate>
      <category>Development</category>
      <category>Metro</category>
      <category>WinRT</category>
      <category>Windows 8</category>
      <dc:publisher>andrej</dc:publisher>
      <pingback:server>http://www.tozon.info/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.tozon.info/blog/post.aspx?id=4f8f5d42-8cd8-4b41-96b7-f313213f2c51</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.tozon.info/blog/trackback.axd?id=4f8f5d42-8cd8-4b41-96b7-f313213f2c51</trackback:ping>
      <wfw:comment>http://www.tozon.info/blog/post/2011/09/21/Windows-8-applications-and-JSON-data.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.tozon.info/blog/syndication.axd?post=4f8f5d42-8cd8-4b41-96b7-f313213f2c51</wfw:commentRss>
    <feedburner:origLink>http://www.tozon.info/blog/post.aspx?id=4f8f5d42-8cd8-4b41-96b7-f313213f2c51</feedburner:origLink></item>
    <item>
      <title>First look at Windows 8 application as a developer</title>
      <description>&lt;div id="AdnTop"&gt;&lt;div class="AdnTopLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnTopRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;It’s been a couple of days since I installed the //build/ preview version of Windows 8 and in this short time I’ve grown to quite like it. It’s an interesting mix of the new Metro style and the “old” Windows 7-like style.&lt;/p&gt;  &lt;p&gt;There were two things I’ve just had to install though, to make my life easier while working with Windows 8. The first thing was Total Commander, a file navigation alternative to Windows Explorer, and shortly after that, I installed “Mouse without borders”, the software KVM-like solution that lets you control multiple computers with a single set of keyboard and mouse, share clipboard etc. (for that I had to manually install .NET Framework 2.0 first, though).&lt;/p&gt;  &lt;p&gt;The most confusing part about Windows 8 was the mixture of touch and mouse input. I installed Windows 8 on a touch-enabled notebook and was surprised that I could pan, zoom and drag things around, but couldn’t select apps. Tiles responded to tap, but apps just didn’t start and I had to use the mouse to click on them. I’m blaming the missing/incomplete drivers for that and expect it to be fixed by the time Windows 8 gets released. Once I got comfortable working around those issues, I started exploring the new Metro UI, mostly exploring my options for creating my own Metro application.&lt;/p&gt;  &lt;p&gt;I took the default Weather application as the example. Funny thing is that at first I couldn’t find a way to change the temperature display to show Celsius instead of Fahrenheit. I started the app and started clicking all over it and eventually found out that right clicking anywhere on the screen (a Metro application takes up the whole screen unless it shares that space with other apps) brings up the Application bar (in touch world, the app bar is displayed by swiping up your finger from the bottom of screen).&lt;/p&gt;  &lt;p&gt;&lt;a href="http://tozon.info/images/blog/5511efe0657d_98D1/image.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/5511efe0657d_98D1/image_thumb.png" width="600" height="338" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h2&gt;Application bar&lt;/h2&gt;  &lt;p&gt;Similar to Windows Phone, Application bar is reserved for command and status buttons. One difference is that buttons are aligned to left and right edges instead of centered horizontally. This makes them easier to reach by your thumb fingers when holding a tablet.&lt;/p&gt;  &lt;p&gt;Application bar hosts your command buttons that may change depending on the context - the state your application is in. You can also choose to include more system level commands such as the option to pin the application to the Start screen. Buttons you shouldn’t include in the Application bar are the ones for displaying application's settings and / or search pages. More on that later.&lt;/p&gt;  &lt;p&gt;While application bar revealed some helpful options, there was no settings button to be found. Running around with the mouse I found a hot-spot on the bottom-left of the screen (where you’d expect the Start button to be on older Windows). Dragging my mouse to that corner revealed a Start-like menu with the “charm” options: Settings, Devices, Share, Search and Start (in touch world, charms are displayed when you swipe from the right edge towards center).&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://tozon.info/images/blog/5511efe0657d_98D1/image_3.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/5511efe0657d_98D1/image_thumb_3.png" width="300" height="169" /&gt;&lt;/a&gt;&amp;#160;&amp;#160; &lt;a href="http://tozon.info/images/blog/5511efe0657d_98D1/image_4.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/5511efe0657d_98D1/image_thumb_4.png" width="300" height="169" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="left"&gt;Great! Settings!&lt;/p&gt;  &lt;h2&gt;Settings and preferences&lt;/h2&gt;  &lt;p&gt;Turned out that settings charm took me to the settings pane that appeared on the right-hand side of the screen, offering me the following options:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Rate and Review the application (doesn’t currently work because Windows Store is not available yet), &lt;/li&gt;    &lt;li&gt;Control system access for Weather (allows user to enable or disable the capabilities required by your application), &lt;/li&gt;    &lt;li&gt;Weather preferences. That last one was key and the most difficult to find because it looked like some kind of group header. When I discovered that it was selectable, I got into the preferences page that allowed me to change application’s preferences. &lt;/li&gt; &lt;/ul&gt;  &lt;p align="center"&gt;&lt;a href="http://tozon.info/images/blog/5511efe0657d_98D1/image_5.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/5511efe0657d_98D1/image_thumb_5.png" width="231" height="240" /&gt;&lt;/a&gt;&amp;#160;&lt;a href="http://tozon.info/images/blog/5511efe0657d_98D1/image_6.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/5511efe0657d_98D1/image_thumb_6.png" width="224" height="240" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Preferences is also one of the custom Settings pages you can implement in your own application. There are a few settings commands you can add to the Settings pane that you map to specific pages, some of those being the About page, Preferences, Help and Privacy statement. From what I found out, only for Settings commands can be displayed in the Settings pane at once, but I’m not sure if that can change depending on your display resolution.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://tozon.info/images/blog/5511efe0657d_98D1/image_7.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/5511efe0657d_98D1/image_thumb_7.png" width="230" height="356" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;You don't need to worry when and how the Settings pane will be displayed, that all is handled by the OS, which means some less work for the developer and, perhaps more importantly, a unified experience across all Metro applications. You only need to implement the way Setting commands display application-specific pages (Preferences, About, etc.)&lt;/p&gt;  &lt;h2&gt;Search and Share&lt;/h2&gt;  &lt;br /&gt;  &lt;p&gt;Search and Sharing contracts are implemented similar to Settings, but go additional step forward. If your application is going to support searching, you can hook up a Search pane, implement required event handlers and provide a custom results page. For Sharing, that would mean to implement the sharing logic. It looks like all application can share their screenshot by default (even if you don’t implement the sharing contract).&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://tozon.info/images/blog/5511efe0657d_98D1/image_8.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/5511efe0657d_98D1/image_thumb_8.png" width="230" height="456" /&gt;&lt;/a&gt;&amp;#160;&amp;#160;&amp;#160; &lt;a href="http://tozon.info/images/blog/5511efe0657d_98D1/image_9.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/5511efe0657d_98D1/image_thumb_9.png" width="238" height="456" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;One bonus that Search and Sharing contract provide over Settings is that other applications can use your application as a search or share target. That means that from whichever other application user is currently using, she can search your application (or share her content through it) just by choosing it as a target from her current Search (or Share) pane.&lt;/p&gt;  &lt;p&gt;There seems to be quite a few system hooks in Windows 8 that your Metro apps can connect to. Those mentioned above only happen to be the most exposed and accessible in the short run. Clearly it will take some time to get fully familiar with the new Runtime and OS integration and let’s not forget, we’re playing with the preview bits – anything can change in future versions.&lt;/p&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;div id="AdnBottom"&gt;&lt;div class="AdnBottomLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnBottomRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=TrTVropMXQE:zbP--EannuE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=TrTVropMXQE:zbP--EannuE:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=TrTVropMXQE:zbP--EannuE:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=TrTVropMXQE:zbP--EannuE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=TrTVropMXQE:zbP--EannuE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=TrTVropMXQE:zbP--EannuE:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=TrTVropMXQE:zbP--EannuE:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=TrTVropMXQE:zbP--EannuE:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=TrTVropMXQE:zbP--EannuE:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=TrTVropMXQE:zbP--EannuE:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=TrTVropMXQE:zbP--EannuE:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=TrTVropMXQE:zbP--EannuE:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=TrTVropMXQE:zbP--EannuE:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=TrTVropMXQE:zbP--EannuE:V-t1I-SPZMU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=V-t1I-SPZMU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=TrTVropMXQE:zbP--EannuE:Jwdi1b3fU3Q"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=Jwdi1b3fU3Q" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TheAttic/~4/TrTVropMXQE" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheAttic/~3/TrTVropMXQE/post.aspx</link>
      <comments>http://www.tozon.info/blog/post/2011/09/17/First-look-at-Windows-8-application-as-a-developer.aspx#comment</comments>
      <guid isPermaLink="false">http://www.tozon.info/blog/post.aspx?id=c4170f14-3f75-45ac-ac5c-332035899384</guid>
      <pubDate>Sat, 17 Sep 2011 15:49:57 +0100</pubDate>
      <category>Development</category>
      <category>User Experience</category>
      <category>WinRT</category>
      <category>Windows 8</category>
      <category>Metro</category>
      <dc:publisher>andrej</dc:publisher>
      <pingback:server>http://www.tozon.info/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.tozon.info/blog/post.aspx?id=c4170f14-3f75-45ac-ac5c-332035899384</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.tozon.info/blog/trackback.axd?id=c4170f14-3f75-45ac-ac5c-332035899384</trackback:ping>
      <wfw:comment>http://www.tozon.info/blog/post/2011/09/17/First-look-at-Windows-8-application-as-a-developer.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.tozon.info/blog/syndication.axd?post=c4170f14-3f75-45ac-ac5c-332035899384</wfw:commentRss>
    <feedburner:origLink>http://www.tozon.info/blog/post.aspx?id=c4170f14-3f75-45ac-ac5c-332035899384</feedburner:origLink></item>
    <item>
      <title>Windows 8 geolocation API: First run</title>
      <description>&lt;div id="AdnTop"&gt;&lt;div class="AdnTopLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnTopRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Microsoft Windows 8 OS was finally revealed this week at Microsoft’s &lt;a href="http://www.buildwindows.com" target="_blank"&gt;//build/&lt;/a&gt; conference. It looks like a promising OS, with &lt;a href="http://en.wikipedia.org/wiki/Metro_Design_Language" target="_blank"&gt;Metro&lt;/a&gt; style theme showing all over it.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://tozon.info/images/blog/Windows-8-geolocation_8792/image.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/Windows-8-geolocation_8792/image_thumb.png" width="600" height="338" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;If you want to install it, look it up on the &lt;a href="http://msdn.microsoft.com/subscriptions" target="_blank"&gt;MSDN subscriptions site&lt;/a&gt; or head over &lt;a href="http://msdn.microsoft.com/en-us/windows/apps/br229516" target="_blank"&gt;here&lt;/a&gt; (limited set of SKUs). If you’re a developer, pick the one that includes the Visual Studio 11 Developer preview (or install tools – available also as a separate download – later).&lt;/p&gt;  &lt;p&gt;A lot is about to be said of WinRT, the new Windows Runtime and how it relates to .NET and how developing Windows applications will going to be (dis)similar to developing WPF or Silverlight applications. Skipping that discussion for later, I jumped right into developing tools to see how familiar the new API would look to me and whether my past experience with developing XAML based applications in the past few years would help or not.&lt;/p&gt;  &lt;h2&gt;Starting with the geolocation API&lt;/h2&gt;  &lt;p&gt;Having developed a couple of Windows Phone application that used my location as a crucial piece of information, I was curious how the same would be done in a Windows 8 application. I’m posting this as a walkthrough (assuming you installed the Visual Studio 11 Express for Windows Developer Preview):&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;[A short note before you start: the following is based on the //build/ Developer Preview bits and will most likely change in future versions]&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;1. Open Visual Studio 11 Express.&lt;/p&gt;  &lt;p&gt;2. Create a New Project. A few project templates are available, but let’s start simple and choose a basic C# Application.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://tozon.info/images/blog/Windows-8-geolocation_8792/image_3.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/Windows-8-geolocation_8792/image_thumb_3.png" width="600" height="322" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;3. If you’re a XAML developer, you’ll find yourself into a very familiar environment. A big plus on that is that Window designer is loading in the background and not blocking you to fiddle with other things while it loads [yes!] &lt;/p&gt;  &lt;p&gt;&lt;a href="http://tozon.info/images/blog/Windows-8-geolocation_8792/image_4.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/Windows-8-geolocation_8792/image_thumb_4.png" width="600" height="322" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#666666"&gt;[I’ll look into various settings to control you application’s look and feel in one of my future posts]&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;4. Similarly to Windows Phone, using a location requires you as a developer, to explicitly declare that your application will require access to the location API. This is set in the application manifest. In a Solution explorer, look for &lt;em&gt;Package.appmanifest&lt;/em&gt; item and double click on it to open – the manifest properties window will open.&lt;/p&gt;  &lt;p&gt;5. Click on the Capabilities tab. Uncheck the Internet (Client) capability and check Location capability (just under it).&lt;/p&gt;  &lt;p&gt;&lt;a href="http://tozon.info/images/blog/Windows-8-geolocation_8792/image_5.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/Windows-8-geolocation_8792/image_thumb_5.png" width="600" height="452" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;You’ve just declared that the application will require the Location capability. Had you not enabled this item, anything access to the location API in the application would have no effect. No errors or exceptions would bi risen, it just wouldn’t work.&lt;/p&gt;  &lt;p&gt;6. Go back to the MainPage.Xaml and add a TextBlock named &lt;em&gt;Status&lt;/em&gt; into the main Grid (&lt;em&gt;LayoutRoot&lt;/em&gt;). This is where you’re going to display the current location.&lt;/p&gt;  &lt;p&gt;7. Switch to the code view (quick heads up: the F7 keyboard shortcut is not a default for this one anymore).&lt;/p&gt;  &lt;p&gt;8. The core class you’re going to use is called &lt;em&gt;Geolocator&lt;/em&gt;. It’s very similar to &lt;em&gt;GeoCoordinateWatcher&lt;/em&gt; class from Windows Phone, so working with it should be fairly familiar:&lt;/p&gt;  &lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;public sealed class Geolocator : IGeolocator
{
  public Geolocator();
  public PositionAccuracy DesiredAccuracy { get; set; }
  public PositionStatus LocationStatus { get; }
  public double MovementThreshold { get; set; }
  public uint ReportInterval { get; set; }

  public event TypedEventHandler&amp;lt;Geolocator, PositionChangedEventArgs&amp;gt; PositionChanged;
  public event TypedEventHandler&amp;lt;Geolocator, StatusChangedEventArgs&amp;gt; StatusChanged;
  public GetGeopositionOperation GetGeopositionAsync();
}&lt;/pre&gt;

&lt;p&gt;Similar to &lt;em&gt;GeoCoordinateWatcher&lt;/em&gt;, it has &lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;DesiredAccuracy (Default, High),&lt;/li&gt;

  &lt;li&gt;LocationStatus (Ready, Initializing, NoData, Disabled, &lt;strong&gt;NotInitialized&lt;/strong&gt;, &lt;strong&gt;NotAvailable&lt;/strong&gt;) – with two new values,&lt;/li&gt;

  &lt;li&gt;MovementTreshold,&lt;/li&gt;

  &lt;li&gt;PositionChanged and StatusChanged events,&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;New in &lt;em&gt;Geolocator&lt;/em&gt; are:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;ReportInterval – the requested minimum time interval between location updates,&lt;/li&gt;

  &lt;li&gt;GetGeopositionAsync() – single call method for asynchronous request for location data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;font face="Calibri"&gt;Noticed the TypedEventHandler event declarations above? What are those? Let’s continue with the example…&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font face="Calibri"&gt;9. Set up the Loaded event handler and paste the following code into it:&lt;/font&gt;&lt;/p&gt;

&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;Geolocator locator = new Geolocator();
locator.PositionChanged +=&lt;br /&gt;  new TypedEventHandler&amp;lt;Geolocator, PositionChangedEventArgs&amp;gt;(OnPositionChanged);&lt;/pre&gt;

&lt;p&gt;OnPositionChanged event handler signature is as follows:&lt;/p&gt;

&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;void OnPositionChanged(Geolocator sender, PositionChangedEventArgs args)
{
}&lt;/pre&gt;

&lt;p&gt;To reflect the TypedEventHandler, you can see that sender is no more a plain object, it’s typed! That means no more unnecessary casting and your code is a tad more error-prone.&lt;/p&gt;

&lt;p&gt;10. PositionChangedEventArgs holds a reference to a Geoposition, which is declared as:&lt;/p&gt;

&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;public sealed class Geoposition : IGeoposition
{
    public CivicAddress CivicAddress { get; }
    public Geocoordinate Coordinate { get; }
}&lt;/pre&gt;

&lt;p&gt;While Geocoordinate is similar to GeoCoordinate from Windows Phone (Latitude, Longitude, Altitude, Speed, Heading, Accuracy, etc.), the CivicAddress should contain address data, associated with the reported Geocoordinate. I’m saying “should” because from all address properties (City, Country, PostalCode, State) for my current location (Ljubljana, Slovenia), the API only returns my country code (SI). I’m interested to hear how the same API behaves in other locations around the world so if you’re using it, please let me know.&lt;/p&gt;

&lt;p&gt;11. If you try setting the Status label text in the OnPositionChanged event handler, you’ll get the invalid cross-thread exception and that’s because the event gets kicked on the background thread. In order to set the text, you have to invoke that on the UI thread, using the dispatcher. This is the part where things seems to differ the most. There’s a new dispatcher called CoreDispatcher. Declare it on the class level and set to page’s Dispatcher property in page’s constructor. That will guarantee you you can use it from the background thread.&lt;/p&gt;

&lt;p&gt;So here’s the full MainPage code:&lt;/p&gt;

&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;partial class MainPage
{
    CoreDispatcher dispatcher;

    public MainPage()
    {
        InitializeComponent();
        dispatcher = Dispatcher;
        Loaded += new RoutedEventHandler(OnLoaded);
    }

    void OnLoaded(object sender, RoutedEventArgs e)
    {
        Geolocator locator = new Geolocator();
        locator.PositionChanged += 
            new TypedEventHandler&amp;lt;Geolocator, PositionChangedEventArgs&amp;gt;(OnPositionChanged);
    }

    void OnPositionChanged(Geolocator sender, PositionChangedEventArgs args)
    {
        dispatcher.InvokeAsync(CoreDispatcherPriority.Normal, DisplayLocation, this, args);
    }

    void DisplayLocation(object sender, InvokedHandlerArgs e)
    {
        IPositionChangedEventArgs args = e.Context as IPositionChangedEventArgs;
        Status.Text = string.Format(&amp;quot;Country:{0} Lat: {1} Lng: {2}&amp;quot;, 
            args.Position.CivicAddress.Country, args.Position.Coordinate.Latitude, 
            args.Position.Coordinate.Longitude);
    }
}&lt;/pre&gt;

&lt;p&gt;12. You can simplify the InvokeAsync code by using a lambda expression, though it may be a bit harder to read and/or debug:&lt;/p&gt;

&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;void OnPositionChanged(Geolocator sender, PositionChangedEventArgs args)
{
    dispatcher.InvokeAsync(CoreDispatcherPriority.Normal,
        (s, a) =&amp;gt;
        {
            Status.Text = string.Format(&amp;quot;Country:{0} Lat: {1} Lng: {2}&amp;quot;, 
                args.Position.CivicAddress.Country, 
                args.Position.Coordinate.Latitude, 
                args.Position.Coordinate.Longitude);
        }
        , this, args);
}&lt;/pre&gt;

&lt;p&gt;13. Now try to run the project. This is what you should see:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://tozon.info/images/blog/Windows-8-geolocation_8792/image_6.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/Windows-8-geolocation_8792/image_thumb_6.png" width="600" height="338" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Windows is asking you if this application can use your Location. If user chooses Block, application’s request to access the location is denied. No errors or exceptions would be thrown, it just wouldn’t work. If user allows the access, the app will work as expected.&lt;/p&gt;

&lt;p&gt;Note: the user can change this permission any time through the Settings charm: When application is running, move your mouse to the bottom left corner – the menu, similar to start screen should appear.&lt;/p&gt;

&lt;p align="center"&gt;&lt;a href="http://tozon.info/images/blog/Windows-8-geolocation_8792/image_7.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/Windows-8-geolocation_8792/image_thumb_7.png" width="600" height="82" /&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p align="left"&gt;Click Settings and notice the right side bar. Click on the “Control system access for [YourAppName]” – you can change the access settings from there&lt;/p&gt;

&lt;p align="center"&gt;&lt;a href="http://tozon.info/images/blog/Windows-8-geolocation_8792/image_8.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/Windows-8-geolocation_8792/image_thumb_8.png" width="161" height="400" /&gt;&lt;/a&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;a href="http://tozon.info/images/blog/Windows-8-geolocation_8792/image_9.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/Windows-8-geolocation_8792/image_thumb_9.png" width="158" height="400" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p align="left"&gt;If you want to test for access availability status from within the app, check &lt;em&gt;Geolocator&lt;/em&gt;’s LocationStatus. In case the location access is disabled, it should be set to NotInitialized (although I expected Disabled).&lt;/p&gt;

&lt;p align="left"&gt;Another fun fact is that Geolocator is not initialized on it’s instantiation, but only when you actually do something with it. In this case, it initializes when you subscribe to the PositionChanged event. This is also the same code line that will cause application (or Windows RunTime) to pop up that permissions dialog from above. After that line, the LocationStatus should be set to a valid status (Ready if access to location is enabled and NotInitialized if it’s not).&lt;/p&gt;

&lt;p align="left"&gt;Note: Windows will only ask you for permission the first time it’s required. After that, it’s on user to change this permission. But if you want to test this, go to the Application manifest, Capabilities tab, and re-check the &lt;em&gt;Location&lt;/em&gt; capability – that should reset the prompt.&lt;/p&gt;

&lt;p align="left"&gt;But we’re not done yet.&lt;/p&gt;

&lt;p align="left"&gt;Subscribing to PositionChanged event will ensure the event handler will be called each time Position is “changed” (that actually depends on your &lt;em&gt;Geolocator&lt;/em&gt;’s MovementTreshold and ReportInterval property settings). To stop listening to position changes, you can simply unsubscribe from the PositionChanged event.&lt;/p&gt;

&lt;p align="left"&gt;But… In a lot of cases, we only want to determine the current location once, instead of continuously tracking it. Fortunately, GetGeopositionAsync method does just that – retrieves the current position and it does it in the asynchronous manner (as suggested by Async method suffix by proposed convention).&lt;/p&gt;

&lt;p align="left"&gt;And guess what? &lt;strong&gt;Async&lt;/strong&gt; methods are unbelievable easy to handle with the new &lt;strong&gt;async&lt;/strong&gt; / &lt;strong&gt;await&lt;/strong&gt; keyword pair. Let’s give it a try.&lt;/p&gt;

&lt;p align="left"&gt;14. Change the OnLoaded event handler too look like this:&lt;/p&gt;

&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;async void OnLoaded(object sender, RoutedEventArgs e)
{
    Geolocator locator = new Geolocator();
    Geoposition position = await locator.GetGeopositionAsync();
    Status.Text = string.Format(&amp;quot;Country:{0} Lat: {1} Lng: {2}&amp;quot;,
        position.CivicAddress.Country, 
        position.Coordinate.Latitude, 
        position.Coordinate.Longitude);
}&lt;/pre&gt;

&lt;p&gt;Geolocator is instantiated as before, but the current position is accessed through the GetGeoPositionAsync() method. And notice how that method is decorated with the await keyword and the whole OnLoaded method with async. The principle will also guarantee you that your code, after that async call, can safely call into the UI thread. No dispatcher needed. And from what I know, there are many async method scattered around the new runtime, it will just make coding so much easier, not to mention the new responsive UI.&lt;/p&gt;

&lt;h2&gt;Wrapping up&lt;/h2&gt;

&lt;p&gt;That’s it! My first experience with the new API. So far I love it but porting existing and building new applications will eventually show its real value.&lt;/p&gt;

&lt;p&gt;And to just briefly touch on the current hot topic – I really think that desktop application development has just shifted gears, although it’ll take some time to lift off the ground. What we’re looking at is an early preview and it will take some time till release, and event more to a broad Windows 8 adoption.&lt;/p&gt;

&lt;p&gt;If you have any comments, questions, suggestions for future posts on the subject, any feedback at all, do not hesitate to contact me.&lt;/p&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt; tweetmeme_url = 'http://tozon.info/blog/post/2011/09/15/Windows-8-geolocation-API-First-run.aspx'; tweetmeme_source = 'andrejt'; &lt;/script&gt; &lt;script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;div id="AdnBottom"&gt;&lt;div class="AdnBottomLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnBottomRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=9iBjkPxdDj0:5iglurSld9s:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=9iBjkPxdDj0:5iglurSld9s:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=9iBjkPxdDj0:5iglurSld9s:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=9iBjkPxdDj0:5iglurSld9s:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=9iBjkPxdDj0:5iglurSld9s:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=9iBjkPxdDj0:5iglurSld9s:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=9iBjkPxdDj0:5iglurSld9s:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=9iBjkPxdDj0:5iglurSld9s:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=9iBjkPxdDj0:5iglurSld9s:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=9iBjkPxdDj0:5iglurSld9s:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=9iBjkPxdDj0:5iglurSld9s:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=9iBjkPxdDj0:5iglurSld9s:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=9iBjkPxdDj0:5iglurSld9s:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=9iBjkPxdDj0:5iglurSld9s:V-t1I-SPZMU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=V-t1I-SPZMU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=9iBjkPxdDj0:5iglurSld9s:Jwdi1b3fU3Q"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=Jwdi1b3fU3Q" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TheAttic/~4/9iBjkPxdDj0" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheAttic/~3/9iBjkPxdDj0/post.aspx</link>
      <comments>http://www.tozon.info/blog/post/2011/09/15/Windows-8-geolocation-API-First-run.aspx#comment</comments>
      <guid isPermaLink="false">http://www.tozon.info/blog/post.aspx?id=e9bbf6d4-121c-44eb-94b1-33bcfd4bb333</guid>
      <pubDate>Thu, 15 Sep 2011 11:13:24 +0100</pubDate>
      <category>Development</category>
      <category>Geolocation</category>
      <category>Windows 8</category>
      <category>WinRT</category>
      <dc:publisher>andrej</dc:publisher>
      <pingback:server>http://www.tozon.info/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.tozon.info/blog/post.aspx?id=e9bbf6d4-121c-44eb-94b1-33bcfd4bb333</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.tozon.info/blog/trackback.axd?id=e9bbf6d4-121c-44eb-94b1-33bcfd4bb333</trackback:ping>
      <wfw:comment>http://www.tozon.info/blog/post/2011/09/15/Windows-8-geolocation-API-First-run.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.tozon.info/blog/syndication.axd?post=e9bbf6d4-121c-44eb-94b1-33bcfd4bb333</wfw:commentRss>
    <feedburner:origLink>http://www.tozon.info/blog/post.aspx?id=e9bbf6d4-121c-44eb-94b1-33bcfd4bb333</feedburner:origLink></item>
    <item>
      <title>Bikes, a Windows Phone application for bike sharing systems</title>
      <description>&lt;div id="AdnTop"&gt;&lt;div class="AdnTopLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnTopRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;My latest Windows Phone application found its way to the Microsoft marketplace.&lt;/p&gt;  &lt;p&gt;Bikes is designed to help bicyclists that use city bicycle sharing systems across Europe to find nearest stations, provide some basic info about available bikes and free parking slots for each of those stations.&lt;/p&gt;  &lt;p&gt;Here’s a short video:&lt;/p&gt; &lt;iframe height="345" src="http://www.youtube.com/embed/XCyMt4uGvRQ" frameborder="0" width="420" allowfullscreen="allowfullscreen"&gt;&lt;/iframe&gt;  &lt;p&gt;[Short note: the video about shows how the next version will look like (v1.0.1), current marketplace version is v1.0.0]&lt;/p&gt;  &lt;p&gt;The main purpose I’ve decided to create this app was to support the new bicycle sharing system in my city (started May this year), but since the same system is use in other (mostly) European cities as well, I added some of those as well. I’m planning to support other systems and adding more cities in future releases.&lt;/p&gt;  &lt;p&gt;You can follow the following twitter account – &lt;a href="http://twitter.com/#!/bikeswp7" target="_blank"&gt;bikeswp7&lt;/a&gt; – for latest news regarding the app, send suggestions, bug reports and any comments you have.&lt;/p&gt;  &lt;p&gt;You can download application &lt;a href="zune://navigate/?appID=af46d34c-d787-4942-a0ee-338118f1e508" target="_blank"&gt;directly from the marketplace&lt;/a&gt;. If you can’t access the Marketplace link with your desktop browser, here’s &lt;a href="http://www.windowsphonegeek.com/AppHub/Application/af46d34c-d787-4942-a0ee-338118f1e508" target="_blank"&gt;another link&lt;/a&gt;.&lt;/p&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt; tweetmeme_url = 'http://tozon.info/blog/post/2011/08/22/Bikes-a-Windows-Phone-application-for-bike-sharing-systems.aspx'; tweetmeme_source = 'andrejt'; &lt;/script&gt; &lt;script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;div id="AdnBottom"&gt;&lt;div class="AdnBottomLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnBottomRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=7KgoxQUnsmQ:bm3UpBO06xU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=7KgoxQUnsmQ:bm3UpBO06xU:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=7KgoxQUnsmQ:bm3UpBO06xU:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=7KgoxQUnsmQ:bm3UpBO06xU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=7KgoxQUnsmQ:bm3UpBO06xU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=7KgoxQUnsmQ:bm3UpBO06xU:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=7KgoxQUnsmQ:bm3UpBO06xU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=7KgoxQUnsmQ:bm3UpBO06xU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=7KgoxQUnsmQ:bm3UpBO06xU:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=7KgoxQUnsmQ:bm3UpBO06xU:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=7KgoxQUnsmQ:bm3UpBO06xU:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=7KgoxQUnsmQ:bm3UpBO06xU:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=7KgoxQUnsmQ:bm3UpBO06xU:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=7KgoxQUnsmQ:bm3UpBO06xU:V-t1I-SPZMU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=V-t1I-SPZMU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=7KgoxQUnsmQ:bm3UpBO06xU:Jwdi1b3fU3Q"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=Jwdi1b3fU3Q" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TheAttic/~4/7KgoxQUnsmQ" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheAttic/~3/7KgoxQUnsmQ/post.aspx</link>
      <comments>http://www.tozon.info/blog/post/2011/08/22/Bikes-a-Windows-Phone-application-for-bike-sharing-systems.aspx#comment</comments>
      <guid isPermaLink="false">http://www.tozon.info/blog/post.aspx?id=7888f727-4678-452a-bd19-0dc5778ec95e</guid>
      <pubDate>Mon, 22 Aug 2011 11:37:37 +0100</pubDate>
      <category>WP7</category>
      <dc:publisher>andrej</dc:publisher>
      <pingback:server>http://www.tozon.info/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.tozon.info/blog/post.aspx?id=7888f727-4678-452a-bd19-0dc5778ec95e</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.tozon.info/blog/trackback.axd?id=7888f727-4678-452a-bd19-0dc5778ec95e</trackback:ping>
      <wfw:comment>http://www.tozon.info/blog/post/2011/08/22/Bikes-a-Windows-Phone-application-for-bike-sharing-systems.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.tozon.info/blog/syndication.axd?post=7888f727-4678-452a-bd19-0dc5778ec95e</wfw:commentRss>
    <feedburner:origLink>http://www.tozon.info/blog/post.aspx?id=7888f727-4678-452a-bd19-0dc5778ec95e</feedburner:origLink></item>
    <item>
      <title>Localizing the August 2011 Windows Phone Toolkit</title>
      <description>&lt;div id="AdnTop"&gt;&lt;div class="AdnTopLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnTopRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Great news! A new version of Windows Phone Toolkit was released today. These bits target the “Mango” OS (which translates to SDK v7.1). The “pre-Mango” version (7.0) will follow in a short-while.&lt;/p&gt;  &lt;p&gt;Download the Toolkit from &lt;a href="http://silverlight.codeplex.com/releases/view/71550" target="_blank"&gt;Codeplex&lt;/a&gt;. Available also on &lt;a href="http://nuget.org/List/Packages/SilverlightToolkitWP" target="_blank"&gt;NuGet&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;One of the new features coming with this release is localization support. Localized strings are there mostly to support brand new Date and Time converters, but they also include a few strings used by Date and Time picker controls that were available in the previous release.&lt;/p&gt;  &lt;p&gt;The strings are localized to 22 languages that are the languages, available the “Mango” OS. Chances are you’re going to be writing an application localized to a “non-Mango” language (yes, there are us who are still waiting!), so here’s a tip how to extend the toolkit localization features to your “unsupported” language. I’ll be using the Slovenian (my native) language as the example.&lt;/p&gt;  &lt;p&gt;1. Download the toolkit binaries and source code from &lt;a href="http://silverlight.codeplex.com/releases/view/71550" target="_blank"&gt;Codeplex&lt;/a&gt;:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Binaries [&lt;a href="http://silverlight.codeplex.com/releases/view/71550#DownloadId=270984"&gt;Silverlight for Windows Phone Toolkit - Aug 2011.msi&lt;/a&gt;] &lt;/li&gt;    &lt;li&gt;Source code [&lt;a href="http://silverlight.codeplex.com/releases/view/71550#DownloadId=270985"&gt;Silverlight for Windows Phone Toolkit Source &amp;amp; Sample - Aug 2011.zip&lt;/a&gt;] &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;2. Unzip the source code package and open the solution (&lt;strong&gt;PhoneToolkit.sln&lt;/strong&gt;).&lt;/p&gt;  &lt;p&gt;3. In Solution Explorer, locate the &lt;strong&gt;LocalizedResources&lt;/strong&gt; folder. Copy the neutral language (US English) control resources file and rename it by appending target culture code to the filename (sl-SI is for Slovenian language):&lt;/p&gt;  &lt;p&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="loc1" border="0" alt="loc1" src="http://tozon.info/images/blog/Localizing_514/loc1.png" width="234" height="470" /&gt;&lt;/p&gt;  &lt;p&gt;4. Open the new ControlResources file by double clicking on it in Solution Explorer. Managed Resources Editor should appear, listing original strings.&lt;/p&gt;  &lt;p&gt;5. Take some time and translate all strings into the target language. It will probably take an iteration or two to get it right (have to test it in a real case example). In case of Slovenian language, there’s also a slight problem with missing dual&amp;#160; forms (e.g. there are singular and plural, like 1 hour and &amp;gt;1 hours, but I can’t specify the string for 2 hours), plus some other language specifics I have yet to figure out how to work around them.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://tozon.info/images/blog/Localizing_514/loc2.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="loc2" border="0" alt="loc2" src="http://tozon.info/images/blog/Localizing_514/loc2_thumb.png" width="600" height="304" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;6. Build the project. It should compile (make sure you’re using tools for v7.1).&lt;/p&gt;  &lt;p&gt;7. Go to the Bin\Debug folder (or Bin\Release, depending on your build configuration) and locate the sl-SI folder (or the one that matches your culture code). In it, there should be a &lt;strong&gt;Microsoft.Phone.Controls.Toolkit.resources.dll&lt;/strong&gt; file. Copy folder to the safe place on your disk. You’ll need it whenever you start a new project leveraging the Windows Phone Toolkit..&lt;/p&gt;  &lt;p&gt;8. You’re done with the Toolkit. Start a new Windows Phone project, add a reference to the new Toolkit, add resource files, etc., and start developing your localized application.&lt;/p&gt;  &lt;p&gt;9. Because you’re targeting the unsupported language, don’t forget to add the following line to the application start:&lt;/p&gt;  &lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;&lt;/pre&gt;

&lt;p&gt;That’s usually the first line in my App constructor. The other usual localization steps apply: Edit .csproj file to add supported cultures, set the neutral language, …&lt;/p&gt;

&lt;p&gt;10. After building your application, you’ve got the application package (.Xap file). Before deploying it on your device or marketplace, copy the culture-specific folder containing the new localized dll (from step 7) into it. If you’ve chosen English as the neutral language, the folder with your culture code (sl-SI in my case) should already be in place.&lt;/p&gt;

&lt;p&gt;Note: I didn’t have to change the AppManifest.xml file in Xap to include the new localized resource dll, but perhaps it’s a good idea to do so. You may also choose a more convenient method of including the resource file at design time to avoid file copying and changing the manifest file after each build.&lt;/p&gt;

&lt;p&gt;11. That’s it! With localized resource file in place, your application should now display Toolkit’s resources in your own language.&lt;/p&gt;

&lt;p&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="loc3" border="0" alt="loc3" src="http://tozon.info/images/blog/Localizing_514/loc3.png" width="305" height="554" /&gt;&lt;/p&gt;



&lt;p&gt;This is a screen shot from the Sample application that comes with the new Toolkit.&lt;/p&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt; tweetmeme_url = 'http://tozon.info/blog/post/2011/08/18/Localizing-the-August-2011-Windows-Phone-Toolkit.aspx'; tweetmeme_source = 'andrejt'; &lt;/script&gt; &lt;script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;div id="AdnBottom"&gt;&lt;div class="AdnBottomLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnBottomRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=nljZgRReN6U:jyriTWO4-_Y:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=nljZgRReN6U:jyriTWO4-_Y:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=nljZgRReN6U:jyriTWO4-_Y:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=nljZgRReN6U:jyriTWO4-_Y:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=nljZgRReN6U:jyriTWO4-_Y:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=nljZgRReN6U:jyriTWO4-_Y:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=nljZgRReN6U:jyriTWO4-_Y:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=nljZgRReN6U:jyriTWO4-_Y:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=nljZgRReN6U:jyriTWO4-_Y:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=nljZgRReN6U:jyriTWO4-_Y:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=nljZgRReN6U:jyriTWO4-_Y:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=nljZgRReN6U:jyriTWO4-_Y:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=nljZgRReN6U:jyriTWO4-_Y:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=nljZgRReN6U:jyriTWO4-_Y:V-t1I-SPZMU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=V-t1I-SPZMU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=nljZgRReN6U:jyriTWO4-_Y:Jwdi1b3fU3Q"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=Jwdi1b3fU3Q" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TheAttic/~4/nljZgRReN6U" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheAttic/~3/nljZgRReN6U/post.aspx</link>
      <comments>http://www.tozon.info/blog/post/2011/08/18/Localizing-the-August-2011-Windows-Phone-Toolkit.aspx#comment</comments>
      <guid isPermaLink="false">http://www.tozon.info/blog/post.aspx?id=d5b1bc12-e4c5-439f-8549-ccaa25586cfb</guid>
      <pubDate>Thu, 18 Aug 2011 00:53:37 +0100</pubDate>
      <category>Development</category>
      <category>Silverlight</category>
      <category>WP7</category>
      <dc:publisher>andrej</dc:publisher>
      <pingback:server>http://www.tozon.info/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.tozon.info/blog/post.aspx?id=d5b1bc12-e4c5-439f-8549-ccaa25586cfb</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.tozon.info/blog/trackback.axd?id=d5b1bc12-e4c5-439f-8549-ccaa25586cfb</trackback:ping>
      <wfw:comment>http://www.tozon.info/blog/post/2011/08/18/Localizing-the-August-2011-Windows-Phone-Toolkit.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.tozon.info/blog/syndication.axd?post=d5b1bc12-e4c5-439f-8549-ccaa25586cfb</wfw:commentRss>
    <feedburner:origLink>http://www.tozon.info/blog/post.aspx?id=d5b1bc12-e4c5-439f-8549-ccaa25586cfb</feedburner:origLink></item>
    <item>
      <title>On a path to a generic About page</title>
      <description>&lt;div id="AdnTop"&gt;&lt;div class="AdnTopLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnTopRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Since every Windows Phone application should have some kind of About page, I wanted to see if I could build a generic page that I would reuse in my other apps. These are a few tips I picked up during building such a page:&lt;/p&gt;  &lt;p&gt;1. The About page is rarely accessed so I put it in a separate assembly. This way I took some initial load off the main assembly and the About assembly can now easily be shared with other apps.&lt;/p&gt;  &lt;p&gt;2. If you want to display the application icon on your About page, there is no need to create new graphics. Depending on your target size, you can choose from either ApplicationIcon.png (62x62) or Background.png (173x173) icons. To put the icon on your About page, use:&lt;/p&gt;  &lt;pre class="brush: xml; gutter: false; toolbar: false;"&gt;&amp;lt;Image Source=&amp;quot;/ApplicationIcon.png&amp;quot; Stretch=&amp;quot;None&amp;quot; /&amp;gt;&lt;/pre&gt;

&lt;p&gt;And of course you can specify your own size and adjust the stretching attribute. &lt;/p&gt;

&lt;p&gt;But don’t worry about the ApplicationIcon.png not being included in the About page project. With application icons being marked as Content, the contents of a Xap should look something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://tozon.info/images/blog/On-a-path-to-a-generic-About-page_BD74/image.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://tozon.info/images/blog/On-a-path-to-a-generic-About-page_BD74/image_thumb.png" width="244" height="212" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By specifying an external link reference to the ApplicationIcon.png, the icon will be displayed regardless of it not being part of the project that contains it.&lt;/p&gt;

&lt;p&gt;3. Static text. This includes titles, labels and text that will likely be the same across every application. If you’re not localizing your apps, you may as be well hard-coding strings into your XAML. But if you are, you would most definitely want to pull them from your resource files. In latter case, the standard localization guidelines apply. Again, don’t worry if your if your localization files are in your main assembly. The application will pick them up correctly regardless (even at design time).&lt;/p&gt;

&lt;pre class="brush: xml; gutter: false; toolbar: false;"&gt;&amp;lt;TextBlock x:Name=&amp;quot;PageTitle&amp;quot; 
           Text=&amp;quot;{Binding Strings.AboutTitle, 
                  Source={StaticResource LanguageResources}}&amp;quot; 
           Margin=&amp;quot;9,-7,0,0&amp;quot; 
           Style=&amp;quot;{StaticResource PhoneTextTitle1Style}&amp;quot;/&amp;gt;&lt;/pre&gt;

&lt;p&gt;4. Dynamic text. This includes the version number, application title and other text that will be unique to every application or its version. Some of these texts could be stored in resource files as well, but let’s look at the alternative options.&lt;/p&gt;

&lt;p&gt;If you take a look at the AssemblyInfo.cs file of your main project (you’ll find it in the Properties folder), you’ll see it’s populated with some weird assembly attributes you don’t even care about (that’s because you’re setting and changing them from Visual Studio’s dedicated project properties page, but that’s not the point). 
  &lt;br /&gt;The point is that you can access all of these strings from code. All you have to do is get to the main assembly and read its custom attributes (which is what those lines from the AssemblyInfo file really). Here’s how:&lt;/p&gt;

&lt;h2&gt;Getting the main / entry assembly&lt;/h2&gt;

&lt;p&gt;The first thing is getting access to the correct – main (or entry) assembly. There are many ways to do that. At least one of those listed below should play nice with your your application architecture :&lt;/p&gt;

&lt;p&gt;&lt;font face="Courier New"&gt;Assembly.GetExecutingAssembly()&lt;/font&gt; will get a reference to an assembly that’s executing that same code. &lt;/p&gt;

&lt;p&gt;&lt;font face="Courier New"&gt;Assembly.GetCallingAssembly()&lt;/font&gt;will get a reference to an assembly of the method that called into this code. &lt;/p&gt;

&lt;p&gt;The above methods don’t work well if the call is originating from the same dll. Exploring further…&lt;/p&gt;

&lt;p&gt;&lt;font face="Courier New"&gt;Deployment.Current.EntryPointAssembly&lt;/font&gt; returns a name of the main assembly in pure string. You can use that to load the assembly with &lt;font face="Courier New"&gt;&lt;span style="color: "&gt;Assembly.Load(System.Windows.Deployment.Current.EntryPointAssembly)&lt;/span&gt;&lt;/font&gt;. This will get you the main assembly, but it doesn’t feel right, so I finally settled with:&lt;/p&gt;

&lt;p&gt;&lt;font face="Courier New"&gt;Application.Current.GetType().Assembly&lt;/font&gt; depends on using the Application static class, but since this is only used for a simple About page, that shouldn’t be&amp;#160; a significant problem.&lt;/p&gt;

&lt;h2&gt;Reading the attributes&lt;/h2&gt;

&lt;p&gt;I created the following helper method to read the attributes off an assembly:&lt;/p&gt;

&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;private string GetAttribute&amp;lt;T&amp;gt;(Func&amp;lt;T, string&amp;gt; selector)
    where T: Attribute
{
    object[] attributes = assembly.GetCustomAttributes(typeof(T), true);
    if (attributes.Length == 0)
    {
        return &amp;quot;N/A&amp;quot;;
    }
    T attribute = attributes[0] as T;
    return attribute == null ? &amp;quot;N/A&amp;quot; : selector(attribute);
}&lt;/pre&gt;

&lt;p&gt;GetCustomAttributes method overload above will return the only specified type of attribute you’re requesting, and the selector Func will read the value off of it. In the example of getting the Version attribute, here’s how you would use the function:&lt;/p&gt;

&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;private string version;
public string Version
{
  get 
  {
    return version ?? 
      (version = GetAttribute&amp;lt;AssemblyFileVersionAttribute&amp;gt;(a =&amp;gt; a.Version)); 
  }
}&lt;/pre&gt;

&lt;p&gt;For the application title, you would use the AssemblyTitle attribute:&lt;/p&gt;

&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;private string title;
public string Title
{
  get 
  {
    return title ?? 
       (title = GetAttribute&amp;lt;AssemblyTitleAttribute&amp;gt;(a =&amp;gt; a.Title)); 
  }
}&lt;/pre&gt;

&lt;p&gt;And so on…&lt;/p&gt;

&lt;p&gt;And if you’d like, you can even create your own attributes, for example:&lt;/p&gt;

&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;[AttributeUsage(AttributeTargets.Assembly, Inherited = false)]
[ComVisible(true)]
public class AssemblyContactAttribute : Attribute
{
    public string Email { get; private set; }
    public AssemblyContactAttribute(string email)
    {
        Email = email;
    }
}&lt;/pre&gt;

&lt;p&gt;Put that into the AssemblyInfo.cs file, as seen with other assembly attributes:&lt;/p&gt;

&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;[assembly: AssemblyContact(&amp;quot;myapp@tozon.info&amp;quot;)]&lt;/pre&gt;

&lt;p&gt;and use the GetAttribute method similar to above examples.&lt;/p&gt;

&lt;p&gt;You have just decorated your assembly with a new custom attribute that you can pull out at runtime.&lt;/p&gt;

&lt;p&gt;By following those four points I was able to completely isolate my About page from main app(s) and adding the About page in my new apps is a matter of seconds. There is some convention involved of course (like the name of resources reference holding class), but I don’t see this as a problem. What do you think?&lt;/p&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt; tweetmeme_url = 'http://tozon.info/blog/post/2011/08/16/On-a-path-to-a-generic-About-page.aspx'; tweetmeme_source = 'andrejt'; &lt;/script&gt; &lt;script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;div id="AdnBottom"&gt;&lt;div class="AdnBottomLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnBottomRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=DBfAGe96uqQ:KwSOGh90zSc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=DBfAGe96uqQ:KwSOGh90zSc:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=DBfAGe96uqQ:KwSOGh90zSc:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=DBfAGe96uqQ:KwSOGh90zSc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=DBfAGe96uqQ:KwSOGh90zSc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=DBfAGe96uqQ:KwSOGh90zSc:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=DBfAGe96uqQ:KwSOGh90zSc:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=DBfAGe96uqQ:KwSOGh90zSc:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=DBfAGe96uqQ:KwSOGh90zSc:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=DBfAGe96uqQ:KwSOGh90zSc:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=DBfAGe96uqQ:KwSOGh90zSc:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=DBfAGe96uqQ:KwSOGh90zSc:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=DBfAGe96uqQ:KwSOGh90zSc:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=DBfAGe96uqQ:KwSOGh90zSc:V-t1I-SPZMU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=V-t1I-SPZMU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=DBfAGe96uqQ:KwSOGh90zSc:Jwdi1b3fU3Q"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=Jwdi1b3fU3Q" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TheAttic/~4/DBfAGe96uqQ" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheAttic/~3/DBfAGe96uqQ/post.aspx</link>
      <comments>http://www.tozon.info/blog/post/2011/08/16/On-a-path-to-a-generic-About-page.aspx#comment</comments>
      <guid isPermaLink="false">http://www.tozon.info/blog/post.aspx?id=6f6302a6-d33a-498a-a25f-f1007c5d7d62</guid>
      <pubDate>Tue, 16 Aug 2011 22:48:41 +0100</pubDate>
      <category>Development</category>
      <category>Silverlight</category>
      <category>WP7</category>
      <dc:publisher>andrej</dc:publisher>
      <pingback:server>http://www.tozon.info/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.tozon.info/blog/post.aspx?id=6f6302a6-d33a-498a-a25f-f1007c5d7d62</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.tozon.info/blog/trackback.axd?id=6f6302a6-d33a-498a-a25f-f1007c5d7d62</trackback:ping>
      <wfw:comment>http://www.tozon.info/blog/post/2011/08/16/On-a-path-to-a-generic-About-page.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.tozon.info/blog/syndication.axd?post=6f6302a6-d33a-498a-a25f-f1007c5d7d62</wfw:commentRss>
    <feedburner:origLink>http://www.tozon.info/blog/post.aspx?id=6f6302a6-d33a-498a-a25f-f1007c5d7d62</feedburner:origLink></item>
    <item>
      <title>Windows Phone Pivot and loading content</title>
      <description>&lt;div id="AdnTop"&gt;&lt;div class="AdnTopLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnTopRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Rewatching the Windows Phone Application Performance MIX10 talk by &lt;a href="http://www.jeff.wilcox.name/" target="_blank"&gt;Jeff Wilcox&lt;/a&gt;, I took a note of one particular part where he clearly answers a question I’ve been asked a few times by now already. This question is based around the confusing statement that Pivot controls are supposed to be lazy loading their content pages, in contrast to Panoramas, which, at startup, would load all pages at once. The part that confuses developers the most is that when they start debugging their apps, they find out that Pivots load all their pages at startup too! How come? Aren’t Pivots loading pages only when needed?&lt;/p&gt;  &lt;p&gt;Jeff explains this very clearly (fast forward to approx. minute 25) : “So the instant you go to a page, we pop up the Pivot, we’ll load&amp;#160; the content there. … …&amp;#160; Trouble is, we need to load more, because we want to provide a smooth experience when you pivot around. So we’re actually also loading, &lt;strong&gt;right after that first page comes up, we’ll kick off a load for both items on the left and the right.&lt;/strong&gt;”&lt;/p&gt;  &lt;p&gt;See Jeff’s talk on the &lt;a href="http://channel9.msdn.com/events/MIX/MIX11/DVC01" target="_blank"&gt;Channel 9 site&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;What this means is that if your Pivot has only 2 or 3 pages, the startup performance won’t be that much different than when using a Panorama. If those 3 content pages are heavy on the load, use a lot of bindings etc., you can get into trouble. In some cases, loading a single content page on startup (and the rest when pivoted to) might actually result in a better experience than preloading all 3 pages.&lt;/p&gt;  &lt;p&gt;Is there a way to override the default Pivot behavior and load only one content page on startup?&lt;/p&gt;  &lt;p&gt;Of course there is.&lt;/p&gt;  &lt;p&gt;The trick is to create a user control for each content page (which is a good idea anyway) and start it off with a Pivot control by specifying empty pages:&lt;/p&gt;  &lt;pre class="brush: xml; gutter: false; toolbar: false;"&gt;&amp;lt;controls:Pivot Title=&amp;quot;My Pivot&amp;quot;
                LoadingPivotItem=&amp;quot;OnLoadingPivotItem&amp;quot;&amp;gt;
    &amp;lt;controls:PivotItem Header=&amp;quot;Page 1&amp;quot; /&amp;gt;
    &amp;lt;controls:PivotItem Header=&amp;quot;Page 2&amp;quot; /&amp;gt;
    &amp;lt;controls:PivotItem Header=&amp;quot;Page 3&amp;quot; /&amp;gt;
&amp;lt;/controls:Pivot&amp;gt;&lt;/pre&gt;

&lt;p&gt;The &lt;em&gt;LoadingPivotItem&lt;/em&gt; event will fire each time the Pivot would load a new content page. From &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.phone.controls.pivot.loadingpivotitem(v=VS.92).aspx" target="_blank"&gt;MSDN documentation&lt;/a&gt;: “[&lt;em&gt;LoadingPivotItem is an&lt;/em&gt;] Event for offering an opportunity to dynamically load or change the content of a pivot item before it is displayed.”&lt;/p&gt;

&lt;p&gt;What you do during this event is check whether the content is loaded yet and if it isn’t, kick off the load. Something like:&lt;/p&gt;

&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;private void OnLoadingPivotItem(object sender, PivotItemEventArgs e)
{
    if (e.Item.Content != null)
    {
        // Content loaded already
        return;
    }

    Pivot pivot = (Pivot)sender;

    if (e.Item == pivot.Items[0])
    {
        e.Item.Content = new Page1Control();
    }
    else if (e.Item == pivot.Items[1])
    {
        e.Item.Content = new Page2Control();
    }
    else if (e.Item == pivot.Items[2])
    {
        e.Item.Content = new Page3Control();
    }
}&lt;/pre&gt;

&lt;p&gt;One thing to have in mind though: make sure that any data you want to display on those content pages are loaded on the background thread (again – always a good idea) to allow the pages to load as quickly as possible.&lt;/p&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt; tweetmeme_url = 'http://tozon.info/blog/post/2011/08/12/Windows-Phone-Pivot-and-loading-content.aspx'; tweetmeme_source = 'andrejt'; &lt;/script&gt; &lt;script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;div id="AdnBottom"&gt;&lt;div class="AdnBottomLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnBottomRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=O0QOFf-gWL8:notICsEWdSo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=O0QOFf-gWL8:notICsEWdSo:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=O0QOFf-gWL8:notICsEWdSo:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=O0QOFf-gWL8:notICsEWdSo:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=O0QOFf-gWL8:notICsEWdSo:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=O0QOFf-gWL8:notICsEWdSo:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=O0QOFf-gWL8:notICsEWdSo:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=O0QOFf-gWL8:notICsEWdSo:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=O0QOFf-gWL8:notICsEWdSo:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=O0QOFf-gWL8:notICsEWdSo:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=O0QOFf-gWL8:notICsEWdSo:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=O0QOFf-gWL8:notICsEWdSo:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=O0QOFf-gWL8:notICsEWdSo:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=O0QOFf-gWL8:notICsEWdSo:V-t1I-SPZMU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=V-t1I-SPZMU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=O0QOFf-gWL8:notICsEWdSo:Jwdi1b3fU3Q"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=Jwdi1b3fU3Q" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TheAttic/~4/O0QOFf-gWL8" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheAttic/~3/O0QOFf-gWL8/post.aspx</link>
      <comments>http://www.tozon.info/blog/post/2011/08/12/Windows-Phone-Pivot-and-loading-content.aspx#comment</comments>
      <guid isPermaLink="false">http://www.tozon.info/blog/post.aspx?id=e3a7b9e0-01cb-4fc5-9254-c5af1033e2b2</guid>
      <pubDate>Fri, 12 Aug 2011 09:37:28 +0100</pubDate>
      <category>Development</category>
      <category>Silverlight</category>
      <category>WP7</category>
      <category>User Experience</category>
      <dc:publisher>andrej</dc:publisher>
      <pingback:server>http://www.tozon.info/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.tozon.info/blog/post.aspx?id=e3a7b9e0-01cb-4fc5-9254-c5af1033e2b2</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.tozon.info/blog/trackback.axd?id=e3a7b9e0-01cb-4fc5-9254-c5af1033e2b2</trackback:ping>
      <wfw:comment>http://www.tozon.info/blog/post/2011/08/12/Windows-Phone-Pivot-and-loading-content.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.tozon.info/blog/syndication.axd?post=e3a7b9e0-01cb-4fc5-9254-c5af1033e2b2</wfw:commentRss>
    <feedburner:origLink>http://www.tozon.info/blog/post.aspx?id=e3a7b9e0-01cb-4fc5-9254-c5af1033e2b2</feedburner:origLink></item>
    <item>
      <title>NTK2011: Slides and sample code: MVVM</title>
      <description>&lt;div id="AdnTop"&gt;&lt;div class="AdnTopLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnTopRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;MVVM is a topic that can easily take hours of discussion. Unfortunately, I only had less then one to talk about (at least some of) its goals, parts and possible implementations. Below is my slide deck:&lt;/p&gt;  &lt;div align="center"&gt;   &lt;div style="width: 510px" id="__ss_8263039"&gt;     &lt;p align="center"&gt;&lt;object id="__sse8263039" width="510" height="426"&gt; &lt;param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=mvvm-110609141150-phpapp01&amp;amp;rel=0&amp;amp;stripped_title=mvvm-modelviewviewmodel&amp;amp;userName=andrejt" /&gt; &lt;param name="allowFullScreen" value="true" /&gt; &lt;param name="allowScriptAccess" value="always" /&gt; &lt;embed name="__sse8263039" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=mvvm-110609141150-phpapp01&amp;amp;rel=0&amp;amp;stripped_title=mvvm-modelviewviewmodel&amp;amp;userName=andrejt" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="510" height="426"&gt;&lt;/embed&gt; &lt;/object&gt;&lt;/p&gt;   &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;And the code: &lt;a href="http://cid-d34608bce9688fba.office.live.com/self.aspx/Public/Presentations/NTK2011/NTK.MVVM.zip" target="_blank"&gt;download&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The code is structured in a way that helps you see the changes in the code while progressing through the samples. Just follow the numbers (e.g. MainPage1, MainPage2, and so on). It’s mainly Silverlight code, with the last example being example of an easy transition to Windows Phone.&lt;/p&gt;  &lt;p&gt;The sample application is a conference app that lets you see available sessions. I removed the online data endpoint so the online samples won’t work, but you’ll get the feel using the offline data provider. Speaking of data providers, there are three (online/Ntk, using OData endpoint, Offline (loads Xml file from resources), and Json (same as Ntk, just for getting data in Json format – you know, for the phone &lt;img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-winkingsmile" alt="Winking smile" src="http://tozon.info/images/blog/NTK2011-Slides-and-sample-code_1289C/wlEmoticon-winkingsmile.png" /&gt;).&lt;/p&gt;  &lt;p&gt;Once again, I have to stress out that code is for demo purposes only - while it’s minimized one end, it may be overly complicated on the other. Also, Silverlight Toolkit and JSON.NET libraries that were added through &lt;a href="http://nuget.org" target="_blank"&gt;Nuget&lt;/a&gt; are not included in the zip.&lt;/p&gt;  &lt;p&gt;Ah yes, the slides are in Slovenian language.&lt;/p&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt; tweetmeme_url = 'http://tozon.info/blog/post/2011/06/09/NTK2011-Slides-and-sample-code-MVVM.aspx'; tweetmeme_source = 'andrejt'; &lt;/script&gt; &lt;script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;div id="AdnBottom"&gt;&lt;div class="AdnBottomLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnBottomRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=iGjwjZhTcOM:TMotRDUR8jU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=iGjwjZhTcOM:TMotRDUR8jU:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=iGjwjZhTcOM:TMotRDUR8jU:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=iGjwjZhTcOM:TMotRDUR8jU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=iGjwjZhTcOM:TMotRDUR8jU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=iGjwjZhTcOM:TMotRDUR8jU:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=iGjwjZhTcOM:TMotRDUR8jU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=iGjwjZhTcOM:TMotRDUR8jU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=iGjwjZhTcOM:TMotRDUR8jU:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=iGjwjZhTcOM:TMotRDUR8jU:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=iGjwjZhTcOM:TMotRDUR8jU:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=iGjwjZhTcOM:TMotRDUR8jU:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=iGjwjZhTcOM:TMotRDUR8jU:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=iGjwjZhTcOM:TMotRDUR8jU:V-t1I-SPZMU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=V-t1I-SPZMU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=iGjwjZhTcOM:TMotRDUR8jU:Jwdi1b3fU3Q"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=Jwdi1b3fU3Q" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TheAttic/~4/iGjwjZhTcOM" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheAttic/~3/iGjwjZhTcOM/post.aspx</link>
      <comments>http://www.tozon.info/blog/post/2011/06/09/NTK2011-Slides-and-sample-code-MVVM.aspx#comment</comments>
      <guid isPermaLink="false">http://www.tozon.info/blog/post.aspx?id=55f4bb01-6936-4e56-91b1-9d113ccf2259</guid>
      <pubDate>Thu, 09 Jun 2011 20:38:24 +0100</pubDate>
      <category>Behaviors</category>
      <category>Development</category>
      <category>Design</category>
      <category>Expression</category>
      <category>MVVM</category>
      <category>Silverlight</category>
      <category>Talks</category>
      <category>WP7</category>
      <dc:publisher>andrej</dc:publisher>
      <pingback:server>http://www.tozon.info/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.tozon.info/blog/post.aspx?id=55f4bb01-6936-4e56-91b1-9d113ccf2259</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.tozon.info/blog/trackback.axd?id=55f4bb01-6936-4e56-91b1-9d113ccf2259</trackback:ping>
      <wfw:comment>http://www.tozon.info/blog/post/2011/06/09/NTK2011-Slides-and-sample-code-MVVM.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.tozon.info/blog/syndication.axd?post=55f4bb01-6936-4e56-91b1-9d113ccf2259</wfw:commentRss>
    <feedburner:origLink>http://www.tozon.info/blog/post.aspx?id=55f4bb01-6936-4e56-91b1-9d113ccf2259</feedburner:origLink></item>
    <item>
      <title>NTK 2011 Sample Code: What’s new in Silverlight 5</title>
      <description>&lt;div id="AdnTop"&gt;&lt;div class="AdnTopLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnTopRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;My “What’s new in Silverlight 5” session at NTK was mostly about showing sample code and samples, so no slide deck this time. The enclosed Visual Studio Silverlight project is configured for running Out-of-Browser, with GPU acceleration enabled, and requiring elevated permissions.&lt;/p&gt;  &lt;p&gt;It’s basically a very basic video player application, used for playing videos from three preconfigured video sources: one’s your “My Videos” folder, one’s a custom local disk folder, and the last one is your favorite online TV show: the &lt;a href="http://silverlight.tv" target="_blank"&gt;Silverlight TV&lt;/a&gt; (yes, it parses show’s feed to get the episodes list and info).&lt;/p&gt;  &lt;p&gt;These sources play accordingly to the elevated permissions additions, made in Silverlight 5. The sample applications show off a lot of new Silverlight 5 features, some of them not so easily discoverable. Be sure to check out the source code to find them. This is a demo project and the code is somewhat unstructured. I’ll cover some of the new features in more details in the future, when Silverlight 5 fleshes out a bit more.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://cid-d34608bce9688fba.office.live.com/self.aspx/Public/Presentations/NTK2011/Silverlight5.zip" target="_blank"&gt;Download the sample project&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="Sample Silverlight 5" border="0" alt="Sample Silverlight 5" src="http://tozon.info/images/blog/NTK-2011-Slides-and-Code-Whats-new-in-Si_14A40/image.png" width="613" height="480" /&gt;&lt;/p&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt; tweetmeme_url = 'http://tozon.info/blog/post/2011/06/04/NTK-2011-Sample-Code-What%E2%80%99s-new-in-Silverlight-5.aspx'; tweetmeme_source = 'andrejt'; &lt;/script&gt; &lt;script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;div id="AdnBottom"&gt;&lt;div class="AdnBottomLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnBottomRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=fBYpFFCiRQo:bAASXoZBQ0M:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=fBYpFFCiRQo:bAASXoZBQ0M:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=fBYpFFCiRQo:bAASXoZBQ0M:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=fBYpFFCiRQo:bAASXoZBQ0M:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=fBYpFFCiRQo:bAASXoZBQ0M:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=fBYpFFCiRQo:bAASXoZBQ0M:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=fBYpFFCiRQo:bAASXoZBQ0M:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=fBYpFFCiRQo:bAASXoZBQ0M:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=fBYpFFCiRQo:bAASXoZBQ0M:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=fBYpFFCiRQo:bAASXoZBQ0M:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?i=fBYpFFCiRQo:bAASXoZBQ0M:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=fBYpFFCiRQo:bAASXoZBQ0M:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=fBYpFFCiRQo:bAASXoZBQ0M:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=fBYpFFCiRQo:bAASXoZBQ0M:V-t1I-SPZMU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=V-t1I-SPZMU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/TheAttic?a=fBYpFFCiRQo:bAASXoZBQ0M:Jwdi1b3fU3Q"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheAttic?d=Jwdi1b3fU3Q" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TheAttic/~4/fBYpFFCiRQo" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheAttic/~3/fBYpFFCiRQo/post.aspx</link>
      <comments>http://www.tozon.info/blog/post/2011/06/04/NTK-2011-Sample-Code-What’s-new-in-Silverlight-5.aspx#comment</comments>
      <guid isPermaLink="false">http://www.tozon.info/blog/post.aspx?id=0c6741b8-5863-4cd3-b1c8-5b4fba697225</guid>
      <pubDate>Sat, 04 Jun 2011 22:56:53 +0100</pubDate>
      <category>Silverlight</category>
      <category>Talks</category>
      <dc:publisher>andrej</dc:publisher>
      <pingback:server>http://www.tozon.info/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.tozon.info/blog/post.aspx?id=0c6741b8-5863-4cd3-b1c8-5b4fba697225</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.tozon.info/blog/trackback.axd?id=0c6741b8-5863-4cd3-b1c8-5b4fba697225</trackback:ping>
      <wfw:comment>http://www.tozon.info/blog/post/2011/06/04/NTK-2011-Sample-Code-What’s-new-in-Silverlight-5.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.tozon.info/blog/syndication.axd?post=0c6741b8-5863-4cd3-b1c8-5b4fba697225</wfw:commentRss>
    <feedburner:origLink>http://www.tozon.info/blog/post.aspx?id=0c6741b8-5863-4cd3-b1c8-5b4fba697225</feedburner:origLink></item>
  </channel>
</rss>

