<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Alessandro Del Sole's Blog</title>
        <link>http://community.visual-basic.it/Alessandro/Default.aspx</link>
        <description>{ A programming space about Microsoft® .NET® }</description>
        <language>it-IT</language>
        <copyright>Alessandro Del Sole</copyright>
        <generator>Subtext Version 2.5.2.0</generator>
        <image>
            <title>Alessandro Del Sole's Blog</title>
            <url>http://community.visual-basic.it/images/RSS2Image.gif</url>
            <link>http://community.visual-basic.it/Alessandro/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>Registrazione della mia sessione su WPF 4.5 ai Community Days 2012</title>
            <category>Windows Presentation Foundation</category>
            <category>Community and friends</category>
            <category>Visual Studio 11</category>
            <link>http://community.visual-basic.it/Alessandro/archive/2012/05/16/Registrazione-della-mia-sessione-su-WPF-4-5-ai-Community.aspx</link>
            <description>&lt;p&gt;&lt;font face="Verdana"&gt;Tramite altri canali social, tempo fa, avevo segnalato la disponibilità della registrazione della sessione che avevo tenuto ai Community Days 2012 di Milano, dal titolo What's new in WPF 4.5.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Poiché ho ricevuto contatti in merito alla sessione stessa, sono andato a verificare ed effettivamente non avevo bloggato circa la disponibilità della sessione.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;La potete trovare a quest'&lt;a href="http://www.communitydays.it/events/communitydays-2012/netfx05/"&gt;indirizzo&lt;/a&gt; del portale dei Community Days, dal quale potete anche scaricare le slide e la demo (che andrebbe aggiornata alla Beta di Visual Studio 11).&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;La registrazione è anche scaricabile in vari formati video se accedete alla sua &lt;a href="http://vimeo.com/38981778"&gt;pagina&lt;/a&gt; su Vimeo.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Per facilitarvi la visione, qui c'è il video in embed:&lt;/font&gt; &lt;/p&gt;
&lt;iframe height="281" src="http://player.vimeo.com/video/38981778" frameborder="0" width="500" allowfullscreen="" mozallowfullscreen="" webkitallowfullscreen=""&gt;&lt;/iframe&gt;
&lt;p&gt;&lt;font color="#339966" face="Verdana"&gt;&lt;strong&gt;&lt;em&gt;Alessandro&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;&lt;img src="http://community.visual-basic.it/Alessandro/aggbug/38162.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Alessandro Del Sole</dc:creator>
            <guid>http://community.visual-basic.it/Alessandro/archive/2012/05/16/Registrazione-della-mia-sessione-su-WPF-4-5-ai-Community.aspx</guid>
            <pubDate>Wed, 16 May 2012 17:11:11 GMT</pubDate>
            <comments>http://community.visual-basic.it/Alessandro/archive/2012/05/16/Registrazione-della-mia-sessione-su-WPF-4-5-ai-Community.aspx#feedback</comments>
            <wfw:commentRss>http://community.visual-basic.it/Alessandro/comments/commentRss/38162.aspx</wfw:commentRss>
            <trackback:ping>http://community.visual-basic.it/Alessandro/services/trackbacks/38162.aspx</trackback:ping>
        </item>
        <item>
            <title>Sviluppare Metro-style app per Windows 8 con Visual Basic - sesta parte</title>
            <category>Visual Basic</category>
            <category>Windows 8 &amp; Metro</category>
            <category>Visual Studio 11</category>
            <link>http://community.visual-basic.it/Alessandro/archive/2012/05/15/Sviluppare-Metro-style-app-per-Windows-8-con-Visual-BasicOnceMore.aspx</link>
            <description>&lt;p&gt;&lt;font face="Verdana"&gt;Dopo una lunga pausa riprendiamo la serie di post dedicati allo sviluppo di app in stile Metro per Windows 8, con il nostro amato Visual Basic.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;C'eravamo salutati la &lt;a href="http://community.visual-basic.it/Alessandro/archive/2012/04/26/Sviluppare-Metro-style-app-per-Windows-8-con-Visual-BasicOnceAgain.aspx"&gt;volta scorsa&lt;/a&gt; dopo aver completato il nostro news reader, dotato di app bar. Questa volta facciamo considerazioni sul layout e sulle rotazioni.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;&lt;strong&gt;Layout e adattabilità&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Sganciamoci per un momento dall'ambiente desktop classico a cui siamo abituati e immaginiamo di avere in mano un tablet. Come sapete, questo può essere ruotato. Ciò implica che il layout della nostra app deve essere in grado di adattarsi alla rotazione. Non solo: in Windows 8 esiste il concetto di &lt;font color="#800000"&gt;Snap&lt;/font&gt; che permette di tenere in vita un'app Metro a fianco di quelle desktop. La seguente figura mostra una rappresentazione di un'app in snap:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="" width="937" height="579" src="/images/community_visual-basic_it/Alessandro/Metro/MetroVB17.JPG" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Lo snap è disponibile solo per risoluzioni da 1366 x 768 in su, ma va comunque tenuto in considerazione. Ecco quindi che in questo post stravolgeremo praticamente tutta la UI del nostro news reader, facendo delle cose necessarie. &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Vi ricordo che il codice fino alla quinta parte di questa serie è disponibile a questo &lt;a href="http://www.visual-basic.it/scarica.asp?ID=1080"&gt;indirizzo&lt;/a&gt; e vi consiglio di scaricarlo in modo da avere una base da cui partire.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Altra cosa che vi consiglio &lt;strong&gt;vivamente &lt;/strong&gt;è avere sempre al vostro fianco la &lt;a href="http://msdn.microsoft.com/en-us/library/windows/apps/br211380.aspx"&gt;documentazione MSDN&lt;/a&gt; per creare la prima app Metro. Li ci sono cose che useremo in questo post, cose che useremo parzialmente e cose che lì sono fatte in modo più approfondito, per cui vi servirà in futuro.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;&lt;strong&gt;Stati Visuali&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Per cambiare layout a seconda dell'orientamento del device e dello snap si usa un oggetto già noto in WPF e Silverlight, il Visual State Manager. Partendo dalla documentazione sopra linkata, possiamo ricavare un po' di codice adatto allo scopo. Per prima cosa modifichiamo l'oggetto &lt;font face="Courier New"&gt;Page&lt;/font&gt; in &lt;font face="Courier New"&gt;LayoutAwarePage&lt;/font&gt;, che si adatta a questi discorsi. In primo luogo aggiungiamo un namespace &lt;font color="#ff0000" face="Courier New"&gt;common&lt;/font&gt; a livello di pagina:&lt;/font&gt;&lt;/p&gt;
&lt;font face="Verdana"&gt;
&lt;pre style="FONT-SIZE: 13px; FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black"&gt;&lt;font face="Courier New"&gt;&lt;span style="COLOR: red"&gt;xmlns&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;common&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"using:adsVBMetroReader.Common"&lt;/span&gt;&lt;/font&gt;
&lt;/pre&gt;
&lt;/font&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Quindi modifichiamo l'oggetto &lt;font color="#800000" face="Courier New"&gt;Page&lt;/font&gt; in &lt;font color="#800000" face="Courier New"&gt;common:LayoutAwarePage&lt;/font&gt;. All'interno della Grid radice vanno poi aggiunti gli stati visuali, in particolare la gestione degli stati Landscape, Portrait e Snapped. E' importante ricordare che l'oggetto &lt;font face="Courier New"&gt;LayoutAwarePage&lt;/font&gt; non fa parte di WinRT ma è disponibile tra i file auto-generati dal template di progetto ed offre di default una serie di membri che supportano la navigazione in pagine e che è sufficiente collegare in binding un button al membro &lt;font face="Courier New"&gt;GoBack&lt;/font&gt; per attivare la navigazione alla pagina precedente. In questo particolarissimo esempio non abbiamo navigazione, quindi negli stati visuali viene reso "innocuo" lo XAML relativo a questo pulsante. In questo preciso momento accompagnatevi nella lettura con la documentazione poichè riporta le motivazioni relative alle altre parti rese innocue. Ecco lo XAML per gli stati visuali:&lt;/font&gt;&lt;/p&gt;
&lt;font face="Verdana"&gt;
&lt;pre style="FONT-SIZE: 13px; FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black"&gt;&lt;font face="Courier New"&gt;&lt;span style="COLOR: #a31515"&gt;        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;VisualStateManager.VisualStateGroups&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
 
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: green"&gt;&amp;lt;!-- Visual states reflect the application's view state --&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;VisualStateGroup&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;VisualState&lt;/span&gt;&lt;span style="COLOR: red"&gt; x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"FullScreenLandscape"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
 
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: green"&gt;&amp;lt;!-- Filled uses a simpler list format in a narrower column --&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;VisualState&lt;/span&gt;&lt;span style="COLOR: red"&gt; x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Filled"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Storyboard&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"primaryColumn"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetProperty&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Width"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DiscreteObjectKeyFrame&lt;/span&gt;&lt;span style="COLOR: red"&gt; KeyTime&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Value&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"420"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"itemListView"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetProperty&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"ItemTemplate"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DiscreteObjectKeyFrame&lt;/span&gt;&lt;span style="COLOR: red"&gt; KeyTime&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Value&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="COLOR: red"&gt; NarrowListItemTemplate&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"itemDetail"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetProperty&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Padding"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DiscreteObjectKeyFrame&lt;/span&gt;&lt;span style="COLOR: red"&gt; KeyTime&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Value&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"60,0,66,0"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Storyboard&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;VisualState&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
 
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: green"&gt;&amp;lt;!--&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                    The page respects the narrower 100-pixel margin convention for portrait, and the page&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                    initially hides details to show only the list of items&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                --&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;VisualState&lt;/span&gt;&lt;span style="COLOR: red"&gt; x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"FullScreenPortrait"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Storyboard&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: green"&gt;&amp;lt;!--&amp;lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style"&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                            &amp;lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PortraitBackButtonStyle}"/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                        &amp;lt;/ObjectAnimationUsingKeyFrames&amp;gt;--&amp;gt;&lt;/span&gt;
 
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"itemDetail"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetProperty&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Visibility"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DiscreteObjectKeyFrame&lt;/span&gt;&lt;span style="COLOR: red"&gt; KeyTime&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Value&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Collapsed"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"itemListView"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetProperty&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Margin"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DiscreteObjectKeyFrame&lt;/span&gt;&lt;span style="COLOR: red"&gt; KeyTime&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Value&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"100,0,90,60"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Storyboard&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;VisualState&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
 
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: green"&gt;&amp;lt;!--&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                    When an item is selected in portrait the details display requires more extensive changes:&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                     * Hide the master list and the column is was in&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                     * Move item details down a row to make room for the title&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                     * Move the title directly above the details&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                     * Adjust margins and padding for details&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                 --&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;VisualState&lt;/span&gt;&lt;span style="COLOR: red"&gt; x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"FullScreenPortrait_Detail"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Storyboard&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: green"&gt;&amp;lt;!--&amp;lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style"&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                            &amp;lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PortraitBackButtonStyle}"/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                        &amp;lt;/ObjectAnimationUsingKeyFrames&amp;gt;--&amp;gt;&lt;/span&gt;
 
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"primaryColumn"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetProperty&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Width"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DiscreteObjectKeyFrame&lt;/span&gt;&lt;span style="COLOR: red"&gt; KeyTime&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Value&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"itemListScrollViewer"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetProperty&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Visibility"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DiscreteObjectKeyFrame&lt;/span&gt;&lt;span style="COLOR: red"&gt; KeyTime&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Value&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Collapsed"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"itemDetail"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetProperty&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"(Grid.Row)"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DiscreteObjectKeyFrame&lt;/span&gt;&lt;span style="COLOR: red"&gt; KeyTime&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Value&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"1"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"itemDetail"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetProperty&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"(Grid.RowSpan)"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DiscreteObjectKeyFrame&lt;/span&gt;&lt;span style="COLOR: red"&gt; KeyTime&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Value&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"1"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"titlePanel"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetProperty&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"(Grid.Column)"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DiscreteObjectKeyFrame&lt;/span&gt;&lt;span style="COLOR: red"&gt; KeyTime&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Value&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"1"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"itemDetailGrid"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetProperty&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Margin"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DiscreteObjectKeyFrame&lt;/span&gt;&lt;span style="COLOR: red"&gt; KeyTime&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Value&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0,0,0,60"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"itemDetail"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetProperty&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Padding"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DiscreteObjectKeyFrame&lt;/span&gt;&lt;span style="COLOR: red"&gt; KeyTime&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Value&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"100,0,90,0"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Storyboard&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;VisualState&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
 
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: green"&gt;&amp;lt;!--&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                    The back button and title have different styles when snapped, and the page&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                    initially hides details to show only the list of items&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                --&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;VisualState&lt;/span&gt;&lt;span style="COLOR: red"&gt; x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Snapped"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Storyboard&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: green"&gt;&amp;lt;!--&amp;lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style"&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                            &amp;lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedBackButtonStyle}"/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                        &amp;lt;/ObjectAnimationUsingKeyFrames&amp;gt;--&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"pageTitle"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetProperty&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Style"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DiscreteObjectKeyFrame&lt;/span&gt;&lt;span style="COLOR: red"&gt; KeyTime&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Value&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="COLOR: red"&gt; SnappedPageHeaderTextStyle&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
 
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"primaryColumn"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetProperty&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Width"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DiscreteObjectKeyFrame&lt;/span&gt;&lt;span style="COLOR: red"&gt; KeyTime&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Value&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"320"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"itemDetail"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetProperty&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Visibility"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DiscreteObjectKeyFrame&lt;/span&gt;&lt;span style="COLOR: red"&gt; KeyTime&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Value&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Collapsed"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"itemListView"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetProperty&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"ItemTemplate"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DiscreteObjectKeyFrame&lt;/span&gt;&lt;span style="COLOR: red"&gt; KeyTime&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Value&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="COLOR: red"&gt; NarrowListItemTemplate&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"itemListView"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetProperty&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Margin"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DiscreteObjectKeyFrame&lt;/span&gt;&lt;span style="COLOR: red"&gt; KeyTime&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Value&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"20,0,0,0"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Storyboard&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;VisualState&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
 
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: green"&gt;&amp;lt;!--&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                    When snapped and an item is selected the details display requires more extensive changes:&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                     * Hide the master list and the column is was in&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                     * Move item details down a row to make room for the title&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                     * Move the title directly above the details&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                     * Adjust margins and padding for details&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                     * Use a different font for title and subtitle&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                     * Adjust margins below subtitle&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                 --&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;VisualState&lt;/span&gt;&lt;span style="COLOR: red"&gt; x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Snapped_Detail"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Storyboard&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: green"&gt;&amp;lt;!--&amp;lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style"&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                            &amp;lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedBackButtonStyle}"/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                        &amp;lt;/ObjectAnimationUsingKeyFrames&amp;gt;--&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"pageTitle"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetProperty&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Style"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DiscreteObjectKeyFrame&lt;/span&gt;&lt;span style="COLOR: red"&gt; KeyTime&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Value&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="COLOR: red"&gt; SnappedPageHeaderTextStyle&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
 
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"primaryColumn"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetProperty&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Width"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DiscreteObjectKeyFrame&lt;/span&gt;&lt;span style="COLOR: red"&gt; KeyTime&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Value&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"itemListScrollViewer"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetProperty&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Visibility"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DiscreteObjectKeyFrame&lt;/span&gt;&lt;span style="COLOR: red"&gt; KeyTime&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Value&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Collapsed"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"itemDetail"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetProperty&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"(Grid.Row)"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DiscreteObjectKeyFrame&lt;/span&gt;&lt;span style="COLOR: red"&gt; KeyTime&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Value&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"1"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"itemDetail"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetProperty&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"(Grid.RowSpan)"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DiscreteObjectKeyFrame&lt;/span&gt;&lt;span style="COLOR: red"&gt; KeyTime&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Value&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"1"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"titlePanel"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetProperty&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"(Grid.Column)"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DiscreteObjectKeyFrame&lt;/span&gt;&lt;span style="COLOR: red"&gt; KeyTime&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Value&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"1"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: green"&gt;&amp;lt;!--&amp;lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="itemDetailTitlePanel" Storyboard.TargetProperty="(Grid.Row)"&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                            &amp;lt;DiscreteObjectKeyFrame KeyTime="0" Value="0"/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                        &amp;lt;/ObjectAnimationUsingKeyFrames&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                        &amp;lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="itemDetailTitlePanel" Storyboard.TargetProperty="(Grid.Column)"&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                            &amp;lt;DiscreteObjectKeyFrame KeyTime="0" Value="0"/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                        &amp;lt;/ObjectAnimationUsingKeyFrames&amp;gt;--&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"itemDetail"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetProperty&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Padding"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DiscreteObjectKeyFrame&lt;/span&gt;&lt;span style="COLOR: red"&gt; KeyTime&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Value&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"20,0,20,0"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"itemDetailGrid"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetProperty&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Margin"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DiscreteObjectKeyFrame&lt;/span&gt;&lt;span style="COLOR: red"&gt; KeyTime&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Value&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0,0,0,60"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"itemTitle"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetProperty&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Style"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DiscreteObjectKeyFrame&lt;/span&gt;&lt;span style="COLOR: red"&gt; KeyTime&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Value&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="COLOR: red"&gt; TitleTextStyle&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"itemTitle"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Storyboard.TargetProperty&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Margin"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DiscreteObjectKeyFrame&lt;/span&gt;&lt;span style="COLOR: red"&gt; KeyTime&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Value&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: green"&gt;&amp;lt;!--&amp;lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="itemSubtitle" Storyboard.TargetProperty="Style"&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                            &amp;lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource CaptionTextStyle}"/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: green"&gt;                        &amp;lt;/ObjectAnimationUsingKeyFrames&amp;gt;--&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Storyboard&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;VisualState&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;VisualStateGroup&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;VisualStateManager.VisualStateGroups&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;/font&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Tra i vari stati notate come sia presente quello che si occupa di gestire lo snap. In questo esempio l'esecuzione in snap è semplificata perché l'app non implementa una struttura a navigazione, per cui verrà mostrato un elenco di post e basta. Nell'esempio fornito con la documentazione, più completo e complesso, l'app risponde al click sull'elemento mostrando il contenuto e attivando un pulsante back per tornare all'elenco post, sempre in modalità snap. &lt;/font&gt;&lt;font face="Verdana"&gt;In questi stati visuali si fa riferimento a due template per i controlli, uno chiamato &lt;font color="#800000" face="Courier New"&gt;DefaultListItemTemplate&lt;/font&gt; e uno &lt;font color="#800000" face="Courier New"&gt;NarrowListItemTemplate&lt;/font&gt;, ognuno dei quali da utilizzare a seconda dello stato visuale corrente. Eccoli, da inserire nelle risorse:&lt;/font&gt;&lt;/p&gt;
&lt;font face="Verdana"&gt;
&lt;pre style="FONT-SIZE: 13px; FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black"&gt;&lt;font face="Courier New"&gt;&lt;span style="COLOR: #a31515"&gt;        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;SolidColorBrush&lt;/span&gt;&lt;span style="COLOR: red"&gt; x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Key&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"BlockBackgroundBrush"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Color&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"#FF557EB9"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;        &lt;/span&gt;&lt;span style="COLOR: green"&gt;&amp;lt;!-- Used in Filled and Snapped views --&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DataTemplate&lt;/span&gt;&lt;span style="COLOR: red"&gt; x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Key&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"NarrowListItemTemplate"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="COLOR: red"&gt; Height&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"80"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ColumnDefinition&lt;/span&gt;&lt;span style="COLOR: red"&gt; Width&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Auto"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ColumnDefinition&lt;/span&gt;&lt;span style="COLOR: red"&gt; Width&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"*"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Border&lt;/span&gt;&lt;span style="COLOR: red"&gt; Background&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="COLOR: red"&gt; BlockBackgroundBrush&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Width&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"80"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Height&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"80"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ContentControl&lt;/span&gt;&lt;span style="COLOR: red"&gt; Template&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="COLOR: red"&gt; DateBlockTemplate&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Margin&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"-12,-12,0,0"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StackPanel&lt;/span&gt;&lt;span style="COLOR: red"&gt; Grid.Column&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"1"&lt;/span&gt;&lt;span style="COLOR: red"&gt; HorizontalAlignment&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Left"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Margin&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"12,8,0,0"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="COLOR: red"&gt; Text&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="COLOR: red"&gt; Title&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;&lt;span style="COLOR: red"&gt; MaxHeight&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"56"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Foreground&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"White"&lt;/span&gt;&lt;span style="COLOR: red"&gt; TextWrapping&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Wrap"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="COLOR: red"&gt; Text&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="COLOR: red"&gt; Author&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;&lt;span style="COLOR: red"&gt; FontSize&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"12"&lt;/span&gt;&lt;span style="COLOR: blue"&gt; /&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StackPanel&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DataTemplate&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
 
&lt;span style="COLOR: #a31515"&gt;        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DataTemplate&lt;/span&gt;&lt;span style="COLOR: red"&gt; x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Key&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"DefaultListItemTemplate"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="COLOR: red"&gt; HorizontalAlignment&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Stretch"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Width&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Auto"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Height&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"110"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Margin&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"10,10,10,0"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ColumnDefinition&lt;/span&gt;&lt;span style="COLOR: red"&gt; Width&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Auto"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ColumnDefinition&lt;/span&gt;&lt;span style="COLOR: red"&gt; Width&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"*"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: green"&gt;&amp;lt;!-- Green date block --&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Border&lt;/span&gt;&lt;span style="COLOR: red"&gt; Background&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="COLOR: red"&gt; BlockBackgroundBrush&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Width&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"110"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Height&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"110"&lt;/span&gt;&lt;span style="COLOR: blue"&gt; /&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ContentControl&lt;/span&gt;&lt;span style="COLOR: red"&gt; Template&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="COLOR: red"&gt; DateBlockTemplate&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;&lt;span style="COLOR: blue"&gt; /&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StackPanel&lt;/span&gt;&lt;span style="COLOR: red"&gt; Grid.Column&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"1"&lt;/span&gt; &lt;span style="COLOR: red"&gt; HorizontalAlignment&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Left"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Margin&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"12,8,0,0"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="COLOR: red"&gt; Text&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="COLOR: red"&gt; Title&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;&lt;span style="COLOR: red"&gt; FontSize&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"26.667"&lt;/span&gt;&lt;span style="COLOR: red"&gt; TextWrapping&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Wrap"&lt;/span&gt;
                          &lt;span style="COLOR: red"&gt; MaxHeight&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"72"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Foreground&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"White"&lt;/span&gt;&lt;span style="COLOR: blue"&gt; /&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="COLOR: red"&gt; Text&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="COLOR: red"&gt; Author&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;&lt;span style="COLOR: red"&gt; FontSize&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"18.667"&lt;/span&gt;&lt;span style="COLOR: blue"&gt; /&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StackPanel&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DataTemplate&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;/font&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Si fa riferimento ad un template chiamato &lt;font color="#800000" face="Courier New"&gt;DateBlockTemplate&lt;/font&gt;, che consente di formattare la data di pubblicazione del post in un modo simile a quello che avete visto nella figura precedente, che poi è ripreso dalla documentazione con qualche modifica. Tale template va in App.xaml per renderlo potenzialmente riutilizzabile:&lt;/font&gt;&lt;/p&gt;
&lt;font face="Verdana"&gt;
&lt;pre style="FONT-SIZE: 13px; FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black"&gt;&lt;font face="Courier New"&gt;&lt;span style="COLOR: #a31515"&gt;        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ControlTemplate&lt;/span&gt;&lt;span style="COLOR: red"&gt; x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Key&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"DateBlockTemplate"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Canvas&lt;/span&gt;&lt;span style="COLOR: red"&gt; Height&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"86"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Width&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"86"&lt;/span&gt; &lt;span style="COLOR: red"&gt; Margin&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"8,8,0,8"&lt;/span&gt;&lt;span style="COLOR: red"&gt; HorizontalAlignment&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Left"&lt;/span&gt;&lt;span style="COLOR: red"&gt; VerticalAlignment&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Top"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="COLOR: red"&gt; TextTrimming&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"WordEllipsis"&lt;/span&gt;&lt;span style="COLOR: red"&gt; TextWrapping&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"NoWrap"&lt;/span&gt; 
                    &lt;span style="COLOR: red"&gt; Width&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Auto"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Height&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Auto"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Margin&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"8,0,4,0"&lt;/span&gt;&lt;span style="COLOR: red"&gt; FontSize&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"32"&lt;/span&gt;&lt;span style="COLOR: red"&gt; FontWeight&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Bold"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                          &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBlock.Text&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                              &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="COLOR: red"&gt; Path&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"PubDate"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Converter&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="COLOR: red"&gt; dateConverter&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;&lt;span style="COLOR: red"&gt; ConverterParameter&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"month"&lt;/span&gt; &lt;span style="COLOR: blue"&gt; /&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                          &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBlock.Text&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
 
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="COLOR: red"&gt; TextTrimming&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"WordEllipsis"&lt;/span&gt;&lt;span style="COLOR: red"&gt; TextWrapping&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Wrap"&lt;/span&gt; 
                    &lt;span style="COLOR: red"&gt; Width&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"40"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Height&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Auto"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Margin&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"8,0,0,0"&lt;/span&gt;&lt;span style="COLOR: red"&gt; FontSize&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"34"&lt;/span&gt;&lt;span style="COLOR: red"&gt; FontWeight&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Bold"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Canvas.Top&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"36"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBlock.Text&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="COLOR: red"&gt; Path&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"PubDate"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Converter&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="COLOR: red"&gt; dateConverter&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;&lt;span style="COLOR: red"&gt; ConverterParameter&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"day"&lt;/span&gt; &lt;span style="COLOR: blue"&gt; /&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBlock.Text&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Line&lt;/span&gt;&lt;span style="COLOR: red"&gt; Stroke&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"White"&lt;/span&gt;&lt;span style="COLOR: red"&gt; StrokeThickness&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"2"&lt;/span&gt;&lt;span style="COLOR: red"&gt; X1&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"54"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Y1&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"46"&lt;/span&gt;&lt;span style="COLOR: red"&gt; X2&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"54"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Y2&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"80"&lt;/span&gt;&lt;span style="COLOR: blue"&gt; /&amp;gt;&lt;/span&gt;
 
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="COLOR: red"&gt; TextWrapping&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Wrap"&lt;/span&gt; 
                    &lt;span style="COLOR: red"&gt; Width&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"20"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Height&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Auto"&lt;/span&gt;&lt;span style="COLOR: red"&gt; FontSize&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="COLOR: red"&gt; ContentFontSize&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Canvas.Top&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"42"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Canvas.Left&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"60"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBlock.Text&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="COLOR: red"&gt; Path&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"PubDate"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Converter&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="COLOR: red"&gt; dateConverter&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;&lt;span style="COLOR: red"&gt; ConverterParameter&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"year"&lt;/span&gt; &lt;span style="COLOR: blue"&gt; /&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBlock.Text&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Canvas&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ControlTemplate&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;/font&gt;
&lt;p&gt;&lt;font face="Verdana" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;A questo punto dobbiamo fare due cose: modificare la UI affinché sia in grado di essere più gradevole e adattabile agli stati e fare qualche considerazione sulla gestione degli stati a runtime.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;&lt;strong&gt;Come ti stravolgo la User Interface&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Uno dei punti cardine nella documentazione sopra citata è un paragrafo chiamato &lt;a href="http://msdn.microsoft.com/en-us/library/windows/apps/br211380.aspx#creating_a_consistent_look_with_styles"&gt;Creating a consistent look with styles&lt;/a&gt;. Useremo il codice mostrato lì per fare molte modifiche. Sostanzialmente definiremo una nuova UI per la pagina principale in questo modo:&lt;/font&gt;&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;font face="Verdana"&gt;testo per il nome del contenuto visualizzato&lt;/font&gt; &lt;/li&gt;
    &lt;li&gt;&lt;font face="Verdana"&gt;uno ScrollViewer con ListView, che mostra l'elenco dei post secondo i due template precedentemente definiti&lt;/font&gt; &lt;/li&gt;
    &lt;li&gt;&lt;font face="Verdana"&gt;uno ScrollViewer con controllo &lt;font color="#800000" face="Courier New"&gt;WebView&lt;/font&gt; per la visualizzazione dell'anteprima&lt;/font&gt; &lt;/li&gt;
    &lt;li&gt;&lt;font face="Verdana"&gt;lasceremo invariata l'app bar e le sue funzionalità&lt;/font&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Devo, per forza di cose, dare per scontato che abbiate dimestichezza con XAML. Il codice non è complicato, lo è riassumere codice lungo e dettagliate spiegazioni. Lo XAML da inserire all'interno della Grid radice è il seguente:&lt;/font&gt;&lt;/p&gt;
&lt;font face="Verdana"&gt;
&lt;pre style="FONT-SIZE: 13px; FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black"&gt;&lt;font face="Courier New"&gt;&lt;span style="COLOR: #a31515"&gt;        &lt;/span&gt;&lt;span style="COLOR: green"&gt;&amp;lt;!--&lt;/span&gt;
&lt;span style="COLOR: green"&gt;        This grid acts as a root panel for the page that defines two rows:&lt;/span&gt;
&lt;span style="COLOR: green"&gt;        * Row 0 contains the back button and page title&lt;/span&gt;
&lt;span style="COLOR: green"&gt;        * Row 1 contains the rest of the page layout&lt;/span&gt;
&lt;span style="COLOR: green"&gt;    --&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="COLOR: red"&gt; Background&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="COLOR: red"&gt; ApplicationPageBackgroundBrush&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;RowDefinition&lt;/span&gt;&lt;span style="COLOR: red"&gt; Height&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"140"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;RowDefinition&lt;/span&gt;&lt;span style="COLOR: red"&gt; Height&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"*"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ColumnDefinition&lt;/span&gt;&lt;span style="COLOR: red"&gt; x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"primaryColumn"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Width&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"610"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ColumnDefinition&lt;/span&gt;&lt;span style="COLOR: red"&gt; Width&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"*"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
 
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: green"&gt;&amp;lt;!-- Back button and page title --&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="COLOR: red"&gt; x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"titlePanel"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Grid.ColumnSpan&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"2"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ColumnDefinition&lt;/span&gt;&lt;span style="COLOR: red"&gt; Width&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Auto"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ColumnDefinition&lt;/span&gt;&lt;span style="COLOR: red"&gt; Width&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"*"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
 
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="COLOR: red"&gt; x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"pageTitle"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Grid.Column&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"1"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Text&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="COLOR: red"&gt; Feed&lt;/span&gt;&lt;span style="COLOR: blue"&gt;.&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Title&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Style&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="COLOR: red"&gt; GridTitleTextStyle&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
 
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: green"&gt;&amp;lt;!-- Vertical scrolling item list --&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ScrollViewer&lt;/span&gt;
           &lt;span style="COLOR: red"&gt; x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"itemListScrollViewer"&lt;/span&gt;
           &lt;span style="COLOR: red"&gt; AutomationProperties.AutomationId&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"ItemListScrollViewer"&lt;/span&gt;
           &lt;span style="COLOR: red"&gt; Grid.Row&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"1"&lt;/span&gt;
           &lt;span style="COLOR: red"&gt; Margin&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"-10,-10,0,0"&lt;/span&gt;
           &lt;span style="COLOR: red"&gt; Style&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="COLOR: red"&gt; VerticalScrollViewerStyle&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
 
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ListView&lt;/span&gt;
               &lt;span style="COLOR: red"&gt; x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"itemListView"&lt;/span&gt;
               &lt;span style="COLOR: red"&gt; AutomationProperties.AutomationId&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"ItemsListView"&lt;/span&gt;
               &lt;span style="COLOR: red"&gt; AutomationProperties.Name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Items"&lt;/span&gt;
               &lt;span style="COLOR: red"&gt; Margin&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"120,0,0,60"&lt;/span&gt;
               &lt;span style="COLOR: red"&gt; ItemsSource&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="COLOR: red"&gt; Source&lt;/span&gt;&lt;span style="COLOR: blue"&gt;={&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="COLOR: red"&gt; itemsViewSource&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;
               &lt;span style="COLOR: red"&gt; SelectionChanged&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"ItemListView_SelectionChanged"&lt;/span&gt;
               &lt;span style="COLOR: red"&gt; ItemTemplate&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="COLOR: red"&gt; DefaultListItemTemplate&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
 
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ScrollViewer&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
 
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ScrollViewer&lt;/span&gt;
           &lt;span style="COLOR: red"&gt; x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"itemDetail"&lt;/span&gt;
           &lt;span style="COLOR: red"&gt; AutomationProperties.AutomationId&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"ItemDetailScrollViewer"&lt;/span&gt;
           &lt;span style="COLOR: red"&gt; Grid.Column&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"1"&lt;/span&gt;
           &lt;span style="COLOR: red"&gt; Grid.Row&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"1"&lt;/span&gt;
           &lt;span style="COLOR: red"&gt; Padding&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"70,0,120,0"&lt;/span&gt;
           &lt;span style="COLOR: red"&gt; DataContext&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="COLOR: red"&gt; SelectedItem&lt;/span&gt;&lt;span style="COLOR: blue"&gt;,&lt;/span&gt;&lt;span style="COLOR: red"&gt; ElementName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;itemListView&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;
           &lt;span style="COLOR: red"&gt; Style&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="COLOR: red"&gt; VerticalScrollViewerStyle&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
 
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="COLOR: red"&gt; x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"itemDetailGrid"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;RowDefinition&lt;/span&gt;&lt;span style="COLOR: red"&gt; Height&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Auto"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;RowDefinition&lt;/span&gt;&lt;span style="COLOR: red"&gt; Height&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"*"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
 
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="COLOR: red"&gt; x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"itemTitle"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Text&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="COLOR: red"&gt; Title&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt; 
                          &lt;span style="COLOR: red"&gt; Style&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="COLOR: red"&gt; SubheaderTextStyle&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                      &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBlock.Transitions&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TransitionCollection&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ContentThemeTransition&lt;/span&gt;&lt;span style="COLOR: blue"&gt; /&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TransitionCollection&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                      &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBlock.Transitions&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
 
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Border&lt;/span&gt;&lt;span style="COLOR: red"&gt; x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"contentViewBorder"&lt;/span&gt;&lt;span style="COLOR: red"&gt; BorderBrush&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Gray"&lt;/span&gt;&lt;span style="COLOR: red"&gt; BorderThickness&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"2"&lt;/span&gt; 
                       &lt;span style="COLOR: red"&gt; Grid.Row&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"1"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Margin&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0,15,0,20"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;WebView&lt;/span&gt;&lt;span style="COLOR: red"&gt; x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"contentView"&lt;/span&gt;&lt;span style="COLOR: blue"&gt; /&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Rectangle&lt;/span&gt;&lt;span style="COLOR: red"&gt; x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"contentViewRect"&lt;/span&gt;&lt;span style="COLOR: blue"&gt; /&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Border&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ScrollViewer&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;/font&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Apparirà ora più chiaro come le varie fasi degli stati visuali influenzino controlli specifici, che ora vediamo nel codice con il loro nome. Si noti come alcuni controlli siano in binding con le proprietà di interesse della classe &lt;font face="Courier New"&gt;FeedItem&lt;/font&gt; la cui istanza costituisce la fonte dati della pagina. Infine si noti come il template assegnato in via prioritaria sia quello chiamato &lt;font color="#800000" face="Courier New"&gt;DefaultListItemTemplate&lt;/font&gt;. Questo cambierà a seconda dello stato visuale. Il controllo e la gestione degli stati è poi responsabilità del runtime.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;&lt;strong&gt;Gli stati visuali a runtime&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;La classe &lt;font face="Courier New"&gt;LayoutAwarePage&lt;/font&gt; implementa di default tutto ciò che è necessario per gestire gli stati visuali a runtime, oltre all'infrastruttura per la navigazione. Nel nostro semplice esempio siamo fortunati perché non abbiamo necessità di fare altro, ma se la nostra app è composta da più pagine è necessario fare l'override di alcuni metodi e gestire il comportamento degli stati in fase di navigazione.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;La documentazione offre tutto ciò che è necessario sapere per implementare correttamente queste caratteristiche.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;&lt;strong&gt;Test&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Potete ora divertirvi a testare l'app ruotando il simulatore, soprattutto capire il discorso dello snap. Il codice aggiornato è disponibile a questo &lt;a href="http://www.visual-basic.it/scarica.asp?ID=1081"&gt;indirizzo&lt;/a&gt;.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;&lt;strong&gt;&lt;em&gt;&lt;font color="#339966"&gt;Alessandro&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;&lt;img src="http://community.visual-basic.it/Alessandro/aggbug/38157.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Alessandro Del Sole</dc:creator>
            <guid>http://community.visual-basic.it/Alessandro/archive/2012/05/15/Sviluppare-Metro-style-app-per-Windows-8-con-Visual-BasicOnceMore.aspx</guid>
            <pubDate>Tue, 15 May 2012 19:14:59 GMT</pubDate>
            <comments>http://community.visual-basic.it/Alessandro/archive/2012/05/15/Sviluppare-Metro-style-app-per-Windows-8-con-Visual-BasicOnceMore.aspx#feedback</comments>
            <wfw:commentRss>http://community.visual-basic.it/Alessandro/comments/commentRss/38157.aspx</wfw:commentRss>
            <trackback:ping>http://community.visual-basic.it/Alessandro/services/trackbacks/38157.aspx</trackback:ping>
        </item>
        <item>
            <title>Passa a Visual Studio Premium con MSDN e risparmia il 15%</title>
            <category>Visual Studio 2010</category>
            <category>Visual Studio 11</category>
            <link>http://community.visual-basic.it/Alessandro/archive/2012/05/08/Passa-a-Visual-Studio-Premium-con-MSDN-e-risparmia-il.aspx</link>
            <description>&lt;p&gt;&lt;font face="Verdana"&gt;La maggior parte dei visitatori che passano dall'home page di &lt;a href="http://www.visual-basic.it"&gt;Visual Basic Tips &amp;amp; Tricks&lt;/a&gt; hanno sicuramente notato, già da qualche giorno, la presenza di una promozione offerta da Microsoft che riguarda la possibilità di risparmiare il 15% sull'acquisto di un abbonamento MSDN con Visual Studio Premium e che permette di stare al sicuro da aumenti futuri del prezzo, oltre ai consueti benefit del programma.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;A tal proposito Francesca Longoni di Microsoft Italia ha pubblicato tutti i dettagli dell'offerta in questo &lt;a href="http://blogs.msdn.com/b/italy/archive/2012/05/08/passa-a-visual-studio-premium-con-msdn-e-risparmia-il-15-se-sei-eleggibile.aspx"&gt;post&lt;/a&gt; disponibile nel blog di MSDN Italia. Nel post sono anche elencati i prodotti inclusi nell'abbonamento per il quale vale l'offerta ed è sicuramente qualcosa a cui dare un'occhiata!&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#339966" face="Verdana"&gt;&lt;strong&gt;&lt;em&gt;Alessandro&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;&lt;img src="http://community.visual-basic.it/Alessandro/aggbug/38155.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Alessandro Del Sole</dc:creator>
            <guid>http://community.visual-basic.it/Alessandro/archive/2012/05/08/Passa-a-Visual-Studio-Premium-con-MSDN-e-risparmia-il.aspx</guid>
            <pubDate>Tue, 08 May 2012 18:57:07 GMT</pubDate>
            <comments>http://community.visual-basic.it/Alessandro/archive/2012/05/08/Passa-a-Visual-Studio-Premium-con-MSDN-e-risparmia-il.aspx#feedback</comments>
            <wfw:commentRss>http://community.visual-basic.it/Alessandro/comments/commentRss/38155.aspx</wfw:commentRss>
            <trackback:ping>http://community.visual-basic.it/Alessandro/services/trackbacks/38155.aspx</trackback:ping>
        </item>
        <item>
            <title>Aggiornamenti all'interfaccia in Visual Studio 11 RC</title>
            <category>Visual Studio 11</category>
            <link>http://community.visual-basic.it/Alessandro/archive/2012/05/08/Aggiornamenti-allinterfaccia-in-Visual-Studio-11-RC.aspx</link>
            <description>&lt;p&gt;&lt;font face="Verdana"&gt;Qualcuno aveva espresso apprezzamento, ma la maggior parte della comunità degli sviluppatori ha inviato feedback a Microsoft sul fatto che l'interfaccia utente della beta di Visual Studio 11 presentasse troppe tonalità di grigio e icone di difficile individuazione, incluse quelle relative ai file di codice.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Il feedback più forte è stato quindi: ridateci i colori &lt;img alt="" src="/aspx/providers/BlogEntryEditor/FCKeditor/editor/images/smiley/msn/regular_smile.gif" /&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;E a quanto pare questo feedback è stato assolutamente ascoltato, dal momento che si apprende che una Release Candidate è in fase di preparazione e alcuni screen shot sono stati pubblicati nel blog di Visual Studio. In particolare, in questo &lt;a href="http://blogs.msdn.com/b/visualstudio/archive/2012/05/08/visual-studio-11-user-interface-updates-coming-in-rc.aspx"&gt;post&lt;/a&gt; si possono vedere tutti i miglioramenti che sono stati fatti all'interfaccia dell'IDE presentando tutte le aree interessate dagli interventi "coloranti".&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Ora il nuovo dibattito è: ci piace lo stile maiuscolo dei nomi dei menu oppure no? &lt;img alt="" src="/aspx/providers/BlogEntryEditor/FCKeditor/editor/images/smiley/msn/wink_smile.gif" /&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Intanto il ritorno dei colori è sicuramente molto gradito, a livello personale non apprezzavo le sole tonalità di grigio. Va bene lo stile Metro, ma la produttività a volte è legata anche a un simbolo o a un colore.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Bravi &lt;img alt="" src="/aspx/providers/BlogEntryEditor/FCKeditor/editor/images/smiley/msn/regular_smile.gif" /&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#339966" face="Verdana"&gt;&lt;strong&gt;&lt;em&gt;Alessandro&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;&lt;img src="http://community.visual-basic.it/Alessandro/aggbug/38154.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Alessandro Del Sole</dc:creator>
            <guid>http://community.visual-basic.it/Alessandro/archive/2012/05/08/Aggiornamenti-allinterfaccia-in-Visual-Studio-11-RC.aspx</guid>
            <pubDate>Tue, 08 May 2012 18:51:58 GMT</pubDate>
            <comments>http://community.visual-basic.it/Alessandro/archive/2012/05/08/Aggiornamenti-allinterfaccia-in-Visual-Studio-11-RC.aspx#feedback</comments>
            <wfw:commentRss>http://community.visual-basic.it/Alessandro/comments/commentRss/38154.aspx</wfw:commentRss>
            <trackback:ping>http://community.visual-basic.it/Alessandro/services/trackbacks/38154.aspx</trackback:ping>
        </item>
        <item>
            <title>Sviluppare Metro-style app per Windows 8 con Visual Basic - quinta parte</title>
            <category>Visual Basic</category>
            <category>Windows 8 &amp; Metro</category>
            <category>Visual Studio 11</category>
            <link>http://community.visual-basic.it/Alessandro/archive/2012/04/26/Sviluppare-Metro-style-app-per-Windows-8-con-Visual-BasicOnceAgain.aspx</link>
            <description>&lt;p&gt;&lt;font face="Verdana"&gt;Nel precedente &lt;a href="http://community.visual-basic.it/Alessandro/archive/2012/04/23/Sviluppare-Metro-style-app-per-Windows-8-con-Visual-BasicAndAgain.aspx"&gt;post&lt;/a&gt; di questa serie abbiamo creato un'app in stile Metro per Windows 8 che legge i feed RSS dal &lt;a href="http://msdn.com/vbasic"&gt;Visual Basic Developer Center di MSDN&lt;/a&gt; e abbiamo cominciato a prendere confidenza con il pattern Async, con classi specifiche di WinRT e con l'esecuzione dell'app.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;In questo post (il nr. 1500!) facciamo degli interessanti passi in avanti, implementando caratteristiche tipiche di Windows 8: lo Share contract e l'app bar.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;&lt;strong&gt;Share contract&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Come sapete le app Metro godono della possibilità di integrarsi profondamente con il sistema operativo e con altre app, condividendo informazioni. Questo è possibile attraverso i cosiddetti &lt;em&gt;charm&lt;/em&gt; (condivisione, ricerca, impostazioni) attivabili passando il puntatore del mouse in basso a destra o usando il touch scorrendo dolcemente il dito dal lato destro del device. I charm sono ciò che vede l'utente, ma dal lato dello sviluppatore ci sono delle apposite API chiamate &lt;em&gt;contracts&lt;/em&gt;. &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;
&lt;table height="23" cellspacing="1" cellpadding="1" width="629" summary="" border="0"&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td&gt;&lt;font face="Verdana"&gt;Lo Share contract sostanzialmente consente all'app di condividere un contenuto o un'informazione con altre app o con il sistema. Pensate banalmente a una foto da voler condividere con un'app di social networking o con il client di posta.&lt;/font&gt;&lt;/td&gt;
            &lt;td&gt; &lt;img alt="" width="208" height="485" src="/images/community_visual-basic_it/Alessandro/Metro/MetroVB15.jpg" /&gt;&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Ciò che ci proponiamo di raggiungere oggi, quindi, è la possibilità di condividere i contenuti scaricati dalla nostra app con altre app in grado di ricevere i contenuti stessi. Nota bene: lo Share contract può essere duplice, nel senso che un'app può sia inviare che ricevere contenuti. Noi implementeremo la sola condivisione, per semplicità di apprendimento.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Il namespace &lt;font face="Courier New"&gt;Windows.ApplicationModel.DataTransfer&lt;/font&gt; espone la classe &lt;font face="Courier New"&gt;DataTransferManager&lt;/font&gt; che offre gli strumenti adatti all'implementazione del contract. In altre parole:&lt;/font&gt;&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;font face="Verdana"&gt;ottenuta l'istanza della classe DataTransferManager, si ottiene l'istanza dei contenuti visualizzati&lt;/font&gt; &lt;/li&gt;
    &lt;li&gt;&lt;font face="Verdana"&gt;si sottoscrive l'evento &lt;/font&gt;&lt;font face="Courier New"&gt;DataTransferRequested&lt;/font&gt; &lt;/li&gt;
    &lt;li&gt;&lt;font face="Verdana"&gt;quest'ultimo viene scatenato quando l'utente attiva il charm di condivisione&lt;/font&gt; &lt;/li&gt;
    &lt;li&gt;&lt;font face="Verdana"&gt;si impostano le proprietà della condivisione e il contratto fa il resto&lt;/font&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Il che si traduce nel seguente codice da digitare nel code-behind della nostra (per ora) unica pagina:&lt;/font&gt;&lt;/p&gt;
&lt;font face="Verdana"&gt;
&lt;pre style="FONT-SIZE: 13px; FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black"&gt;&lt;font face="Courier New"&gt;    &lt;span style="COLOR: green"&gt;'Some initialization values&lt;/span&gt;
    &lt;span style="COLOR: blue"&gt;Private&lt;/span&gt; dataPackageTitle &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt; = &lt;span style="COLOR: #a31515"&gt;"Default Title"&lt;/span&gt;
    &lt;span style="COLOR: blue"&gt;Private&lt;/span&gt; dataPackageDescription &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt; = &lt;span style="COLOR: #a31515"&gt;"Default Description"&lt;/span&gt;
    &lt;span style="COLOR: blue"&gt;Private&lt;/span&gt; dataPackageUri &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Uri&lt;/span&gt; = &lt;span style="COLOR: blue"&gt;Nothing&lt;/span&gt;
 
    &lt;span style="COLOR: blue"&gt;Private&lt;/span&gt; datatransferManager &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; DataTransfer.DataTransferManager
    &lt;span style="COLOR: blue"&gt;Private&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt; ShareSourceLoad()
        &lt;span style="COLOR: blue"&gt;Try&lt;/span&gt;
            &lt;span style="COLOR: green"&gt;'Get the current view for sharing&lt;/span&gt;
            datatransferManager = DataTransfer.DataTransferManager.GetForCurrentView()
            &lt;span style="COLOR: green"&gt;'Subscribe to the DataRequested event which is raised when the user attempts to share a content&lt;/span&gt;
            &lt;span style="COLOR: blue"&gt;AddHandler&lt;/span&gt; datatransferManager.DataRequested, &lt;span style="COLOR: blue"&gt;AddressOf&lt;/span&gt; datatransferManager_DataRequested
        &lt;span style="COLOR: blue"&gt;Catch&lt;/span&gt;
 
        &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Try&lt;/span&gt;
    &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;
 
    &lt;span style="COLOR: blue"&gt;Private&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt; datatransferManager_DataRequested(sender &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; DataTransferManager, e &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; DataRequestedEventArgs)
        &lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt; currentFeed = &lt;span style="COLOR: blue"&gt;CType&lt;/span&gt;(&lt;span style="COLOR: blue"&gt;Me&lt;/span&gt;.itemListView.SelectedItem, FeedItem)
 
        dataPackageTitle = currentFeed.Title
        dataPackageDescription = currentFeed.Content
        dataPackageUri = currentFeed.Link
 
        e.Request.Data.Properties.Title = dataPackageTitle
        e.Request.Data.Properties.Description = dataPackageDescription
 
        &lt;span style="COLOR: green"&gt;'Actual sharing here&lt;/span&gt;
        e.Request.Data.SetUri(dataPackageUri)
 
    &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;/font&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Come vedete, il gestore dell'evento assegna alcune proprietà dell'oggetto &lt;font face="Courier New"&gt;e.Request&lt;/font&gt; che è quello che attiva lo sharing nel momento in cui si invoca il metodo &lt;font face="Courier New"&gt;SetUri&lt;/font&gt;. A tal proposito è bene evidenziare che il metodo ShareSourceLoad va invocato nel costruttore:&lt;/font&gt;&lt;/p&gt;
&lt;font face="Verdana"&gt;
&lt;pre style="FONT-SIZE: 13px; FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black"&gt;&lt;font face="Courier New"&gt;    &lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt; &lt;span style="COLOR: blue"&gt;New&lt;/span&gt;()
 
        &lt;span style="COLOR: green"&gt;' This call is required by the designer.&lt;/span&gt;
        InitializeComponent()
 
        &lt;span style="COLOR: green"&gt;' Add any initialization after the InitializeComponent() call.&lt;/span&gt;
        ShareSourceLoad()
    &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;/font&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;In realtà la user interface relativa alla condivisione può essere invocata anche da codice, ragion per la quale aspettiamo di vedere in azione il codice precedente dopo aver implementato l'app bar. In ogni caso, con questi pochi passaggi Windows automaticamente fornirà l'elenco di applicazioni che sono in grado di ricevere il contenuto condiviso. Il che significa che Windows non consentirà di condividere un link con un'app per foto, facendo così un lavoro egregio.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;&lt;strong&gt;"Vuole il menu o sa già?" - L'app bar e i comandi&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;E' chiaro che anche in un'app Metro ci deve essere la possibilità di offrire dei comandi attraverso dei pulsanti. Mentre nelle classiche applicazioni desktop abbiamo i menu (o recentemente il Ribbon), in Metro si ha la cosiddetta app bar che è una barra a scomparsa sulla quale definiamo i comandi da offrire. &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Nel nostro caso metteremo due pulsanti: uno per visualizzare il contenuto del feed in un'anteprima Web migliore e uno per attivare lo share contract da codice (per fini didattici). A questo punto occorre fare un'importante considerazione: i pulsanti nell'app bar devono essere, chiaramente, in stile Metro con delle apposite icone.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Per fortuna Visual Studio 11 ci toglie da un gran bell'impiccio, fornendo tutte le icone di uso più comune direttamente in codice XAML contenuto nel file Common\StandardStyles.xaml. &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Non serve riportare pedissequamente quel codice qui, vi basta esplorare il file. Degno di nota è il fatto che viene definito uno stile base chiamato &lt;font color="#800000" face="Courier New"&gt;AppBarButtonStyle&lt;/font&gt;, dal quale ereditano poi i vari altri stili.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Ovviamente non sempre gli stili standard soddisfano le nostre necessità di conseguenza è possibile definire degli stili personalizzati. Posto quindi che avremo due pulsanti, uno al quale assegneremo un'icona standard e uno al quale assegneremo un'icona custom, definiamo un'icona personalizzata per rappresentare la preview Web. Il codice è ripreso dalla &lt;a href="http://msdn.microsoft.com/en-us/library/windows/apps/br211380.aspx"&gt;documentazione&lt;/a&gt; che vi ho già linkato in precedenza e va inserito nelle risorse della pagina:&lt;/font&gt;&lt;/p&gt;
&lt;font face="Verdana"&gt;
&lt;pre style="FONT-SIZE: 13px; FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black"&gt;&lt;font face="Courier New"&gt;&lt;span style="COLOR: #a31515"&gt;        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Style&lt;/span&gt;&lt;span style="COLOR: red"&gt; x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Key&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"WebViewAppBarButtonStyle"&lt;/span&gt;&lt;span style="COLOR: red"&gt; TargetType&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Button"&lt;/span&gt; 
          &lt;span style="COLOR: red"&gt; BasedOn&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="COLOR: red"&gt; AppBarButtonStyle&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Setter&lt;/span&gt;&lt;span style="COLOR: red"&gt; Property&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"AutomationProperties.AutomationId"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Value&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"WebViewAppBarButton"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Setter&lt;/span&gt;&lt;span style="COLOR: red"&gt; Property&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"AutomationProperties.Name"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Value&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"View Web Page"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Setter&lt;/span&gt;&lt;span style="COLOR: red"&gt; Property&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Content"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Value&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&amp;amp;#xE12B;"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Style&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;/font&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Due cose: &lt;font color="#ff0000" face="Courier New"&gt;AutomationProperties.Name&lt;/font&gt; andrà ad identificare il pulsante con un identificatore, mentre &lt;font color="#ff0000" face="Courier New"&gt;Content&lt;/font&gt; rappresenta il modo in cui l'icona deve essere disegnata. Le possibilità di definizione della proprietà Value sono discusse nella documentazione.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;L'app bar, per praticità, può essere definita prima della Grid principale ed è rappresentata da un oggetto &lt;font color="#800000" face="Courier New"&gt;AppBar&lt;/font&gt; che necessariamente va all'interno di un contenitore chiamato &lt;font color="#800000" face="Courier New"&gt;Page.TopAppBar&lt;/font&gt; se vogliamo che questa risieda nell'area superiore o &lt;font color="#800000" face="Courier New"&gt;Page.BottomAppBar&lt;/font&gt; se vogliamo che risieda in quella inferiore. Nel nostro caso è fatta così:&lt;/font&gt;&lt;/p&gt;
&lt;font face="Verdana"&gt;
&lt;pre style="FONT-SIZE: 13px; FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black"&gt;&lt;font face="Courier New"&gt;&lt;span style="COLOR: #a31515"&gt;        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Page.TopAppBar&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;AppBar&lt;/span&gt;&lt;span style="COLOR: red"&gt; Padding&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"10,0,10,0"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
 
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Button&lt;/span&gt;&lt;span style="COLOR: red"&gt; Click&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"ViewDetail_Click"&lt;/span&gt;&lt;span style="COLOR: red"&gt; HorizontalAlignment&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Right"&lt;/span&gt; 
                   &lt;span style="COLOR: red"&gt; Style&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="COLOR: red"&gt; WebViewAppBarButtonStyle&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Button&lt;/span&gt;&lt;span style="COLOR: red"&gt; Name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"ShareButton"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Click&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"ShareButton_Click_1"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Style&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="COLOR: red"&gt; MailAppBarButtonStyle&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;&lt;span style="COLOR: red"&gt; HorizontalAlignment&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Left"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;AppBar&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Page.TopAppBar&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;/font&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Quindi come vedete l'app bar contiene due pulsanti definiti nel modo consueto, che puntano a due gestori di evento Click. Notate come lo style vada a fare riferimento a quello custom e a quello predefinito. &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Passando ai gestori di evento, innanzitutto vediamo come sia possibile richiamare da codice il charm della condivisione con un metodo statico chiamato ShowShareUI:&lt;/font&gt;&lt;/p&gt;
&lt;font face="Verdana"&gt;
&lt;pre style="FONT-SIZE: 13px; FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black"&gt;&lt;font face="Courier New"&gt;    &lt;span style="COLOR: blue"&gt;Private&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt; ShareButton_Click_1(sender &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Object&lt;/span&gt;, e &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;RoutedEventArgs&lt;/span&gt;)
        &lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt; currentFeed = &lt;span style="COLOR: blue"&gt;CType&lt;/span&gt;(&lt;span style="COLOR: blue"&gt;Me&lt;/span&gt;.ItemListView.SelectedItem, FeedItem)
 
        dataPackageTitle = currentFeed.Title
        dataPackageDescription = currentFeed.Content
        dataPackageUri = currentFeed.Link
 
        datatransferManager.ShowShareUI()
    &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;/font&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Si ottiene semplicemente l'istanza del feed, si popolano le proprietà, si invoca l'interfaccia grafica da codice. Poi si passa all'altro pulsante:&lt;/font&gt;&lt;/p&gt;
&lt;font face="Verdana"&gt;
&lt;pre style="FONT-SIZE: 13px; FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black"&gt;&lt;font face="Courier New"&gt;    &lt;span style="COLOR: blue"&gt;Private&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt; ViewDetail_Click(sender &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Object&lt;/span&gt;, e &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;RoutedEventArgs&lt;/span&gt;)
        &lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt; selectedItem &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; FeedItem = &lt;span style="COLOR: blue"&gt;Me&lt;/span&gt;.ItemListView.SelectedItem
        &lt;span style="COLOR: blue"&gt;If&lt;/span&gt; selectedItem &lt;span style="COLOR: blue"&gt;IsNot&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Nothing&lt;/span&gt; &lt;span style="COLOR: blue"&gt;And&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Me&lt;/span&gt;.Frame &lt;span style="COLOR: blue"&gt;IsNot&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Nothing&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;
            &lt;span style="COLOR: blue"&gt;RemoveHandler&lt;/span&gt; datatransferManager.DataRequested, &lt;span style="COLOR: blue"&gt;AddressOf&lt;/span&gt; datatransferManager_DataRequested
            &lt;span style="COLOR: blue"&gt;Me&lt;/span&gt;.Frame.Navigate(&lt;span style="COLOR: blue"&gt;GetType&lt;/span&gt;(WebPreviewItemsPage), selectedItem)
        &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;If&lt;/span&gt;
    &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;/font&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;L'oggetto &lt;font face="Courier New"&gt;Frame&lt;/font&gt; rappresenta il modo con cui controlliamo la navigazione tra pagine. Il suo metodo Navigate permette di aprire la pagina il cui nome/oggetto è il primo argomento, mentre il secondo rappresenta il dato da passare. Chiaramente la pagina di destinazione sarà definita a momenti, ma voglio prima sottolineare la necessità di rimuovere la sottoscrizione all'evento &lt;font face="Courier New"&gt;DataRequested&lt;/font&gt; poiché quando si ritorna alla pagina principale, il Runtime tenta di sottoscriverlo ancora e rimuoverla serve ad evitare eccezioni.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;&lt;strong&gt;Navigazione tra pagine&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Avete già sviluppato per Windows Phone? Bravi &lt;img alt="" src="/aspx/providers/BlogEntryEditor/FCKeditor/editor/images/smiley/msn/regular_smile.gif" /&gt; Pur se con un'infrastruttura di oggetti diversa, in Metro esiste il concetto di pagina e di navigazione. Esiste un framework che permette di spostarsi tra pagine e che addirittura espone metodi per tornare alla pagina principale e di controllo sul fatto che tornare indietro sia possibile.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Aggiungiamo quindi al progetto un nuovo elemento di tipo Basic Page, un template nel quale viene ereditata la classe &lt;font face="Courier New"&gt;LayoutAwarePage&lt;/font&gt; che offre l'infrastruttura sopra citata:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;&lt;img alt="" width="951" height="658" src="/images/community_visual-basic_it/Alessandro/Metro/MetroVB16.jpg" /&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Una volta creato il nuovo elemento con il nome come in figura, andiamo a definire lo XAML:&lt;br /&gt;
&lt;/font&gt;&lt;/p&gt;
&lt;font face="Verdana"&gt;
&lt;pre style="FONT-SIZE: 13px; FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black"&gt;&lt;font face="Courier New"&gt;&lt;span style="COLOR: #a31515"&gt;        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="COLOR: red"&gt; Background&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="COLOR: red"&gt; ApplicationPageBackgroundBrush&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;RowDefinition&lt;/span&gt;&lt;span style="COLOR: red"&gt; Height&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"140"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;RowDefinition&lt;/span&gt;&lt;span style="COLOR: red"&gt; Height&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"*"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
 
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: green"&gt;&amp;lt;!-- Back button and page title --&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ColumnDefinition&lt;/span&gt;&lt;span style="COLOR: red"&gt; Width&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Auto"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ColumnDefinition&lt;/span&gt;&lt;span style="COLOR: red"&gt; Width&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"*"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Button&lt;/span&gt;&lt;span style="COLOR: red"&gt; x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"backButton"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Click&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"GoBack"&lt;/span&gt; 
                   &lt;span style="COLOR: red"&gt; IsEnabled&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="COLOR: red"&gt; Frame&lt;/span&gt;&lt;span style="COLOR: blue"&gt;.&lt;/span&gt;&lt;span style="COLOR: blue"&gt;CanGoBack&lt;/span&gt;&lt;span style="COLOR: blue"&gt;,&lt;/span&gt;&lt;span style="COLOR: red"&gt; ElementName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;pageRoot&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt; 
                   &lt;span style="COLOR: red"&gt; Style&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="COLOR: red"&gt; BackButtonStyle&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="COLOR: red"&gt; x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"pageTitle"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Grid.Column&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"1"&lt;/span&gt; 
                      &lt;span style="COLOR: red"&gt; Text&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="COLOR: red"&gt; Title&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt; 
                      &lt;span style="COLOR: red"&gt; FontSize&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"26.667"&lt;/span&gt;
                      &lt;span style="COLOR: red"&gt; Margin&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"12,20,12,2"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Border&lt;/span&gt;&lt;span style="COLOR: red"&gt; x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"contentViewBorder"&lt;/span&gt;&lt;span style="COLOR: red"&gt; BorderBrush&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Gray"&lt;/span&gt;&lt;span style="COLOR: red"&gt; BorderThickness&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"2"&lt;/span&gt; 
               &lt;span style="COLOR: red"&gt; Grid.Row&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"1"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Margin&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"120,15,20,20"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;WebView&lt;/span&gt;&lt;span style="COLOR: red"&gt; x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"contentView"&lt;/span&gt;&lt;span style="COLOR: blue"&gt; /&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Border&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
 
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: green"&gt;&amp;lt;!-- Omissis .... --&amp;gt;&lt;/span&gt;
 
&lt;span style="COLOR: #a31515"&gt;        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;/font&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Ho omesso tutta la parte relativa al Visual State Manager che Visual Studio ha generato. Qui è importante sottolineare ancora l'utilizzo del WebView per la visualizzazione e il fatto che il pulsante per tornare alla pagina precedente sia in binding con uno specifico metodo chiamato &lt;font face="Courier New"&gt;GoBack&lt;/font&gt; che non c'è necessità di implementare perché definito già nella classe base; stesso dicasi per il &lt;font face="Courier New"&gt;CanGoBack&lt;/font&gt; che abilita il pulsante se il suo stato è True. A questo punto dobbiamo dire alla pagina come trattare i dati che la pagina chiamante ha inviato.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Si fa l'override del metodo OnNavigatedTo, in un modo simile al seguente:&lt;/p&gt;
&lt;pre style="FONT-SIZE: 13px; FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black"&gt;&lt;font face="Courier New"&gt;    &lt;span style="COLOR: blue"&gt;Protected&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Overrides&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt; OnNavigatedTo(e &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; Navigation.&lt;span style="COLOR: #2b91af"&gt;NavigationEventArgs&lt;/span&gt;)
        &lt;span style="COLOR: green"&gt;' Add this code to navigate the web view to the selected blog post.&lt;/span&gt;
        &lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt; _feedItem &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; FeedItem = e.Parameter
        &lt;span style="COLOR: blue"&gt;If&lt;/span&gt; _feedItem &lt;span style="COLOR: blue"&gt;IsNot&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Nothing&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;
            &lt;span style="COLOR: blue"&gt;Me&lt;/span&gt;.contentView.Navigate(_feedItem.Link)
            &lt;span style="COLOR: blue"&gt;Me&lt;/span&gt;.DataContext = _feedItem
        &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;If&lt;/span&gt;
    &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;L'oggetto e.Parameter riceve i dati dalla pagina chiamante; questi vengono convertiti in un oggetto FeedItem e il relativo link viene passato al controllo WebView. A questo punto possiamo finalmente testare l'app!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Test dell'app&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Ecco quindi che tornano familiari le immagini presentate nel post precedente. L'app bar (che per i test col mouse potete attivare col tasto destro):&lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="http://community.visual-basic.it/images/community_visual-basic_it/Alessandro/Metro/MetroVB14.JPG" /&gt;&lt;/p&gt;
&lt;p&gt; E lo Share contract:&lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="http://community.visual-basic.it/images/community_visual-basic_it/Alessandro/Metro/MetroVB13.JPG" /&gt;&lt;/p&gt;
&lt;p&gt;Vi invito a fare un test reale dello sharing, selezionando ad esempio il client di posta elettronica, per capire come la tecnica funzioni.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Conclusioni&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In questo lunghissimo post abbiamo quindi visto due caratteristiche specifiche di Windows 8, ossia l'interazione con uno dei charm e l'app bar. In realtà manca un tassello, che è la definizione dell'orientamento dell'app in base alla rotazione del dispositivo, che vedremo nel prossimo post.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Download del codice&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Ogni promessa è debito e poiché siete stati pazienti, questo è il &lt;a href="http://www.visual-basic.it/scarica.asp?ID=1080"&gt;link&lt;/a&gt; per scaricare il codice sorgente del progetto dimostrato finora. Preciso che il codice già contiene anche le modifiche che faremo nel prossimo post, così avrete una traccia utile da seguire.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;font color="#339966"&gt;Alessandro&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;img src="http://community.visual-basic.it/Alessandro/aggbug/38145.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Alessandro Del Sole</dc:creator>
            <guid>http://community.visual-basic.it/Alessandro/archive/2012/04/26/Sviluppare-Metro-style-app-per-Windows-8-con-Visual-BasicOnceAgain.aspx</guid>
            <pubDate>Thu, 26 Apr 2012 21:26:27 GMT</pubDate>
            <comments>http://community.visual-basic.it/Alessandro/archive/2012/04/26/Sviluppare-Metro-style-app-per-Windows-8-con-Visual-BasicOnceAgain.aspx#feedback</comments>
            <wfw:commentRss>http://community.visual-basic.it/Alessandro/comments/commentRss/38145.aspx</wfw:commentRss>
            <trackback:ping>http://community.visual-basic.it/Alessandro/services/trackbacks/38145.aspx</trackback:ping>
        </item>
        <item>
            <title>Sviluppare Metro-style app per Windows 8 con Visual Basic - quarta parte</title>
            <category>Visual Basic</category>
            <category>Windows 8 &amp; Metro</category>
            <category>Visual Studio 11</category>
            <link>http://community.visual-basic.it/Alessandro/archive/2012/04/23/Sviluppare-Metro-style-app-per-Windows-8-con-Visual-BasicAndAgain.aspx</link>
            <description>&lt;p&gt;&lt;font face="Verdana"&gt;Dopo qualche giorno riprendiamo la serie di post introduttivi allo sviluppo Metro per Windows 8 con Visual Basic. Finalmente iniziamo a scrivere codice ed a questo proposito faccio le seguenti precisazioni:&lt;/font&gt;&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;font face="Verdana"&gt;l'app che iniziamo a creare oggi (e che sarà completata nel prossimo post) è un news reader, ossia aggrega e presenta feed RSS. &lt;/font&gt;&lt;/li&gt;
    &lt;li&gt;&lt;font face="Verdana"&gt;sebbene questa possa sembrare la più banale delle app, e in effetti può esserlo, è la palestra ideale per capire una serie di concetti come l'uso di XAML, il pattern &lt;font color="#0000ff"&gt;Async&lt;/font&gt;, l'uso dei contract. Queste sono tutte specificità di Windows 8/Metro e vi renderete conto presto del fatto che scegliere di realizzare un'applicazione semplice o banale permette di concentrarsi sugli aspetti nuovi e tipici di Metro.&lt;/font&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Il codice completo sarà disponibile per il download dal prossimo post. Parlando per immagini, oggi arriveremo a questo:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="" width="937" height="579" src="/images/community_visual-basic_it/Alessandro/Metro/MetroVB12.JPG" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Decisamente essenziale, non c'è dubbio. La prossima volta arriveremo però a definire e utilizzare l'app bar:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="" width="937" height="579" src="/images/community_visual-basic_it/Alessandro/Metro/MetroVB14.JPG" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Qui scopriremo anche che non dovremo impazzire a creare icone Metro, perché Visual Studio le genera per noi. Inoltre implementeremo lo Share contract integrato col sistema operativo:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="" width="937" height="579" src="/images/community_visual-basic_it/Alessandro/Metro/MetroVB13.JPG" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Quindi news reader si, ma di classe &lt;img alt="" src="/aspx/providers/BlogEntryEditor/FCKeditor/editor/images/smiley/msn/wink_smile.gif" /&gt; Prima di andare avanti, vi consiglio di aprire in un'altra istanza del browser il seguente documento MSDN, del quale andremo a prendere alcuni frammenti di codice, riadattati al nostro caso: &lt;a href="http://msdn.microsoft.com/en-us/library/windows/apps/br211380.aspx"&gt;Create your first Metro style app with C# or Visual Basic&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;&lt;strong&gt;Creazione del progetto&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;In Visual Studio 11 creiamo un nuovo progetto Metro con VB, scegliendo il template&lt;em&gt; Blank Application&lt;/em&gt;. Questo genera un file XAML vuoto e senza dati di esempio. Così evitiamo confusioni e costruiremo il tutto a manina.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;&lt;strong&gt;I dati&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;L'app si occuperà di scaricare e presentare informazioni provenienti dal feed ufficiale delle notizie su Visual Basic di MSDN. La prima cosa da fare è quindi creare una classe che chiameremo &lt;font face="Courier New"&gt;FeedItem&lt;/font&gt;, che rappresenta la singola notizia:&lt;/font&gt;&lt;/p&gt;
&lt;font face="Verdana"&gt;
&lt;pre style="FONT-SIZE: 13px; FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black"&gt;&lt;font face="Courier New"&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Class&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;FeedItem&lt;/span&gt;
 
    &lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Property&lt;/span&gt; Title &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt; = &lt;span style="COLOR: blue"&gt;String&lt;/span&gt;.Empty
    &lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Property&lt;/span&gt; Author &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt; = &lt;span style="COLOR: blue"&gt;String&lt;/span&gt;.Empty
    &lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Property&lt;/span&gt; Content &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt; = &lt;span style="COLOR: blue"&gt;String&lt;/span&gt;.Empty
    &lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Property&lt;/span&gt; PubDate &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Date&lt;/span&gt;
    &lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Property&lt;/span&gt; Link &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Uri&lt;/span&gt;
&lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Class&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;/font&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Ci occorre poi una classe che rappresenti una collezione di notizie. Noi interrogheremo un solo feed, ma tale classe ci consente di avere più feed come peraltro dimostrato nella pagina MSDN linkata in precedenza. La classe si chiama &lt;font face="Courier New"&gt;FeedData&lt;/font&gt; ed è la seguente:&lt;/font&gt;&lt;/p&gt;
&lt;font face="Verdana"&gt;
&lt;pre style="FONT-SIZE: 13px; FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black"&gt;&lt;font face="Courier New"&gt;&lt;span style="COLOR: blue"&gt;Imports&lt;/span&gt; Windows.Web.Syndication
 
&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Class&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;FeedData&lt;/span&gt;
    &lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Property&lt;/span&gt; Title &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt; = &lt;span style="COLOR: blue"&gt;String&lt;/span&gt;.Empty
    &lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Property&lt;/span&gt; Description &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt; = &lt;span style="COLOR: blue"&gt;String&lt;/span&gt;.Empty
    &lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Property&lt;/span&gt; PubDate &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Date&lt;/span&gt;
    &lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Property&lt;/span&gt; Link &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Uri&lt;/span&gt;
 
    &lt;span style="COLOR: blue"&gt;Private&lt;/span&gt; _items &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;New&lt;/span&gt; List(&lt;span style="COLOR: blue"&gt;Of&lt;/span&gt; FeedItem)
 
    &lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;ReadOnly&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Property&lt;/span&gt; Items &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; List(&lt;span style="COLOR: blue"&gt;Of&lt;/span&gt; FeedItem)
        &lt;span style="COLOR: blue"&gt;Get&lt;/span&gt;
            &lt;span style="COLOR: blue"&gt;Return&lt;/span&gt; _items
        &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Get&lt;/span&gt;
    &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Property&lt;/span&gt;
&lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Class&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;/font&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Prima considerazione: WinRT offre una strada già pronta per accedere ai feed RSS e Atom attraverso il namespace &lt;font face="Courier New"&gt;Windows.Web.Syndication&lt;/font&gt;. Ora è necessario creare una classe che si occupi di interrogare il feed e di esporre le notizie a codice chiamante. La chiamiamo &lt;font face="Courier New"&gt;FeedDataSource&lt;/font&gt; e questa è la prima parte:&lt;/font&gt;&lt;/p&gt;
&lt;font face="Verdana"&gt;
&lt;pre style="FONT-SIZE: 13px; FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black"&gt;&lt;font face="Courier New"&gt;&lt;span style="COLOR: blue"&gt;Imports&lt;/span&gt; Windows.Web.Syndication
 
&lt;span style="COLOR: green"&gt;' FeedDataSource&lt;/span&gt;
&lt;span style="COLOR: green"&gt;' Holds a collection of blog feeds (FeedData), and contains methods needed to&lt;/span&gt;
&lt;span style="COLOR: green"&gt;' retreive the feeds.&lt;/span&gt;
&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Class&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;FeedDataSource&lt;/span&gt;
    &lt;span style="COLOR: blue"&gt;Private&lt;/span&gt; _Feeds &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;New&lt;/span&gt; ObservableCollection(&lt;span style="COLOR: blue"&gt;Of&lt;/span&gt; FeedData)()
    &lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;ReadOnly&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Property&lt;/span&gt; Feeds() &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; ObservableCollection(&lt;span style="COLOR: blue"&gt;Of&lt;/span&gt; FeedData)
        &lt;span style="COLOR: blue"&gt;Get&lt;/span&gt;
            &lt;span style="COLOR: blue"&gt;Return&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Me&lt;/span&gt;._Feeds
        &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Get&lt;/span&gt;
    &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Property&lt;/span&gt;
 
    &lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;font color="#0000ff"&gt;Async&lt;/font&gt; Function GetFeedsAsync() As Task
    &lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt; feed1 &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; Task(&lt;span style="COLOR: blue"&gt;Of&lt;/span&gt; FeedData) =
        GetFeedAsync(&lt;span style="COLOR: #a31515"&gt;"http://services.social.microsoft.com/feeds/feed/VB_featured_resources"&lt;/span&gt;)
 
 
        &lt;span style="COLOR: blue"&gt;Me&lt;/span&gt;.Feeds.Add(Await feed1)
    &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Function&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;/font&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;La collection di feed è di banale interpretazione. E' importante capire che usiamo una collection perché potremmo avere più feed, sebbene qui ne interroghiamo uno solo. Diciamo che ci piace guardare avanti :-) &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Ciò che dobbiamo invece considerare è la definizione del metodo &lt;font face="Courier New"&gt;GetFeedsAsync&lt;/font&gt;. Tale metodo legge in modo asincrono il contenuto del feed e lo aggiunge alla collezione. La sua definizione contiene la parola chiave Async e restituisce un oggetto &lt;font face="Courier New"&gt;Task&lt;/font&gt;, due cose che vanno a braccetto. L'uso di Async è necessario per dire che l'operazione è asincrona, che è normale in Windows 8. Poiché l'operazione è asincrona e non sequenziale, si restituisce un oggetto Task, che già conoscete se avete letto almeno qualcosa della Task Parallel Library. Il suffisso Async è ncessario per convenzione nelle definizioni dei metodi asincroni. &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;L'uso della parola chiave Async è necessario anche per un altro motivo: il metodo legge il contenuto dei feed attraverso un altro metodo asincrono chiamato &lt;font face="Courier New"&gt;GetFeedAsync&lt;/font&gt;. Eccone il codice, che completa la definizione della classe:&lt;/font&gt;&lt;/p&gt;
&lt;font face="Verdana"&gt;
&lt;pre style="FONT-SIZE: 13px; FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black"&gt;&lt;font face="Courier New"&gt;    &lt;span style="COLOR: blue"&gt;Private&lt;/span&gt; Async Function GetFeedAsync(feedUriString As String) As Task(Of FeedData)
&lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt; Client &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;New&lt;/span&gt; SyndicationClient
&lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt; FeedUri &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;New&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Uri&lt;/span&gt;(feedUriString)
 
        &lt;span style="COLOR: blue"&gt;Try&lt;/span&gt;
            &lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt; Feed &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; SyndicationFeed = Await Client.RetrieveFeedAsync(FeedUri)
 
&lt;span style="COLOR: green"&gt;' This code is executed after RetrieveFeedAsync returns the SyndicationFeed.&lt;/span&gt;
&lt;span style="COLOR: green"&gt;' Process the feed and copy the data we want into our FeedData and FeedItem classes.&lt;/span&gt;
&lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt; FeedData &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;New&lt;/span&gt; FeedData
            FeedData.Link = FeedUri
            FeedData.Title = Feed.Title.Text
 
            &lt;span style="COLOR: blue"&gt;If&lt;/span&gt; Feed.Subtitle.Text &lt;span style="COLOR: blue"&gt;IsNot&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Nothing&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;
                FeedData.Description = Feed.Subtitle.Text
            &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;If&lt;/span&gt;
&lt;span style="COLOR: green"&gt;' Use the date of the latest post as the last updated date.&lt;/span&gt;
            FeedData.PubDate = Feed.Items(0).PublishedDate.DateTime
            &lt;span style="COLOR: blue"&gt;For&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Each&lt;/span&gt; Item &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; SyndicationItem &lt;span style="COLOR: blue"&gt;In&lt;/span&gt; Feed.Items
&lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt; FeedItem &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;New&lt;/span&gt; FeedItem
                FeedItem.Title = Item.Title.Text
                FeedItem.PubDate = Item.PublishedDate.DateTime
                &lt;span style="COLOR: blue"&gt;If&lt;/span&gt; Item.Authors.Any &lt;span style="COLOR: blue"&gt;Then&lt;/span&gt; FeedItem.Author = Item.Authors(0).Name
 
                FeedItem.Content = Item.Summary.Text
                FeedItem.Link = Item.Links(0).Uri
 
                FeedData.Items.Add(FeedItem)
            &lt;span style="COLOR: blue"&gt;Next&lt;/span&gt;
            &lt;span style="COLOR: blue"&gt;Return&lt;/span&gt; FeedData
 
        &lt;span style="COLOR: blue"&gt;Catch&lt;/span&gt; Ex &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; Exception
            &lt;span style="COLOR: blue"&gt;Return&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Nothing&lt;/span&gt;
        &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Try&lt;/span&gt;
    &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Function&lt;/span&gt;
&lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Class&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;/font&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;La classe &lt;font face="Courier New"&gt;SyndicationClient&lt;/font&gt; fornisce un'infrastruttura nativa per leggere feed attraverso il suo metodo &lt;font face="Courier New"&gt;Client.RetrieveFeedAsync&lt;/font&gt;, il cui risultato è di tipo &lt;font face="Courier New"&gt;SyndicationFeed&lt;/font&gt;. Come si può facilmente intuire, quest'ultima classe rappresenta un feed e le sue notizie. Il metodo in questione è preceduto da &lt;font color="#0000ff" face="Courier New"&gt;Await&lt;/font&gt;, che vuol dire: esegui l'operazione in modo asincrono ed attendi il suo completamento per assegnare il risultato alla variabile. &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Per il resto, si fa uso della classe &lt;font face="Courier New"&gt;SyndicationItem&lt;/font&gt; che rappresenta una singola notizia nel feed (ossia nella collection di notizie esposte dal &lt;font face="Courier New"&gt;SyndicationFeed&lt;/font&gt;). Ciclare tale collection permette poi di creare tante istanze della classe FeedItem quante sono le notizie. L'uso di tale classe è veramente intuitivo e non mi dilungo troppo su questa, descritta comunque nella documentazione MSDN.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Seguendo l'esempio della documentazione stessa, nel file App.xaml.vb (ve lo ricordate? lo stesso di WPF, Silverlight, Windows Phone....) esponiamo la sorgente dati istanziata:&lt;/font&gt;&lt;/p&gt;
&lt;pre style="FONT-SIZE: 13px; FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black"&gt;&lt;font face="Courier New"&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Shared&lt;/span&gt; DataSource &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; FeedDataSource
 
&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt; &lt;span style="COLOR: blue"&gt;New&lt;/span&gt;()
 
    &lt;span style="COLOR: green"&gt;' This call is required by the designer.&lt;/span&gt;
    InitializeComponent()
 
    &lt;span style="COLOR: green"&gt;' Add any initialization after the InitializeComponent() call.&lt;/span&gt;
    DataSource = &lt;span style="COLOR: blue"&gt;New&lt;/span&gt; FeedDataSource
&lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Passiamo ora ad implementare altre parti dell'infrastruttura.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;&lt;strong&gt;Converters&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Anche in Metro esiste il concetto dei value converters, da richiamare da XAML. Ed esattamente come nelle altre tecnologie, come WPF/Silverlight/Phone, i converters si creano attraverso l'implementazione dell'interfaccia &lt;font face="Courier New"&gt;IValueConverter&lt;/font&gt;. Il che significa che non avremo difficoltà! &lt;img alt="" src="/aspx/providers/BlogEntryEditor/FCKeditor/editor/images/smiley/msn/thumbs_up.gif" /&gt;&lt;/font&gt; &lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Con particolare riguardo al nostro caso, ci serve un value converter per formattare le date provenienti dal feed. Prendiamo ancora spunto dalla documentazione per implementare una classe chiamata &lt;font face="Courier New"&gt;DateConverter&lt;/font&gt;, definita come segue e che potrà avere molteplici utilizzi:&lt;/font&gt;&lt;/p&gt;
&lt;font face="Verdana"&gt;
&lt;pre style="FONT-SIZE: 13px; FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black"&gt;&lt;font face="Courier New"&gt;&lt;span style="COLOR: blue"&gt;Imports&lt;/span&gt; Windows.Globalization.DateTimeFormatting
 
&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Class&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;DateConverter&lt;/span&gt;
    &lt;span style="COLOR: blue"&gt;Implements&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;IValueConverter&lt;/span&gt;
 
    &lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Function&lt;/span&gt; Convert(&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt; value &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Object&lt;/span&gt;, &lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt; targetType &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Type&lt;/span&gt;, &lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt; parameter &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Object&lt;/span&gt;, &lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt; culture &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt;) _
        &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Object&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Implements&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;IValueConverter&lt;/span&gt;.Convert
        &lt;span style="COLOR: blue"&gt;If&lt;/span&gt; value &lt;span style="COLOR: blue"&gt;Is&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Nothing&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;
            &lt;span style="COLOR: blue"&gt;Throw&lt;/span&gt; &lt;span style="COLOR: blue"&gt;New&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;ArgumentNullException&lt;/span&gt;(&lt;span style="COLOR: #a31515"&gt;"value"&lt;/span&gt;, &lt;span style="COLOR: #a31515"&gt;"Value cannot be null."&lt;/span&gt;)
        &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;If&lt;/span&gt;
        &lt;span style="COLOR: blue"&gt;If&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Not&lt;/span&gt; &lt;span style="COLOR: blue"&gt;GetType&lt;/span&gt;(&lt;span style="COLOR: #2b91af"&gt;DateTime&lt;/span&gt;).Equals(value.GetType()) &lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;
            &lt;span style="COLOR: blue"&gt;Throw&lt;/span&gt; &lt;span style="COLOR: blue"&gt;New&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;ArgumentException&lt;/span&gt;(&lt;span style="COLOR: #a31515"&gt;"Value must be of type DateTime."&lt;/span&gt;, &lt;span style="COLOR: #a31515"&gt;"value"&lt;/span&gt;)
        &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;If&lt;/span&gt;
 
        &lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt; dt &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;DateTime&lt;/span&gt; = &lt;span style="COLOR: blue"&gt;DirectCast&lt;/span&gt;(value, &lt;span style="COLOR: #2b91af"&gt;DateTime&lt;/span&gt;)
 
        &lt;span style="COLOR: blue"&gt;If&lt;/span&gt; parameter &lt;span style="COLOR: blue"&gt;Is&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Nothing&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;
            &lt;span style="COLOR: green"&gt;' Date "7/27/2011 9:30:59 AM" returns "7/27/2011"&lt;/span&gt;
            &lt;span style="COLOR: blue"&gt;Return&lt;/span&gt; DateTimeFormatter.ShortDate.Format(dt)
 
        &lt;span style="COLOR: blue"&gt;ElseIf&lt;/span&gt; &lt;span style="COLOR: blue"&gt;DirectCast&lt;/span&gt;(parameter, &lt;span style="COLOR: blue"&gt;String&lt;/span&gt;) = &lt;span style="COLOR: #a31515"&gt;"day"&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;
            &lt;span style="COLOR: green"&gt;' Date "7/27/2011 9:30:59 AM" returns "27"&lt;/span&gt;
            &lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt; dateFormatter &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; DateTimeFormatter = &lt;span style="COLOR: blue"&gt;New&lt;/span&gt; DateTimeFormatter(&lt;span style="COLOR: #a31515"&gt;"{day.integer(2)}"&lt;/span&gt;)
            &lt;span style="COLOR: blue"&gt;Return&lt;/span&gt; dateFormatter.Format(dt)
 
        &lt;span style="COLOR: blue"&gt;ElseIf&lt;/span&gt; &lt;span style="COLOR: blue"&gt;DirectCast&lt;/span&gt;(parameter, &lt;span style="COLOR: blue"&gt;String&lt;/span&gt;) = &lt;span style="COLOR: #a31515"&gt;"month"&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;
            &lt;span style="COLOR: green"&gt;' Date "7/27/2011 9:30:59 AM" returns "JUL"&lt;/span&gt;
            &lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt; dateFormatter &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; DateTimeFormatter = &lt;span style="COLOR: blue"&gt;New&lt;/span&gt; DateTimeFormatter(&lt;span style="COLOR: #a31515"&gt;"{month.abbreviated(3)}"&lt;/span&gt;)
            &lt;span style="COLOR: blue"&gt;Return&lt;/span&gt; dateFormatter.Format(dt).ToUpper()
 
        &lt;span style="COLOR: blue"&gt;ElseIf&lt;/span&gt; &lt;span style="COLOR: blue"&gt;DirectCast&lt;/span&gt;(parameter, &lt;span style="COLOR: blue"&gt;String&lt;/span&gt;) = &lt;span style="COLOR: #a31515"&gt;"year"&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;
            &lt;span style="COLOR: green"&gt;' Date "7/27/2011 9:30:59 AM" returns "2011"&lt;/span&gt;
            &lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt; dateFormatter &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; DateTimeFormatter = &lt;span style="COLOR: blue"&gt;New&lt;/span&gt; DateTimeFormatter(&lt;span style="COLOR: #a31515"&gt;"{year.full}"&lt;/span&gt;)
            &lt;span style="COLOR: blue"&gt;Return&lt;/span&gt; dateFormatter.Format(dt)
 
        &lt;span style="COLOR: blue"&gt;Else&lt;/span&gt;
            &lt;span style="COLOR: green"&gt;' Requested format is unknown. Return in the original format.&lt;/span&gt;
            &lt;span style="COLOR: blue"&gt;Return&lt;/span&gt; dt.ToString()
 
        &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;If&lt;/span&gt;
    &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Function&lt;/span&gt;
 
    &lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Function&lt;/span&gt; ConvertBack(&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt; value &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Object&lt;/span&gt;, &lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt; targetType &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Type&lt;/span&gt;, &lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt; parameter &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Object&lt;/span&gt;, &lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt; culture &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt;) _
        &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Object&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Implements&lt;/span&gt; Windows.UI.Xaml.Data.IValueConverter.ConvertBack
        &lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt; StrValue &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt; = &lt;span style="COLOR: blue"&gt;DirectCast&lt;/span&gt;(value, &lt;span style="COLOR: blue"&gt;String&lt;/span&gt;)
        &lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt; Result &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Date&lt;/span&gt;
        &lt;span style="COLOR: blue"&gt;If&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;DateTime&lt;/span&gt;.TryParse(StrValue, Result) &lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;
            &lt;span style="COLOR: blue"&gt;Return&lt;/span&gt; Result
        &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;If&lt;/span&gt;
        &lt;span style="COLOR: blue"&gt;Return&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;DependencyProperty&lt;/span&gt;.UnsetValue
    &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Function&lt;/span&gt;
&lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Class&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;/font&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;La lettura dei commenti aiuta nella comprensione, si noti più che altro come il namespace &lt;font face="Courier New"&gt;Windows.Globalization.DateTimeFormatting&lt;/font&gt; consenta di formattare date in modo piuttosto agevole.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;&lt;strong&gt;L'interfaccia, ovvero la leggenda del Santo XAML&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;E' giunta l'ora di passare alla definizione della UI e forse sarà questo il punto in cui Windows 8 e Metro vi spaventeranno meno e sarà forse questo il momento in cui benedirete il giorno in cui avete deciso di investire su WPF o Silverlight. Passiamo al designer facendo doppio click sul file BlankPage.xaml in Solution Explorer. Noterete subito un oggetto &lt;font color="#800000" face="Courier New"&gt;Page&lt;/font&gt;, certamente familiare. Ci interessa definire e organizzare all'interno del layout costituito da una Grid radice:&lt;/font&gt;&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;font face="Verdana"&gt;visualizzazione del testo di benvenuto&lt;/font&gt; &lt;/li&gt;
    &lt;li&gt;&lt;font face="Verdana"&gt;titolo del feed&lt;/font&gt; &lt;/li&gt;
    &lt;li&gt;&lt;font face="Verdana"&gt;un elenco delle notizie&lt;/font&gt; &lt;/li&gt;
    &lt;li&gt;&lt;font face="Verdana"&gt;un'anteprima del contenuto&lt;/font&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Ancora una volta ci viene incontro il codice della documentazione che, se avete confidenza con XAML e data-binding, vi risulterà davvero semplice (da mettere all'interno della Grid radice):&lt;/font&gt;&lt;/p&gt;
&lt;font face="Verdana"&gt;
&lt;pre style="FONT-SIZE: 13px; FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black"&gt;&lt;font face="Courier New"&gt;&lt;span style="COLOR: #a31515"&gt;        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;RowDefinition&lt;/span&gt;&lt;span style="COLOR: red"&gt; Height&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"140"&lt;/span&gt;&lt;span style="COLOR: blue"&gt; /&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;RowDefinition&lt;/span&gt;&lt;span style="COLOR: red"&gt; Height&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"*"&lt;/span&gt;&lt;span style="COLOR: blue"&gt; /&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
 
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: green"&gt;&amp;lt;!-- Title --&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="COLOR: red"&gt; x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"TitleText"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Text&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="COLOR: red"&gt; Title&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt; 
                  &lt;span style="COLOR: red"&gt; VerticalAlignment&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Center"&lt;/span&gt;&lt;span style="COLOR: red"&gt; FontSize&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"48"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Margin&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"56,0,0,0"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
 
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: green"&gt;&amp;lt;!-- Content --&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="COLOR: red"&gt; Grid.Row&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"1"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ColumnDefinition&lt;/span&gt;&lt;span style="COLOR: red"&gt; Width&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"2*"&lt;/span&gt;&lt;span style="COLOR: red"&gt; MinWidth&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"320"&lt;/span&gt;&lt;span style="COLOR: blue"&gt; /&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ColumnDefinition&lt;/span&gt;&lt;span style="COLOR: red"&gt; Width&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"3*"&lt;/span&gt;&lt;span style="COLOR: blue"&gt; /&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
 
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: green"&gt;&amp;lt;!-- Left column --&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: green"&gt;&amp;lt;!-- The default value of Grid.Column is 0, so we do not need to set it   &lt;/span&gt;
&lt;span style="COLOR: green"&gt;                 to make the ListView show up in the first column. --&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ListView&lt;/span&gt;&lt;span style="COLOR: red"&gt; x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"ItemListView"&lt;/span&gt; &lt;span style="COLOR: red"&gt; SelectionChanged&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"ItemListView_SelectionChanged"&lt;/span&gt;
         &lt;span style="COLOR: red"&gt; ItemsSource&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="COLOR: red"&gt; Items&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;
         &lt;span style="COLOR: red"&gt; Margin&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"60,0,0,10"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ListView.ItemTemplate&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DataTemplate&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StackPanel&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="COLOR: red"&gt; Text&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="COLOR: red"&gt; Title&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;  
                          &lt;span style="COLOR: red"&gt; FontSize&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"24"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Margin&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"5,0,0,0"&lt;/span&gt;&lt;span style="COLOR: red"&gt; TextWrapping&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Wrap"&lt;/span&gt;&lt;span style="COLOR: blue"&gt; /&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="COLOR: red"&gt; Text&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="COLOR: red"&gt; Author&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt; 
                          &lt;span style="COLOR: red"&gt; FontSize&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"16"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Margin&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"15,0,0,0"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="COLOR: red"&gt; Text&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="COLOR: red"&gt; Path&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;PubDate&lt;/span&gt;&lt;span style="COLOR: blue"&gt;,&lt;/span&gt;&lt;span style="COLOR: red"&gt; Converter&lt;/span&gt;&lt;span style="COLOR: blue"&gt;={&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="COLOR: red"&gt; dateConverter&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt; 
                          &lt;span style="COLOR: red"&gt; FontSize&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"16"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Margin&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"15,0,0,0"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StackPanel&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DataTemplate&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ListView.ItemTemplate&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ListView&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
 
 
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: green"&gt;&amp;lt;!-- Right column --&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: green"&gt;&amp;lt;!-- We use a Grid here instead of a StackPanel so that the WebView sizes correctly. --&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="COLOR: red"&gt; DataContext&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="COLOR: red"&gt; ElementName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;ItemListView&lt;/span&gt;&lt;span style="COLOR: blue"&gt;,&lt;/span&gt;&lt;span style="COLOR: red"&gt; Path&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;SelectedItem&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;
                 &lt;span style="COLOR: red"&gt; Grid.Column&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"1"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Margin&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"25,0,0,0"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;RowDefinition&lt;/span&gt;&lt;span style="COLOR: red"&gt; Height&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"Auto"&lt;/span&gt;&lt;span style="COLOR: blue"&gt; /&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;RowDefinition&lt;/span&gt;&lt;span style="COLOR: red"&gt; Height&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"*"&lt;/span&gt;&lt;span style="COLOR: blue"&gt; /&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="COLOR: red"&gt; x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"PostTitleText"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Text&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="COLOR: red"&gt; Title&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;&lt;span style="COLOR: red"&gt; FontSize&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"24"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;WebView&lt;/span&gt;&lt;span style="COLOR: red"&gt; x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"ContentView"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Grid.Row&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"1"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Margin&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"0,5,20,20"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;/font&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Non mi posso chiaramente soffermare su come si definisce il layout in XAML o su controlli come TextBlock e StackPanel. Focalizziamo l'attenzione sul fatto che in WinRT si usa una &lt;font color="#800000" face="Courier New"&gt;ListView&lt;/font&gt; anziché ListBox, ma il concetto dei template rimane invariato. Si noti l'utilizzo del converter definito poc'anzi. Nella seconda Grid, invece, si noti l'oggetto &lt;font color="#800000" face="Courier New"&gt;WebView&lt;/font&gt; che viene utilizzato per presentare l'anteprima del contenuto.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Esattamente come altrove, bisogna dichiarare le risorse per poterle utilizzare e questo è il caso del nostro converter. Quindi nel file App.xaml aggiungiamo un &lt;font color="#800000" face="Courier New"&gt;ResourceDictionary&lt;/font&gt; che contenga la definizione della risorsa:&lt;/font&gt;&lt;/p&gt;
&lt;font face="Verdana"&gt;
&lt;pre style="FONT-SIZE: 13px; FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black"&gt;&lt;font face="Courier New"&gt;&lt;span style="COLOR: #a31515"&gt;        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ResourceDictionary&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;local&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DateConverter&lt;/span&gt;&lt;span style="COLOR: red"&gt; x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Key&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"dateConverter"&lt;/span&gt;&lt;span style="COLOR: blue"&gt; /&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ResourceDictionary&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;/font&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;E' interessante sottolineare che non c'è necessità di definire il namespace &lt;font color="#800000" face="Courier New"&gt;local&lt;/font&gt;, poiché Visual Studio 11 lo fa per noi nella definizione dell'elemento Application. &lt;/font&gt;&lt;font face="Verdana"&gt;Si passa poi al code-behind in cui dobbiamo specificare cosa avviene quando la pagina viene raggiunta. Questo si fa con l'override del metodo &lt;font face="Courier New"&gt;OnNavigatedTo&lt;/font&gt;, passato in forma asincrona:&lt;/font&gt;&lt;/p&gt;
&lt;pre style="FONT-SIZE: 13px; FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black"&gt;&lt;font face="Courier New"&gt;    &lt;span style="COLOR: blue"&gt;Protected&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Overrides&lt;/span&gt; Async Sub OnNavigatedTo (e As Navigation.NavigationEventArgs)
    &lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt; _feedDataSource &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; FeedDataSource = App.DataSource
        &lt;span style="COLOR: blue"&gt;If&lt;/span&gt; _feedDataSource.Feeds.Any = &lt;span style="COLOR: blue"&gt;False&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;
            Await _feedDataSource.GetFeedsAsync
        &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;If&lt;/span&gt;
        &lt;span style="COLOR: blue"&gt;Me&lt;/span&gt;.DataContext = (_feedDataSource.Feeds).First
    &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span style="COLOR: blue"&gt;&lt;font color="#000000" face="Verdana"&gt;Il codice recupera l'istanza della sorgente dati e, nel caso questa non contenga elementi, invoca il suo metodo &lt;font face="Courier New"&gt;GetFeedsAsync&lt;/font&gt; per il caricamento. Infine assegna al contesto dati della pagina il primo dei feed (che in questo caso è anche l'unico).&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#000000" face="Verdana"&gt;Infine, gestiamo l'evento &lt;font face="Courier New"&gt;SelectionChanged&lt;/font&gt; per la ListView:&lt;/font&gt;&lt;/p&gt;
&lt;pre style="FONT-SIZE: 13px; FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black"&gt;&lt;font face="Courier New"&gt;   &lt;span style="COLOR: blue"&gt;Private&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt; ItemListView_SelectionChanged(sender &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Object&lt;/span&gt;, e &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; SelectionChangedEventArgs)
        &lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt; _feedItem &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; FeedItem = e.AddedItems(0)
        &lt;span style="COLOR: blue"&gt;If&lt;/span&gt; _feedItem &lt;span style="COLOR: blue"&gt;IsNot&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Nothing&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;
            &lt;span style="COLOR: green"&gt;' Navigate the WebView to the blog post content HTML string.&lt;/span&gt;
            contentView.NavigateToString(_feedItem.Content)
        &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;If&lt;/span&gt;
    &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;&lt;font color="#000000" face="Verdana"&gt;Questo recupera l'elemento selezionato e passa il suo contenuto all'oggetto WebView attraverso il metodo &lt;font face="Courier New"&gt;NavigateToString&lt;/font&gt;.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#000000" face="Verdana"&gt;&lt;strong&gt;Test&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#000000" face="Verdana"&gt;Se ora provate ad avviare l'app otterrete il risultato mostrato nella prima figura di questo post. Complimenti, avete appena creato la vostra prima Metro app con Visual Basic 11! &lt;img alt="" src="/aspx/providers/BlogEntryEditor/FCKeditor/editor/images/smiley/msn/shades_smile.gif" /&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#000000" face="Verdana"&gt;Ricapitolando, in questo post abbiamo capito come lavorare in modo asincrono, come definire l'interfaccia tramite XAML, come utilizzare alcuni oggetti offerti da WinRT. Nel prossimo post implementeremo caratteristiche specifiche di Windows 8 e daremo un'occhiata al discorso della rotazione del device.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#339966" face="Verdana"&gt;&lt;strong&gt;&lt;em&gt;Alessandro&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;&lt;img src="http://community.visual-basic.it/Alessandro/aggbug/38142.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Alessandro Del Sole</dc:creator>
            <guid>http://community.visual-basic.it/Alessandro/archive/2012/04/23/Sviluppare-Metro-style-app-per-Windows-8-con-Visual-BasicAndAgain.aspx</guid>
            <pubDate>Mon, 23 Apr 2012 18:03:28 GMT</pubDate>
            <comments>http://community.visual-basic.it/Alessandro/archive/2012/04/23/Sviluppare-Metro-style-app-per-Windows-8-con-Visual-BasicAndAgain.aspx#feedback</comments>
            <wfw:commentRss>http://community.visual-basic.it/Alessandro/comments/commentRss/38142.aspx</wfw:commentRss>
            <trackback:ping>http://community.visual-basic.it/Alessandro/services/trackbacks/38142.aspx</trackback:ping>
        </item>
        <item>
            <title>Windows Phone: utilizzare le Bing API per cercare e mostrare immagini</title>
            <category>Visual Basic</category>
            <category>Silverlight e Windows Phone 7</category>
            <link>http://community.visual-basic.it/Alessandro/archive/2012/04/23/Windows-Phone-utilizzare-le-Bing-API-per-cercare-e-mostrare.aspx</link>
            <description>&lt;p&gt;&lt;font face="Verdana"&gt;Molte volte nelle proprie applicazioni, indipendentemente dalla piattaforma di sviluppo, si ha la necessità di eseguire ricerche e di presentare i risultati della ricerca in un modo appropriato all'applicazione stessa che non sia, quindi, all'interno di un'istanza del browser.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Microsoft, per il suo motore di ricerca Bing, mette a disposizione delle specifiche API che è possibile utilizzare per interrogare Bing e ottenere vari tipi di risultati, che siano ricerche di termini, di immagini, di video, ecc.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;In questo post vediamo come utilizzare le API di Bing per ottenere un elenco di immagini da visualizzare in un'app per Windows Phone 7.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;La prima cosa da fare per poter fruire delle Bing API è ottenere un codice identificativo per la propria applicazione. Questo si fa registrandosi, con il proprio Live ID, sul &lt;a href="http://www.bing.com/toolbox/bingdeveloper/"&gt;sito dedicato agli sviluppatori&lt;/a&gt;.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;&lt;strong&gt;&lt;font color="#800000"&gt;NOTA BENE&lt;/font&gt;&lt;/strong&gt;: al momento le Bing API sono disponibili free, ma Microsoft ha iniziato un processo di &lt;a href="http://www.bing.com/community/site_blogs/b/developer/archive/2012/04/12/bing-dev-update.aspx"&gt;migrazione&lt;/a&gt; delle stesse verso il Windows Azure Marketplace, il che vuol dire che tra un po' di tempo non saranno più gratuite. &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;In questo post tratterò il caso specifico della ricerca di immagini, per tutte le altre opportunità vi rimando alla &lt;a href="http://msdn.microsoft.com/en-us/library/dd251056.aspx"&gt;documentazione&lt;/a&gt; ufficiale. I servizi di Bing possono restituire dati in vari formati, come JSON o XML. E' quest'ultimo formato che utilizzeremo insieme a LINQ.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Per questo esempio è sufficiente creare un progetto di tipo Windows Phone Application. Di tutte le informazioni che Bing restituisce, in questo caso ce ne interessano solo tre: il titolo dell'immagine, il suo URL e l'URL dell'anteprima; quest'ultima verrà visualizzata nella pagina dell'app. Dobbiamo quindi rappresentare queste informazioni con una classe:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;&lt;font face="Courier New"&gt; &lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Class&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;BingImage&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
    &lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Property&lt;/span&gt; Title &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt;&lt;br /&gt;
    &lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Property&lt;/span&gt; ImageUri &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Uri&lt;/span&gt;&lt;br /&gt;
    &lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Property&lt;/span&gt; ThumbnailUri &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Uri&lt;/span&gt;&lt;br /&gt;
&lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Class&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Ora andiamo a definire lo XAML che permette la visualizzazione delle anteprime. In questo particolare esempio siamo nell'unica pagina dell'app. Sicuramente utilizzeremo una ListBox, della quale dobbiamo ridefinire il template del contenitore che visualizza i dati. Una ottima scelta è il WrapPanel che viene fornito attraverso il &lt;/font&gt;&lt;a href="http://silverlight.codeplex.com"&gt;&lt;font face="Verdana"&gt;Silverlight Toolkit&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana"&gt; per Windows Phone, che va quindi installato (non solo per seguire questo post, ma perché è un must have). Eccolo qui:&lt;/font&gt;&lt;/p&gt;
&lt;font face="Verdana"&gt;
&lt;pre style="FONT-SIZE: 13px; FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black"&gt;&lt;font face="Courier New"&gt;&lt;span style="COLOR: #a31515"&gt;        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="COLOR: red"&gt; x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"ContentPanel"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Grid.Row&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"1"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Margin&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"12,0,12,0"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ListBox&lt;/span&gt;&lt;span style="COLOR: red"&gt; ItemsSource&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;&lt;span style="COLOR: red"&gt; x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"PhotoListBox"&lt;/span&gt;
                        &lt;span style="COLOR: red"&gt; SelectionChanged&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"PhotoListBox_SelectionChanged"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ListBox.ItemsPanel&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ItemsPanelTemplate&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;toolkit&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;WrapPanel&lt;/span&gt;&lt;span style="COLOR: blue"&gt; /&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ItemsPanelTemplate&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ListBox.ItemsPanel&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ListBox.ItemTemplate&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DataTemplate&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Image&lt;/span&gt;&lt;span style="COLOR: red"&gt; Margin&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"3"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Width&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"96"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Height&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"96"&lt;/span&gt; 
                                  &lt;span style="COLOR: red"&gt; Source&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="COLOR: red"&gt; ThumbnailUri&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DataTemplate&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ListBox.ItemTemplate&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ListBox&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #a31515"&gt;        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;/font&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Come vedete abbiamo ridefinito l'&lt;font color="#800000" face="Courier New"&gt;ItemsPanelTemplate&lt;/font&gt; sostituendo lo StackPanel di default con un WrapPanel. Quest'ultimo permetterà il posizionamento dinamico "a capo" delle thumbnail. Fatto questo abbiamo semplicemente definito l'&lt;font color="#800000" face="Courier New"&gt;ItemTemplate&lt;/font&gt; che contiene un'immagine, in binding con la proprietà &lt;font face="Courier New"&gt;ThumbnailUri&lt;/font&gt; della classe &lt;font face="Courier New"&gt;BingImage&lt;/font&gt;.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Andiamo ora nel code-behind della pagina e aggiungiamo subito le seguenti direttive Imports:&lt;/font&gt;&lt;/p&gt;
&lt;font face="Verdana"&gt;
&lt;pre style="FONT-SIZE: 13px; FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black"&gt;&lt;font face="Courier New"&gt;&lt;span style="COLOR: blue"&gt;Imports&lt;/span&gt; System.Xml.Linq
&lt;span style="COLOR: blue"&gt;Imports&lt;/span&gt; Microsoft.Phone.Tasks
&lt;span style="COLOR: blue"&gt;Imports&lt;/span&gt; &amp;lt;&lt;span style="COLOR: #b96464"&gt;xmlns&lt;/span&gt;&lt;span style="COLOR: #b96464"&gt;:&lt;/span&gt;&lt;span style="COLOR: #b96464"&gt;mms&lt;/span&gt;&lt;span style="COLOR: #6464b9"&gt;=&lt;/span&gt;&lt;span style="COLOR: #555555"&gt;"&lt;/span&gt;&lt;span style="COLOR: #6464b9"&gt;http://schemas.microsoft.com/LiveSearch/2008/04/XML/multimedia&lt;/span&gt;&lt;span style="COLOR: #555555"&gt;"&lt;/span&gt;&amp;gt;
&lt;span style="COLOR: blue"&gt;Imports&lt;/span&gt; &amp;lt;&lt;span style="COLOR: #b96464"&gt;xmlns&lt;/span&gt;&lt;span style="COLOR: #6464b9"&gt;=&lt;/span&gt;&lt;span style="COLOR: #555555"&gt;"&lt;/span&gt;&lt;span style="COLOR: #6464b9"&gt;http://schemas.microsoft.com/LiveSearch/2008/04/XML/element&lt;/span&gt;&lt;span style="COLOR: #555555"&gt;"&lt;/span&gt;&amp;gt;&lt;/font&gt;&lt;/pre&gt;
&lt;/font&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Poiché andremo a lavorare con LINQ to XML, importare i namespace sopra citati diventa necessario per referenziare gli elementi correttamente. Nel codice della pagina principale cominciamo a stabilire l'id dell'applicazione e la query da eseguire:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;&lt;font face="Verdana"&gt;&lt;font face="Courier New"&gt;&lt;br /&gt;
    &lt;span style="COLOR: blue"&gt;Const&lt;/span&gt; bingAppId &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt; = &lt;span style="COLOR: #a31515"&gt;"YOUR_BING_APPLICATION_ID_GOES_HERE"&lt;/span&gt;&lt;br /&gt;
    &lt;span style="COLOR: blue"&gt;Const&lt;/span&gt; bingQuery &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt; = &lt;span style="COLOR: #a31515"&gt;"mare%20in%20inverno"&lt;/span&gt;&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;La query contiene i termini di ricerca, che vanno separati tra loro con uno spazio (%20). In questo caso la ricerca dovrà tirare fuori immagini relative a "mare in inverno". Abbiamo detto che tra i vari formati restituiti da Bing, c'è XML. Quindi utilizzeremo il classico meccanismo legato alla classe WebClient per scaricare il risultato della ricerca e analizzarlo con LINQ, in questo modo:&lt;/font&gt;&lt;/p&gt;
&lt;font face="Verdana"&gt;
&lt;pre style="FONT-SIZE: 13px; FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black"&gt;&lt;font face="Courier New"&gt;    &lt;span style="COLOR: blue"&gt;Private&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt; MainPage_Loaded(sender &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Object&lt;/span&gt;, e &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; System.Windows.&lt;span style="COLOR: #2b91af"&gt;RoutedEventArgs&lt;/span&gt;) &lt;span style="COLOR: blue"&gt;Handles&lt;/span&gt; &lt;span style="COLOR: blue"&gt;MyBase&lt;/span&gt;.Loaded
        &lt;span style="COLOR: #2b91af"&gt;Deployment&lt;/span&gt;.Current.Dispatcher.BeginInvoke(&lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;()
                                                      &lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt; client &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;New&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;WebClient&lt;/span&gt;
 
                                                      &lt;span style="COLOR: blue"&gt;AddHandler&lt;/span&gt; client.DownloadStringCompleted,
                                                          &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;(sender1 &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Object&lt;/span&gt;, e1 &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;DownloadStringCompletedEventArgs&lt;/span&gt;)
                                                              &lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt; doc = &lt;span style="COLOR: #2b91af"&gt;XDocument&lt;/span&gt;.Parse(e1.Result)
 
                                                              &lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt; query = (&lt;span style="COLOR: blue"&gt;From&lt;/span&gt; img &lt;span style="COLOR: blue"&gt;In&lt;/span&gt; doc&lt;span style="COLOR: #6464b9"&gt;...&amp;lt;&lt;/span&gt;mms:ImageResult&lt;span style="COLOR: #6464b9"&gt;&amp;gt;&lt;/span&gt;
                                                                          &lt;span style="COLOR: blue"&gt;Select&lt;/span&gt; &lt;span style="COLOR: blue"&gt;New&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;BingImage&lt;/span&gt; &lt;span style="COLOR: blue"&gt;With&lt;/span&gt; {.ImageUri = &lt;span style="COLOR: blue"&gt;New&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Uri&lt;/span&gt;(img&lt;span style="COLOR: #6464b9"&gt;.&amp;lt;&lt;/span&gt;mms:MediaUrl&lt;span style="COLOR: #6464b9"&gt;&amp;gt;&lt;/span&gt;.Value, &lt;span style="COLOR: #2b91af"&gt;UriKind&lt;/span&gt;.Absolute),
                                                                                                     .ThumbnailUri = &lt;span style="COLOR: blue"&gt;New&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Uri&lt;/span&gt;(img&lt;span style="COLOR: #6464b9"&gt;.&amp;lt;&lt;/span&gt;mms:Thumbnail&lt;span style="COLOR: #6464b9"&gt;&amp;gt;.&amp;lt;&lt;/span&gt;mms:Url&lt;span style="COLOR: #6464b9"&gt;&amp;gt;&lt;/span&gt;.Value, &lt;span style="COLOR: #2b91af"&gt;UriKind&lt;/span&gt;.Absolute),
                                                                                                     .Title = img&lt;span style="COLOR: #6464b9"&gt;.&amp;lt;&lt;/span&gt;mms:Title&lt;span style="COLOR: #6464b9"&gt;&amp;gt;&lt;/span&gt;.Value}).ToList
 
                                                              &lt;span style="COLOR: blue"&gt;Me&lt;/span&gt;.PhotoListBox.ItemsSource = query
                                                          &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;
 
                                                      client.DownloadStringAsync(&lt;span style="COLOR: blue"&gt;New&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Uri&lt;/span&gt;(&lt;span style="COLOR: #a31515"&gt;"http://api.bing.net/xml.aspx?AppId="&lt;/span&gt; + bingAppId + _
                                                                                         &lt;span style="COLOR: #a31515"&gt;"&amp;amp;Query="&lt;/span&gt; + bingQuery + _
                                                                                         &lt;span style="COLOR: #a31515"&gt;"&amp;amp;Sources=Image&amp;amp;Version=2.0&amp;amp;Market=en-us&amp;amp;Adult=Moderate&amp;amp;Image.Count=20&amp;amp;Image.Offset=0"&lt;/span&gt;,
                                                                                         &lt;span style="COLOR: #2b91af"&gt;UriKind&lt;/span&gt;.Absolute))
                                                  &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;)
    &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;/font&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Notate come il contenuto XML venga convertito in un XDocument tramite il suo metodo Parse. Da qui in poi si fa una classica query (VB ha gli XML literals &lt;img alt="" src="/aspx/providers/BlogEntryEditor/FCKeditor/editor/images/smiley/msn/teeth_smile.gif" /&gt;) che andrà a generare una collection di oggetti BingImage, assegnata alla proprietà ItemsSource della ListBox.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;La query string da inviare a Bing è composta da una parte prefissata, seguita dall'app Id e dai termini di ricerca. La parte finale permette di specificare, in modo molto intuitivo, la localizzazione (Market), filtri per adulti (Adult=Moderate) e il numero di immagini da includere nei risultati.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Giusto per dimostrare l'utilizzo di altri oggetti, facciamo in modo che al tocco di un'anteprima venga aperta l'immagine originale in un'istanza del browser, gestendo il &lt;font face="Courier New"&gt;SelectionChanged&lt;/font&gt; della ListBox:&lt;/font&gt;&lt;/p&gt;
&lt;font face="Verdana"&gt;
&lt;pre style="FONT-SIZE: 13px; FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black"&gt;&lt;font face="Courier New"&gt;    &lt;span style="COLOR: blue"&gt;Private&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt; PhotoListBox_SelectionChanged(sender &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; System.&lt;span style="COLOR: #2b91af"&gt;Object&lt;/span&gt;, e &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; System.Windows.Controls.&lt;span style="COLOR: #2b91af"&gt;SelectionChangedEventArgs&lt;/span&gt;)
        &lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt; webTask &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;New&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;WebBrowserTask&lt;/span&gt;
        webTask.Uri = &lt;span style="COLOR: blue"&gt;CType&lt;/span&gt;(&lt;span style="COLOR: blue"&gt;Me&lt;/span&gt;.PhotoListBox.SelectedItem, &lt;span style="COLOR: #2b91af"&gt;BingImage&lt;/span&gt;).ImageUri
        webTask.Show()
    &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;/font&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;In questo caso viene chiaramente sfruttata la proprietà ImageUri della classe BingImage. La proprietà Title può essere utile se l'immagine viene mostrata in un'altra pagina in cui si voglia mostrare il titolo e verrà passata in query string sul metodo di navigazione.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Il seguente è il risultato che otteniamo nella nostra app:&lt;/p&gt;
&lt;p&gt;&lt;img width="480" height="800" alt="" src="/images/community_visual-basic_it/Alessandro/630/BingAPISearch.png" /&gt;&lt;/p&gt;
&lt;p&gt;Il codice a corredo può essere scaricato da questo &lt;a href="http://www.visual-basic.it/scarica.asp?ID=1079"&gt;indirizzo&lt;/a&gt; dell'area Download di &lt;a href="http://www.visual-basic.it"&gt;Visual Basic Tips &amp;amp; Tricks&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;font color="#339966"&gt;Alessandro&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;img src="http://community.visual-basic.it/Alessandro/aggbug/38141.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Alessandro Del Sole</dc:creator>
            <guid>http://community.visual-basic.it/Alessandro/archive/2012/04/23/Windows-Phone-utilizzare-le-Bing-API-per-cercare-e-mostrare.aspx</guid>
            <pubDate>Mon, 23 Apr 2012 08:46:14 GMT</pubDate>
            <comments>http://community.visual-basic.it/Alessandro/archive/2012/04/23/Windows-Phone-utilizzare-le-Bing-API-per-cercare-e-mostrare.aspx#feedback</comments>
            <wfw:commentRss>http://community.visual-basic.it/Alessandro/comments/commentRss/38141.aspx</wfw:commentRss>
            <trackback:ping>http://community.visual-basic.it/Alessandro/services/trackbacks/38141.aspx</trackback:ping>
        </item>
        <item>
            <title>Da Redmond: video "What's new in VB 11"</title>
            <category>Visual Basic</category>
            <category>Visual Studio 11</category>
            <link>http://community.visual-basic.it/Alessandro/archive/2012/04/18/Da-Redmond-video-Whats-new-in-VB-11.aspx</link>
            <description>&lt;p&gt;&lt;font face="Verdana"&gt;Chi meglio del grande &lt;a href="http://blogs.msdn.com/b/lucian/"&gt;Lucian Wischik&lt;/a&gt; poteva descrivere le novità di Visual Basic 11?&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Lucian, Specification Lead di Visual Basic, ha realizzato un bellissimo video disponibile su Channel 9 a questo &lt;a href="http://channel9.msdn.com/posts/Lucian-Wischik-Whats-New-in-VB11"&gt;indirizzo&lt;/a&gt;.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Vi suggerisco anche la lettura del suo &lt;a href="http://blogs.msdn.com/b/lucian/archive/2012/03/29/talk-what-s-new-in-vb11-vs11-beta.aspx"&gt;companion post&lt;/a&gt;, nel quale troverete anche i link al codice dimostrato e alle slide.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana"&gt;Riepilogo anche per comodità il &lt;a href="http://blogs.msdn.com/b/vbteam/archive/2012/02/28/visual-basic-11-beta-available-for-download.aspx"&gt;post&lt;/a&gt; introduttivo alle novità di Jonathan Aneja e questo mio &lt;a href="http://www.visual-basic.it/areaarticoli.asp?articolo=adsNovitaVB11.htm"&gt;articolo&lt;/a&gt; sulle novità di VB 11 disponibile tra i nostri articoli.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#339966" face="Verdana"&gt;&lt;strong&gt;&lt;em&gt;Alessandro&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;&lt;img src="http://community.visual-basic.it/Alessandro/aggbug/38130.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Alessandro Del Sole</dc:creator>
            <guid>http://community.visual-basic.it/Alessandro/archive/2012/04/18/Da-Redmond-video-Whats-new-in-VB-11.aspx</guid>
            <pubDate>Wed, 18 Apr 2012 15:40:09 GMT</pubDate>
            <comments>http://community.visual-basic.it/Alessandro/archive/2012/04/18/Da-Redmond-video-Whats-new-in-VB-11.aspx#feedback</comments>
            <wfw:commentRss>http://community.visual-basic.it/Alessandro/comments/commentRss/38130.aspx</wfw:commentRss>
            <trackback:ping>http://community.visual-basic.it/Alessandro/services/trackbacks/38130.aspx</trackback:ping>
        </item>
    </channel>
</rss>
