<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Avtar Sohi</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/avtarsohi/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/avtarsohi/feed.xml</link>
    <description>Tips and tricks for Powershell, XAML Asp.net, C#...</description>
    <lastBuildDate>Tue, 16 Apr 2019 04:43:52 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Understand Storyboard concept in XAML using Blend 2015</title>
      <link>https://docs.microsoft.com/archive/blogs/avtarsohi/understand-storyboard-concept-in-xaml-using-blend-2015</link>
      <pubDate>Tue, 16 Feb 2016 22:52:00 GMT</pubDate>
      <dc:creator><![CDATA[Avtar Sohi]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/avtarsohi/2016/02/16/understand-storyboard-concept-in-xaml-using-blend-2015/</guid>
      <description><![CDATA[What is Storyboard?
Before we dig into detail of Storyboard, make a note that Storyboard is tightly...]]></description>
      <content:encoded><![CDATA[<h3>What is Storyboard?</h3>
<p>Before we dig into detail of Storyboard, make a note that Storyboard is tightly coupled with animation.</p>
<p>A storyboard is nothing but a resource <span style="text-decoration: underline;">containing a collection of timeline objects</span> <span style="text-decoration: underline;">such as animations</span> and each of which targets a specific property of a control. Like background color and visibility property of a button control.</p>
<p>In other word, suppose you want to change one or more properties of controls based on either a time constraint or some user interaction or some event. This can be achieved through an animations and you group these animation into a group, that can be called as storyboard.</p>
<p>&nbsp;</p>
<h3>Understand the scenario:</h3>
<p>To understand this concept and keep it simple, we will be creating a circle/ball/ellipse using xaml and will move it from one corner to another corner and will change the color and size of the ball during this animation. We will be using Blend to create Storyboard and will create Universal Windows using Blank template.</p>
<p>Here are the requirement for storyboard. Think of a ball moving from one end to another in Universal window app.</p>
<ol>
<li><span style="color: #0000ff;">Move a ball from the top&nbsp;left corner of the page to the&nbsp;bottom right&nbsp; corner.</span></li>
<li><span style="color: #0000ff;">Change the color of the ball from green to red in midway of&nbsp;animation and then back to green at the end.</span></li>
<li><span style="color: #0000ff;">Change the size of the ball in midway (While ball is at the center of the page) and revert back the size to normal at the end of the animation.</span></li>
<li><span style="color: #0000ff;">Ball movement should look natural, like in the real world objects do not start instantly and nor they move in constant speed. They have escalation in speed after starting and de-escalation in speed while stopping. It means ball speed changes during the movement instead of constant speed. After this effect, ball movement will look more natural.</span></li>
</ol>
<p>You can follow following steps to create storyboard in your local development environment or you can download the attached zip file which contain the solution, which was used to build this blog.</p>
<p>1) Launch a blend 2015 and click <strong>file-&gt;New-Project. </strong>Expend Visual c# tree and Select Universal. Under universal category select <strong>Blank App(Universal windows) </strong>and name it as Storyboard. Provide path to location field and click Ok.</p>
<p><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/metablogapi/2330.image_4F62BCBE.png" original-url="http://blogs.msdn.com/cfs-filesystemfile.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63-metablogapi/2330.image_5F00_4F62BCBE.png" alt="" width="732" height="505" /></p>
<p>2) This will create as blank app with empty grid in <strong>Mainpage.xaml</strong> page.</p>
<p><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/metablogapi/8715.image_23B48373.png" original-url="http://blogs.msdn.com/cfs-filesystemfile.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63-metablogapi/8715.image_5F00_23B48373.png" alt="" width="695" height="367" /></p>
<p>3) Next step is to create green circle at the top left corner. Drag and drop ellipse from the control window to the <strong>MainPage.xaml</strong> top left corner. You can follow red arrow shown in below&nbsp;screen&nbsp;to get ellipse from control section. Make sure after drag drop, you move it to top left corner of the page. You can change the size of the ellipse to look like a proper circle&nbsp; and change the Fill color to green from the property windows.&nbsp;</p>
<p><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/metablogapi/7065.image_6DD21F09.png" original-url="http://blogs.msdn.com/cfs-filesystemfile.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63-metablogapi/7065.image_5F00_6DD21F09.png" alt="" width="694" height="438" /></p>
<p><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/metablogapi/8625.image_6D687CC5.png" original-url="http://blogs.msdn.com/cfs-filesystemfile.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63-metablogapi/8625.image_5F00_6D687CC5.png" alt="" width="731" height="410" /></p>
<p>4) Go to Objects and TimeLine section and select Ellipse control and then press plus button as shown in below screen. You will get a popup with &ldquo;<strong>Storyboard1</strong>&rdquo; name. Keep it default and click <strong>ok</strong>.</p>
<p>&nbsp;</p>
<p><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/metablogapi/3175.image_37F24B51.png" original-url="http://blogs.msdn.com/cfs-filesystemfile.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63-metablogapi/3175.image_5F00_37F24B51.png" alt="" width="484" height="400" /></p>
<p><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/metablogapi/4807.image_710BB904.png" original-url="http://blogs.msdn.com/cfs-filesystemfile.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63-metablogapi/4807.image_5F00_710BB904.png" alt="" /></p>
<p>5) Now we are in storyboard editing mode.&nbsp; Everything we do, will get recorded in the storyboard. You are ready for your first animation. Move the yellow time pointer, as show in the following screen, to two second and then grab the green ball and drag it to bottom right corner. If you press the green play button, the animation can be viewed on the design surface.</p>
<p><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/metablogapi/2577.image_39C531C9.png" original-url="http://blogs.msdn.com/cfs-filesystemfile.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63-metablogapi/2577.image_5F00_39C531C9.png" alt="" width="668" height="399" /></p>
<p>Let&rsquo;s see what Blend has created for us. If you notice inside Objects and Timeline window there is a&nbsp;small red icon on ellipse which indicate that it has storyboard effects. Indeed rendertransform with X and Y Translate has been created if you expend Ellipse tree.</p>
<p><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/metablogapi/8132.image_6B53300F.png" original-url="http://blogs.msdn.com/cfs-filesystemfile.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63-metablogapi/8132.image_5F00_6B53300F.png" alt="" width="374" height="470" /></p>
<p>Now, if you click green run button in the Storyboard, you can see ball is moving from top left corner to bottom right corner.</p>
<p>So far so good, lets explore render animation.</p>
<p>There are 5 type of render animation, which can be applied to any element. To understand type of render animation, go to Transform section of property&nbsp;of ellipse.</p>
<p><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/metablogapi/6712.image_4825C55D.png" original-url="http://blogs.msdn.com/cfs-filesystemfile.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63-metablogapi/6712.image_5F00_4825C55D.png" alt="" width="347" height="288" /></p>
<p>1) <strong>Translate</strong>: Simply move every pixel of the object.</p>
<p>2) <strong>Rotation</strong>: Rotate the object in specified angle</p>
<p>3) <strong>Scale</strong>: Enlarge the object (This is what is being used when you hover your mouse over button)</p>
<p>4) <strong>Skew</strong>: Used to skew the object.</p>
<p>5) <strong>Center Point</strong>: Allow to change center point of the object.</p>
<p>6) <strong>Flip</strong> : As name suggest, it flip the object.</p>
<p>These are called render transformation because they take place only after the layout cycle has been completed. You can test these transformation by applying them while moving the object. For example move the time line to mid and flip the ellipse and then run the storyboard. You can see the effect since ball&nbsp;flips midway.</p>
<p>As per the initial requirement, we have completed first requirement by moving ball from one corner to another. Lets work on second requirement of changing the color of ball.</p>
<p>Move the yellow time pointer to midway (1 sec) and it will move the ball to center location. Go to the property of the ellipse and change the FILL color property to red as shown in below screen.</p>
<p><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/metablogapi/1185.image_61242653.png" original-url="http://blogs.msdn.com/cfs-filesystemfile.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63-metablogapi/1185.image_5F00_61242653.png" alt="" width="553" height="351" /></p>
<p>Now If you run the storyboard, you can see the ball color changes midway.</p>
<p><strong>Third requirement: </strong>Change the size of the ball in the midway (While ball is at the center of the page) and revert back the size to normal at the end of the animation.</p>
<p>Again, Move the yellow time pointer to midway (1 sec), it will move the ball to center location. Go to the <strong>transform section</strong> of ellipse property and set the value of <strong>scale property</strong> to <strong>1.4</strong> for <strong>both X and</strong> Y.</p>
<p><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/metablogapi/2821.image_4BC9019C.png" original-url="http://blogs.msdn.com/cfs-filesystemfile.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63-metablogapi/2821.image_5F00_4BC9019C.png" alt="" width="394" height="250" /></p>
<p>Now If you run the storyboard, you can see while moving ball change the FILL color to red in midway and gets enlarge.</p>
<p><strong>Last requirement:</strong> Ball movement should look natural, like in the real world object wouldn&rsquo;t start instantly and move in constant speed. They have escalation in speed after starting and de-escalation in speed while stopping.</p>
<p>This looks difficult but there is already a out of box feature available to achieve this <img class="wlEmoticon wlEmoticon-smile" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/metablogapi/2148.wlEmoticon-smile_48B6A3A7.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63-metablogapi/2148.wlEmoticon_2D00_smile_5F00_48B6A3A7.png" alt="Smile" /></p>
<p>Just go to Object and Timelines window and select both while RenderTransform object under ellipse including TranslateX and TranslateY and check &ldquo;<strong>easing</strong>&rdquo; section of property and select <strong>Cubic (InOut)</strong> function value under <strong>EasingFunction property.</strong></p>
<p><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/metablogapi/4111.image_722D7598.png" original-url="http://blogs.msdn.com/cfs-filesystemfile.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63-metablogapi/4111.image_5F00_722D7598.png" alt="" width="601" height="338" /></p>
<p>Now, If you run the storyboard using green button in the storyboard timeline section window, you can see the movement of ball follow cubic function, it means ball speed gradually increase and slow down before ending.&nbsp; This gives ball a natural look and feel move.</p>
<p>Similarly there are other easing function available, feel free to try out other ease function to achieve different kind of movement under out of box easing options. All these ease function can be a&nbsp;big part of your application personality.</p>
<p>So we are done with storyboard, lets run the solution by pressing F5.</p>
<p>Is it running? No it is not <img class="wlEmoticon wlEmoticon-smile" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/metablogapi/2148.wlEmoticon-smile_48B6A3A7.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63-metablogapi/2148.wlEmoticon_2D00_smile_5F00_48B6A3A7.png" alt="Smile" /> what went wrong. We have follow all the required step but it still not running&hellip;&hellip;.. nothing to worry, there is nothing wrong in the solution, if you have follow above steps correctly then we are very close to final run, but now it looks like we have to do little more work to enable storyboard. <img class="wlEmoticon wlEmoticon-sadsmile" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/metablogapi/7128.wlEmoticon-sadsmile_22E59EA6.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63-metablogapi/7128.wlEmoticon_2D00_sadsmile_5F00_22E59EA6.png" alt="Sad smile" />&nbsp; Basically we need to launch the Storyboard along with application launch.</p>
<p>Stop the application. There are multiple way to launch the storyboard and we will use behavior.</p>
<h4>Use of behavior to launch the storyboard</h4>
<p>Behaviors are basically small bit of reusable code that can enhance how control behaves. They are like code which designer can apply on a control to change its behavior with out the help of code behind.</p>
<p>Inside blend, go to Assets tab and click on Behaviors and if you see &ldquo;<strong>Install Behaviours&rsquo; NuGet Package</strong>&rdquo; hyperlink then click on it.</p>
<p><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/metablogapi/3323.image_5066BE69.png" original-url="http://blogs.msdn.com/cfs-filesystemfile.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63-metablogapi/3323.image_5F00_5066BE69.png" alt="" width="313" height="481" /></p>
<p>After Installing behaviors Nuget Package, you can see different built in behavior. One of the behavior which control story boards is &ldquo;<strong>ControlStoryboardAction</strong>&rdquo;. Drag and drop this action behavior on Grid control in the <strong>Objects and timeline window</strong>. This create two object under Grid. These are <strong>EventTriggerBehavior</strong> and <strong>ControlStoryboardAction. </strong>The first one is the trigger, it initiates the action that are associated with it, based on the specific key pressed. You can see full list of event by going to property of <strong>EventTriggerBehavior</strong> in EventName dropdown. By default it is set to <strong>PointerPressed</strong>, it means whenever you click mouse the trigger will initiate the action which in turn call the storyboard.</p>
<p>Go to the property of <strong>ControlStoryboardAction</strong> and their you can control the storyboard launch options, like Play, stop Pause etc.&nbsp; Most important point here it to set the value of<strong> Storyboard</strong> property to <strong>Storyboard1.</strong></p>
<p>Lets launch the application by pressing the F5 and now if we click on the app, it will trigger the action, which in turn start the storyboard. Wow <img class="wlEmoticon wlEmoticon-smile" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/metablogapi/2148.wlEmoticon-smile_48B6A3A7.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63-metablogapi/2148.wlEmoticon_2D00_smile_5F00_48B6A3A7.png" alt="Smile" />, it is working now. You can enable storyboard from code behind too but enabling through behavior is more clean and simple. isn't it?</p>
<p>I have also attached sample app which was used to build this blog and let me know If you need more help.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/66/92/67/Storyboard.zip" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-66-92-67/Storyboard.zip">Storyboard.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Retain Source Folder Permissions While Copying</title>
      <link>https://docs.microsoft.com/archive/blogs/avtarsohi/retain-source-folder-permissions-while-copying</link>
      <pubDate>Wed, 03 Feb 2016 01:49:00 GMT</pubDate>
      <dc:creator><![CDATA[Avtar Sohi]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/avtarsohi/2016/02/03/retain-source-folder-permissions-while-copying/</guid>
      <description><![CDATA[&nbsp;
My last week task was to copy shared folder content from one server to another server. This...]]></description>
      <content:encoded><![CDATA[<p>&nbsp;</p>
<p><span style="font-size: small;">My last week task was to copy shared folder content from one server to another server. This looks easy but it comes with following conditions:</span></p>
<ul>
<li><span style="font-size: small;">Copy content from Source to target folder( Ignore one folder (<span style="text-decoration: underline;">DfsPrivate</span>) while copying content from source to target server)</span></li>
<li><span style="font-size: small;">Copy source folder permission at all level while copying source to target folder and permission should not be restricted to source root folder. It means each source folder permission must match with target folder.</span></li>
<li><span style="font-size: small;">Generate a report to cross verify source and target permission for all folder in source and target.</span></li>
<li><span style="font-size: small;">Automate these step, so that it can be executed by end of every month (Should handle delta copy)</span></li>
</ul>
<p><span style="font-size: small;">I decided to use <strong>PowerShell</strong> to automate these activities with <strong>Robocopy</strong> command.</span></p>
<p><span style="font-size: small;">You can download the .ps1 file attached below to skip further reading, however, if you are interested in knowing .ps1 file and wanted to tweak it based on your requirement then you have to read full blog <img class="wlEmoticon wlEmoticon-smile" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/metablogapi/4370.wlEmoticon-smile_67B2699A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63-metablogapi/4370.wlEmoticon_2D00_smile_5F00_67B2699A.png" alt="Smile" /></span></p>
<p><span style="font-size: small;">Following are the methods in the .ps1 file corresponding to the activity mentioned above.</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/metablogapi/6675.Capture1_5E593517.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63-metablogapi/6675.Capture1_5F00_5E593517.jpg"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" title="Capture1" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/metablogapi/5483.Capture1_thumb_44878F99.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63-metablogapi/5483.Capture1_5F00_thumb_5F00_44878F99.jpg" alt="Capture1" width="671" height="288" border="0" /></a></p>
<p><span style="font-size: small;"><strong>CopyFTPFolder.ps1</strong> file accept three parameter 1) SourceFolderPath 2) TargetFolderPath and 3) Log folder path as shown in above screen.</span></p>
<p><span style="font-size: small;">You can download the .ps1 file and open it in inside <a href="https://technet.microsoft.com/en-us/library/dd315244.aspx">Powershell ISE editor.</a></span></p>
<h3><em><span style="background-color: #ffff00;">CopyContent</span></em> is the method which used robocopy to copy the content from source to target.</h3>
<div style="border: #000080 1px solid; color: #000; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 10pt;">
<div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px;">Code Snippet</div>
<div style="background: #f3f3f3; color: #000000; max-height: 300px; overflow: auto;"><ol style="background: #ffffff; margin: 0 0 0 3em; padding: 0;" start="7">
<li><span style="color: #00008b;">function</span> <span style="color: #8a2be2;">CopyContent</span>(<span style="color: #a9a9a9;">[</span><span style="color: #008080;">string</span><span style="color: #a9a9a9;">]</span> <span style="color: #ff4500;">$sourcePath</span><span style="color: #a9a9a9;">,</span> <span style="color: #a9a9a9;">[</span><span style="color: #008080;">string</span><span style="color: #a9a9a9;">]</span> <span style="color: #ff4500;">$targetPath</span><span style="color: #a9a9a9;">,[</span><span style="color: #008080;">string</span><span style="color: #a9a9a9;">]</span> <span style="color: #ff4500;">$logPath</span>)</li>
<li style="background: #f3f3f3;">{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff4500;">$excludeFolderPath</span> <span style="color: #a9a9a9;">=</span> <span style="color: #8b0000;">"</span><span style="color: #ff4500;">$sourcePath\</span><span style="color: #8b0000;">DfsPrivate"</span></li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">robocopy</span> <span style="color: #ff4500;">$sourcePath</span> <span style="color: #ff4500;">$targetPath</span> <span style="color: #8a2be2;">/mir</span> <span style="color: #8a2be2;">/sec</span> <span style="color: #8a2be2;">/MT[:32]</span> <span style="color: #8a2be2;">/XD</span> <span style="color: #ff4500;">$excludeFolderPath</span> <span style="color: #8a2be2;">/Copy:DAT</span> <span style="color: #8a2be2;">/DCOPY:T</span> <span style="color: #8a2be2;">/z</span> <span style="color: #8a2be2;">/np</span> <span style="color: #a9a9a9;">|</span> <span style="color: #0000ff;">tee</span> <span style="color: #ff4500;">$logPath</span></li>
<li>}</li>
</ol></div>
</div>
<p><span style="font-size: small;">Here are details of parameter passed to robocopy. You can modify them based on your requirement.</span></p>
<ol>
<li><span style="font-size: small;">&nbsp;<strong>/mir</strong> is used to copy all the content of source to target</span></li>
<li><span style="font-size: small;"><strong>/Sec /Copy:DAT /DCOPY:T</strong>&nbsp; is used to copy the security, parameter</span></li>
<li><span style="font-size: small;"><strong>/XD</strong> is used to exclude the copying of &ldquo;<strong>DfsPrivate</strong>&rdquo; folder.&nbsp;</span></li>
<li><span style="font-size: small;"><strong>/MT[:32]</strong> will allow powershell script to use 32 thread while performing copying. You can set this value based on your server configuration.</span></li>
<li><span style="font-size: small;">&nbsp;<strong>/Z</strong> will be used to perform delta copy.</span></li>
<li><span style="font-size: small;"><strong>/np | tee $logPath</strong> will be used to log Robocopy activity and also show them on screen, so that user is aware of each activity instead of opening log file.</span></li>
</ol>
<h3><em><span style="background-color: #ffff00;"><span style="text-decoration: underline;">CopyACL</span></span></em> function will copy the &ldquo;<strong>Access Control List</strong>&rdquo; of source folder to target folder.</h3>
<div style="border: #000080 1px solid; color: #000; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 10pt;">
<div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px;">Code Snippet</div>
<div style="background: #f3f3f3; color: #000000; max-height: 300px; overflow: auto;"><ol style="background: #ffffff; margin: 0 0 0 3em; padding: 0;" start="13">
<li><span style="color: #00008b;">function</span> <span style="color: #8a2be2;">CopyACL</span>(<span style="color: #ff4500;">$SourceFolderPath</span><span style="color: #a9a9a9;">,</span> <span style="color: #ff4500;">$TargetFolderPath</span>)</li>
<li style="background: #f3f3f3;">{</li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006400;">#COPY ACL</span></li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">Get-Acl</span> <span style="color: #ff4500;">$SourceFolderPath</span> <span style="color: #a9a9a9;">|</span> <span style="color: #0000ff;">Set-Acl</span> <span style="color: #ff4500;">$TargetFolderPath</span></li>
<li>}</li>
</ol></div>
</div>
<h3><span style="font-family: Segoe UI;"><em><span style="background-color: #ffff00;"><span style="text-decoration: underline;">ExportPermission</span> </span></em>function will iterate through each folder in given path and export ACL </span><span style="font-family: Segoe UI;">permission into csv file </span></h3>
<div style="border: #000080 1px solid; color: #000; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 10pt;">
<div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px;">Code Snippet</div>
<div style="background: #f3f3f3; color: #000000; max-height: 300px; overflow: auto;"><ol style="background: #ffffff; margin: 0 0 0 3em; padding: 0;" start="19">
<li><span style="color: #00008b;">function</span> <span style="color: #8a2be2;">ExportPermission</span>(<span style="color: #ff4500;">$folderPath</span><span style="color: #a9a9a9;">,</span> <span style="color: #ff4500;">$exportPath</span>)</li>
<li style="background: #f3f3f3;">{</li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff4500;">$allFolders</span> <span style="color: #a9a9a9;">=</span> <span style="color: #0000ff;">Get-ChildItem</span> <span style="color: #ff4500;">$folderPath</span> <span style="color: #000080;">-Recurse</span> <span style="color: #a9a9a9;">|</span> <span style="color: #0000ff;">?</span> {<span style="color: #ff4500;">$_</span><span style="color: #a9a9a9;">.</span>PSisContainer <span style="color: #a9a9a9;">-eq</span> <span style="color: #ff4500;">$true}</span></li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff4500;">$collection</span> <span style="color: #a9a9a9;">=</span> @()</li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00008b;">foreach</span> (<span style="color: #ff4500;">$folder</span> <span style="color: #00008b;">in</span> <span style="color: #ff4500;">$allFolders</span>)</li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;{</li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff4500;">$acl</span> <span style="color: #a9a9a9;">=</span> <span style="color: #0000ff;">Get-Acl</span> <span style="color: #ff4500;">$folder</span><span style="color: #a9a9a9;">.</span>FullName</li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00008b;">foreach</span> (<span style="color: #ff4500;">$entry</span> <span style="color: #00008b;">in</span> <span style="color: #ff4500;">$acl</span><span style="color: #a9a9a9;">.</span>Access)</li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff4500;">$object</span> <span style="color: #a9a9a9;">=</span> <span style="color: #0000ff;">New-Object</span> <span style="color: #8a2be2;">PSObject</span> <span style="color: #000080;">-Property</span> @{</li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SourcePath<span style="color: #a9a9a9;">=</span><span style="color: #ff4500;">$folder</span><span style="color: #a9a9a9;">.</span>FullName</li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SourceFileSystemRights<span style="color: #a9a9a9;">=</span><span style="color: #ff4500;">$entry</span><span style="color: #a9a9a9;">.</span>FileSystemRights</li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SourceAccessControlType<span style="color: #a9a9a9;">=</span><span style="color: #ff4500;">$entry</span><span style="color: #a9a9a9;">.</span>AccessControlType</li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SourceIdentityReference<span style="color: #a9a9a9;">=</span><span style="color: #ff4500;">$entry</span><span style="color: #a9a9a9;">.</span>IdentityReference</li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SourceIsInherited<span style="color: #a9a9a9;">=</span><span style="color: #ff4500;">$entry</span><span style="color: #a9a9a9;">.</span>IsInherited</li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SourceInheritanceFlags<span style="color: #a9a9a9;">=</span><span style="color: #ff4500;">$entry</span><span style="color: #a9a9a9;">.</span>InheritanceFlags</li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SourcePropagationFlags<span style="color: #a9a9a9;">=</span><span style="color: #ff4500;">$entry</span><span style="color: #a9a9a9;">.</span>Propagationflags}</li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff4500;">$collection</span> <span style="color: #a9a9a9;">+=</span> <span style="color: #ff4500;">$object</span></li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;}</li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff4500;">$collection</span> <span style="color: #a9a9a9;">|</span> <span style="color: #0000ff;">Export-Csv</span> <span style="color: #ff4500;">$exportPath</span></li>
<li>}</li>
</ol></div>
</div>
<p>&nbsp;</p>
<h3>Finally the<span style="background-color: #ffff00;"><em><span style="text-decoration: underline;"> Main</span></em> </span>method which control the execution of this powershell script and calls above mentioned methods in a sequential order.</h3>
<div style="border: #000080 1px solid; color: #000; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 10pt;">
<div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px;">Code Snippet</div>
<div style="background: #f3f3f3; color: #000000; max-height: 300px; overflow: auto;"><ol style="background: #ffffff; margin: 0 0 0 4em; padding: 0;" start="43">
<li><span style="color: #00008b;">function</span> <span style="color: #8a2be2;">Main</span>(<span style="color: #ff4500;">$SourceFolderPath</span><span style="color: #a9a9a9;">,</span> <span style="color: #ff4500;">$TargetFolderPath</span><span style="color: #a9a9a9;">,</span> <span style="color: #ff4500;">$LogPath</span>)</li>
<li style="background: #f3f3f3;">{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff4500;">$timeStamp</span><span style="color: #a9a9a9;">=</span>(<span style="color: #0000ff;">Get-Date</span>)<span style="color: #a9a9a9;">.</span>ToString()</li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff4500;">$timeStamp</span><span style="color: #a9a9a9;">=</span> <span style="color: #ff4500;">$timeStamp</span><span style="color: #a9a9a9;">.</span>Replace(<span style="color: #8b0000;">"/"</span><span style="color: #a9a9a9;">,</span><span style="color: #8b0000;">""</span>)<span style="color: #a9a9a9;">.</span>Replace(<span style="color: #8b0000;">":"</span><span style="color: #a9a9a9;">,</span><span style="color: #8b0000;">""</span>)<span style="color: #a9a9a9;">.</span>Replace(<span style="color: #8b0000;">" "</span><span style="color: #a9a9a9;">,</span><span style="color: #8b0000;">""</span>)</li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff4500;">$timeLogPath</span> <span style="color: #a9a9a9;">=</span> <span style="color: #8b0000;">"</span><span style="color: #ff4500;">$LogPath\</span><span style="color: #8b0000;">scriptLog_</span><span style="color: #ff4500;">$timeStamp</span><span style="color: #8b0000;">.txt"</span></li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff4500;">$CopyAclLogPath</span> <span style="color: #a9a9a9;">=</span> <span style="color: #8b0000;">"</span><span style="color: #ff4500;">$LogPath\</span><span style="color: #8b0000;">CopyACLLog_</span><span style="color: #ff4500;">$timeStamp</span><span style="color: #8b0000;">.txt"</span></li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff4500;">$exportSourcePermissionPath</span> <span style="color: #a9a9a9;">=</span> <span style="color: #8b0000;">"</span><span style="color: #ff4500;">$LogPath\</span><span style="color: #8b0000;">SourcePermission_</span><span style="color: #ff4500;">$timeStamp</span><span style="color: #8b0000;">.csv"</span></li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff4500;">$exportTargetPermissionPath</span> <span style="color: #a9a9a9;">=</span> <span style="color: #8b0000;">"</span><span style="color: #ff4500;">$LogPath\</span><span style="color: #8b0000;">TargetPermission_</span><span style="color: #ff4500;">$timeStamp</span><span style="color: #8b0000;">.csv"</span></li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;</li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff4500;">$robocopyLogPath</span><span style="color: #a9a9a9;">=</span><span style="color: #8b0000;">"</span><span style="color: #ff4500;">$LogPath\</span><span style="color: #8b0000;">RobocopyLog_</span><span style="color: #ff4500;">$timeStamp</span><span style="color: #8b0000;">.txt"</span></li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;</li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006400;">#Perform Get Set ACL At Root level</span></li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">CopyACL</span> <span style="color: #ff4500;">$SourceFolderPath</span> <span style="color: #ff4500;">$TargetFolderPath</span></li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">Write-Host</span> <span style="color: #8b0000;">"Copying ACL permission from source to target (Only for root folder)...."</span></li>
<li>&nbsp;</li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006400;">#Robocopy Operation started</span></li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff4500;">$startTime</span> <span style="color: #a9a9a9;">=</span> <span style="color: #0000ff;">Get-Date</span></li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">CopyContent</span> <span style="color: #ff4500;">$SourceFolderPath</span> <span style="color: #ff4500;">$TargetFolderPath</span> <span style="color: #ff4500;">$robocopyLogPath</span></li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff4500;">$endTime</span> <span style="color: #a9a9a9;">=</span> <span style="color: #0000ff;">Get-Date</span></li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff4500;">$totalTimeTaken</span> <span style="color: #a9a9a9;">=</span> <span style="color: #0000ff;">NEW-TIMESPAN</span>&nbsp;&nbsp;<span style="color: #ff4500;">$startTime</span> <span style="color: #ff4500;">$endTime</span></li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff4500;">$str</span> <span style="color: #a9a9a9;">=</span> <span style="color: #8b0000;">"Total time taken from </span><span style="color: #ff4500;">$source</span><span style="color: #8b0000;"> to </span><span style="color: #ff4500;">$target</span><span style="color: #8b0000;"> is </span><span style="color: #ff4500;">$totalTimeTaken</span><span style="color: #8b0000;">"</span></li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">Add-Content</span> <span style="color: #000080;">-Path</span> <span style="color: #ff4500;">$timeLogPath</span> <span style="color: #ff4500;">$str</span></li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006400;">#Completed</span></li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;</li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006400;">#Perform Get Set for each folder level</span></li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff4500;">$sourceRootDrive</span> <span style="color: #a9a9a9;">=</span> (<span style="color: #a9a9a9;">[</span><span style="color: #008080;">regex</span><span style="color: #a9a9a9;">]::</span>matches(<span style="color: #ff4500;">$SourceFolderPath</span><span style="color: #a9a9a9;">,</span><span style="color: #8b0000;">"[a-zA-Z0-9]:"</span><span style="color: #a9a9a9;">,</span><span style="color: #8b0000;">"IgnoreCase"</span>)<span style="color: #a9a9a9;">|</span> <span style="color: #0000ff;">%{</span><span style="color: #ff4500;">$_</span><span style="color: #a9a9a9;">.</span>value})</li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff4500;">$targetRootDrive</span> <span style="color: #a9a9a9;">=</span> (<span style="color: #a9a9a9;">[</span><span style="color: #008080;">regex</span><span style="color: #a9a9a9;">]::</span>matches(<span style="color: #ff4500;">$TargetFolderPath</span><span style="color: #a9a9a9;">,</span><span style="color: #8b0000;">"[a-zA-Z0-9]+"</span><span style="color: #a9a9a9;">,</span><span style="color: #8b0000;">"IgnoreCase"</span>)<span style="color: #a9a9a9;">|</span> <span style="color: #0000ff;">%{</span><span style="color: #ff4500;">$_</span><span style="color: #a9a9a9;">.</span>value})<span style="color: #a9a9a9;">[</span><span style="color: #800080;">0</span><span style="color: #a9a9a9;">]</span></li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff4500;">$targetRootDrive</span> <span style="color: #a9a9a9;">=</span> <span style="color: #8b0000;">"\\\cf5 $targetRootDrive"</span></li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;</li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">Write-Host</span> <span style="color: #8b0000;">"sourceRootDrive = </span><span style="color: #ff4500;">$sourceRootDrive</span><span style="color: #8b0000;">"</span></li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">Write-Host</span> <span style="color: #8b0000;">"targetRootDrive = </span><span style="color: #ff4500;">$targetRootDrive</span><span style="color: #8b0000;">"</span></li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff4500;">$allFolders</span> <span style="color: #a9a9a9;">=</span> <span style="color: #0000ff;">Get-ChildItem</span> <span style="color: #ff4500;">$SourceFolderPath</span> <span style="color: #000080;">-Recurse</span> <span style="color: #a9a9a9;">|</span> <span style="color: #0000ff;">?</span> {<span style="color: #ff4500;">$_</span><span style="color: #a9a9a9;">.</span>PSisContainer <span style="color: #a9a9a9;">-eq</span> <span style="color: #ff4500;">$true}</span></li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff4500;">$collection</span> <span style="color: #a9a9a9;">=</span> @()</li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">Write-Host</span> <span style="color: #8b0000;">"Copy ACL for each folder..."</span></li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00008b;">foreach</span> (<span style="color: #ff4500;">$folder</span> <span style="color: #00008b;">in</span> <span style="color: #ff4500;">$allFolders</span>)</li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;{</li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff4500;">$sourcePath</span> <span style="color: #a9a9a9;">=</span> <span style="color: #ff4500;">$folder</span><span style="color: #a9a9a9;">.</span>FullName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff4500;">$targetPath</span> <span style="color: #a9a9a9;">=</span> <span style="color: #ff4500;">$sourcePath</span><span style="color: #a9a9a9;">.</span>Replace(<span style="color: #8b0000;">"</span><span style="color: #ff4500;">$sourceRootDrive</span><span style="color: #8b0000;">"</span><span style="color: #a9a9a9;">,</span><span style="color: #8b0000;">"</span><span style="color: #ff4500;">$targetRootDrive</span><span style="color: #8b0000;">"</span>)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">CopyACL</span> <span style="color: #ff4500;">$sourcePath</span> <span style="color: #ff4500;">$targetPath</span></li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">Add-Content</span> <span style="color: #000080;">-path</span> <span style="color: #ff4500;">$CopyAclLogPath</span> <span style="color: #8b0000;">"'</span><span style="color: #ff4500;">$sourcePath</span><span style="color: #8b0000;">' ------'</span><span style="color: #ff4500;">$targetPath</span><span style="color: #8b0000;">'"</span></li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">Write-Output</span> <span style="color: #8b0000;">"'</span><span style="color: #ff4500;">$sourcePath</span><span style="color: #8b0000;">' ------'</span><span style="color: #ff4500;">$targetPath</span><span style="color: #8b0000;">'"</span></li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">Write-Progress</span> <span style="color: #000080;">-Activity</span> <span style="color: #8b0000;">"sourceRootDrive$ to </span><span style="color: #ff4500;">$targetRootDrive</span><span style="color: #8b0000;">"</span></li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;}</li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006400;">#Completed</span></li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;</li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006400;">#Export Permission For Source Folder</span></li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">Write-Host</span> <span style="color: #8b0000;">"Exporting Permission For Source Folder </span><span style="color: #ff4500;">$SourceFolderPath</span><span style="color: #8b0000;">"</span></li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">ExportPermission</span> <span style="color: #ff4500;">$SourceFolderPath</span> <span style="color: #ff4500;">$exportSourcePermissionPath</span></li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006400;">#Completed</span></li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;</li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006400;">#Export Permission For Target Folder</span></li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">Write-Host</span> <span style="color: #8b0000;">"Exporting Permission For Target Folder </span><span style="color: #ff4500;">$TargetFolderPath</span><span style="color: #8b0000;">"</span></li>
<li style="background: #f3f3f3;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">ExportPermission</span> <span style="color: #ff4500;">$TargetFolderPath</span> <span style="color: #ff4500;">$exportTargetPermissionPath</span></li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006400;">#Completed</span></li>
<li style="background: #f3f3f3;">}</li>
</ol></div>
</div>
<h3>&nbsp;</h3>
<h3>&nbsp;Please fee free to comment and provide your value suggestion.</h3>
<h3><em><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Note: This script must be executed from Source server only since regex used in Main method expect Drive path<span style="background-color: #ffff00;"> (<span style="text-decoration: underline;">G:\SomeFolderName</span></span>) for source folder and network path (<span style="text-decoration: underline; background-color: #ffff00;">\\SomeServerName\SomeFolderName</span>) for target path.</span></em></h3>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/66/79/41/CopyFTPFolder.ps1" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-66-79-41/CopyFTPFolder.ps1">CopyFTPFolder.ps1</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Use of Deferred Loading in XAML</title>
      <link>https://docs.microsoft.com/archive/blogs/avtarsohi/use-of-deferred-loading-in-xaml</link>
      <pubDate>Mon, 14 Sep 2015 01:20:00 GMT</pubDate>
      <dc:creator><![CDATA[Avtar Sohi]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/avtarsohi/2015/09/14/use-of-deferred-loading-in-xaml/</guid>
      <description><![CDATA[// 
&nbsp;
Objective of this blog is to demystify the deferred loading...]]></description>
      <content:encoded><![CDATA[<script type="text/javascript" src="http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js"></script>
<script type="text/javascript" src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js"></script>
<script type="text/javascript" src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js"></script>
<script type="text/javascript" src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js"></script>
<script type="text/javascript" src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js"></script>
<script type="text/javascript" src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js"></script>
<script type="text/javascript" src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js"></script>
<script type="text/javascript" src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js"></script>
<script type="text/javascript" src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushRuby.js"></script>
<script type="text/javascript" src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js"></script>
<script type="text/javascript" src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js"></script>
<script type="text/javascript" src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js"></script>
<script type="text/javascript" src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js"></script>
<script type="text/javascript" language="javascript">// <![CDATA[
 
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.config.clipboardSwf = 'http://alexgorbatchev.com/pub/sh/current/scripts/clipboard.swf';
SyntaxHighlighter.all();
// ]]]]><![CDATA[></script>
<p>&nbsp;</p>
<p>Objective of this blog is to demystify the deferred loading concept in XAML.</p>
<p>In order to understand this topic, reader must have basic understanding of XAML and C#.</p>
<h5>What is deferred loading?</h5>
<p><a href="https://msdn.microsoft.com/en-us/library/system.windows.markup.xamldeferloadattribute%28v=vs.110%29.aspx%5C">It is a process to reduce the number of XAML elements at startup. So you can deferred the loading of XAML elements which are not required at startup of your app or page load.</a></p>
<h5>Why do we need this?</h5>
<ul>
<li>To improve XAML Performance</li>
<li>To improve user experience.</li>
<li>To optimize initial loading.</li>
</ul>
<h5>Where do we need this?</h5>
<p>Suppose you have a page which contains 50 controls however the end user only uses 10 control initially, so what is the point of loading rest of 40 control initially and delaying initial loading of your app. The point here is that you load the control when you need it and deferred loading is the technique to do this.</p>
<p>At this time you might be thinking, why not simplify the XAML at first place. I would say, that is easy to say but difficult to maintain in a moderate or complex project. XAML complexity grow along with functionality of the application.</p>
<p>Some of you might be thinking of injecting an elements into the visual tree at run time and improve the performance. I would say it is possible but the code you wrote is difficult to maintain, violate separation of concern principle as your code behind include UI element and you lose a lot of the declarative capability of XAML.</p>
<p>In deferred loading, you keep unwanted control out until their realize (required). Basically you are marking a part of your UI tree with a container or a series of elements that don&rsquo;t show up until their realized (required). Realized is a manual or sometime an automatic process but basically it is not at the starting. In summary the UI element get realized when you need them, but not before.</p>
<p>Note: There is a cost involved in deferred loading also that is while marking a visual tree with placeholder instead of actual control. A very small lightweight placeholder is used instead of loading expensive big control. Also events are hooked up after realized and binding is completed after realized (Including x:Bind). In nut shell you get benefit if you use it correctly.</p>
<p>Following are the way to realize an element:</p>
<ul>
<li>FindName()</li>
<li>EnsureElementRealized()</li>
<li>GetTemplatedChild() (for ControlTemplate)</li>
<li>Storyboard &amp; VisualStates (because of FindName)</li>
</ul>
<p>Enough theory ! Let&rsquo;s use this concept in visual studio.</p>
<p>In order to demonstrate this concept, I have created a class &ldquo;MyGrid&rdquo; which is derived from Grid class.</p>
<p>Situation: There are five instance of &ldquo;MyGrid&rdquo; class and User only uses first Grid and rest 4 Grid required latter. So objective is to load only first grid at the starting.</p>
<p>Here is the class definition of &ldquo;MyGrid&rdquo;:</p>
<pre class="brush: csharp; gutter: false; toolbar: false; auto-links: false;">class MyGrid : Grid
{
    private static int count = 0;
    public MyGrid()
    {
        this.Height = this.Width = 100;
        this.Margin = new Windows.UI.Xaml.Thickness(10);
        this.Background = new SolidColorBrush(Colors.SteelBlue);
        Debug.WriteLine("Created " + count++);
    }
}
</pre>
<p>&nbsp;</p>
<p>In this class we have created a static counter which gets increment on each instance of a class and Debug.WriteLine() is used to print the value of this counter. Note: You can see the outcome of Debug.WriteLine in output windows after running the solution.</p>
<p>Now lets go to xaml page (in my case it is MainPage.xaml) and add refere &ldquo;MyGrid&rdquo; control which was create at first place. First ad the namespace of MyGrid class. In my sample solution it is:</p>
<pre class="brush: xml; gutter: false; toolbar: false; auto-links: false;">xmlns:Common="using:App1.Common"
</pre>
<p>Here is the XAML code where &ldquo;MyGrid&rdquo; class is referred.</p>
<pre class="brush: xml; gutter: false; toolbar: false; auto-links: false;">&lt;Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"&gt; 
    &lt;StackPanel&gt; 
        &lt;Common:MyGrid /&gt; 
        &lt;Common:MyGrid Visibility="Collapsed"/&gt; 
        &lt;Common:MyGrid Visibility="Collapsed"/&gt; 
        &lt;Common:MyGrid Visibility="Collapsed" /&gt; 
        &lt;Common:MyGrid Visibility="Collapsed"/&gt; 
    &lt;/StackPanel&gt; 
&lt;/Grid&gt;
</pre>
<p>Press F5 and you will get below screen.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/metablogapi/3252.1_3071F554.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63-metablogapi/3252.1_5F00_3071F554.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="1" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/metablogapi/2555.1_thumb_216037DC.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63-metablogapi/2555.1_5F00_thumb_5F00_216037DC.png" alt="1" width="644" height="329" border="0" /></a></p>
<p>You can see in the output window that all 5 grid gets created at run time, although user only required first grid. Here comes the requirement of x:DeferLoadStrategy=&rdquo;Lazy&rdquo; attribute</p>
<p>Here is the modified xaml.</p>
<pre class="brush: xml; gutter: false; toolbar: false; auto-links: false;">&lt;Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"&gt;
        &lt;StackPanel&gt;
            &lt;Common:MyGrid x:Name="grid1" DoubleTapped="grid1_DoubleTapped"  /&gt;
            &lt;Common:MyGrid x:Name="grid2" x:DeferLoadStrategy="Lazy"/&gt;
            &lt;Common:MyGrid x:Name="grid3" x:DeferLoadStrategy="Lazy"/&gt;
            &lt;Common:MyGrid x:Name="grid4" x:DeferLoadStrategy="Lazy" /&gt;
            &lt;Common:MyGrid x:Name="grid5" x:DeferLoadStrategy="Lazy"/&gt;
        &lt;/StackPanel&gt;      
    &lt;/Grid&gt;
</pre>
<p>Press F5 and you will see only one instance of MyGrid class gets created.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/metablogapi/5165.2_7C650813.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63-metablogapi/5165.2_5F00_7C650813.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="2" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/metablogapi/5224.2_thumb_6FF9759B.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63-metablogapi/5224.2_5F00_thumb_5F00_6FF9759B.png" alt="2" width="644" height="334" border="0" /></a></p>
<p>Note: In order to use DeferLoadStrategy attribute, you must define the name of the control, otherwise compiler will throw error. As you know the name will be used to realize the UI Element (Control).</p>
<p>So far we have understood that how to use DeferLoadStrategy attibute.</p>
<p>Now suppose you want to load second Grid on some event. Lets take grid1 doubleTapped event. So as soon as user double click on gird1 then load grid2.</p>
<p>To complete this requirement we will be using &ldquo;FindName&rdquo; method to load second grid instance at run time.</p>
<p>Here are the modification in xaml file.</p>
<pre class="brush: xml; gutter: false; toolbar: false; auto-links: false;">&lt;Common:MyGrid x:Name="grid1" DoubleTapped="grid1_DoubleTapped" /&gt;
</pre>
<p>Here are the modification in .cs file.</p>
<pre class="brush: csharp; gutter: false; toolbar: false; auto-links: false;">  private void grid1_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
        {
            FindName("grid2");
        }
</pre>
<pre class="brush: csharp; gutter: false; toolbar: false; auto-links: false;">&nbsp;</pre>
<p>Press F5 and then double click on grid1 control, you will see grid2 realized using &ldquo;FindName&rdquo; method. The results of output window are justfying that only two grid has been realized so far.</p>
<p>By now you have understood what is deferloading, where to use, how to use and how to realize deferloading control.</p>
<p>Note: Visibility and Opacity can not be used in place of deferloading as both of them create instance of the UI element in the background and you will not get true benefit of optimum loading which deferloading provide.</p>
<p>If you have any question or suggestion, please provide a comment. I am looking forward for your feedback.</p>]]></content:encoded>
    </item>
    <item>
      <title>Get computer hardware information using C#</title>
      <link>https://docs.microsoft.com/archive/blogs/avtarsohi/get-computer-hardware-information-using-c</link>
      <pubDate>Sat, 09 May 2015 23:12:00 GMT</pubDate>
      <dc:creator><![CDATA[Avtar Sohi]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/avtarsohi/2015/05/09/get-computer-hardware-information-using-c/</guid>
      <description><![CDATA[Here I will be explaining how to&nbsp;get computer hardware information using WMI (Windows...]]></description>
      <content:encoded><![CDATA[<p>Here I will be explaining how to&nbsp;get computer hardware information using WMI (Windows Management Instrumentation) in C#.</p>
<p>Our objective is to get following information of&nbsp;a computer&nbsp;using WMI api in c#.</p>
<ul>
<li>Number Of Physical Processors</li>
<li>Number Of Logical Processors</li>
<li>Bitness</li>
<li>Architecture</li>
<li>Number Of Cores</li>
</ul>
<p>Lets start !!</p>
<p>Create a console application project in Visual studio and right-click <strong>References</strong> on the right and select &ldquo;<strong>Add Reference</strong>&rdquo; and then select <strong>System.Management</strong> as shown in below screen.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/metablogapi/8371.image_6603B285.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63-metablogapi/8371.image_5F00_6603B285.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/metablogapi/3343.image_thumb_25D029BC.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63-metablogapi/3343.image_5F00_thumb_5F00_25D029BC.png" alt="image" width="356" height="291" border="0" /></a><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/metablogapi/5875.image_74D0790E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63-metablogapi/5875.image_5F00_74D0790E.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/metablogapi/3771.image_thumb_071BD082.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63-metablogapi/3771.image_5F00_thumb_5F00_071BD082.png" alt="image" width="390" height="207" border="0" /></a></p>
<p>Now include System.Management through &ldquo;using&rdquo; statement. Now you can use WMI classes reference in your code.</p>
<p>Here is the complete code to generate hardware information.</p>
<pre class="scroll"><code class="csharp"><span style="color: #008800; font-weight: bold;">using</span> <span style="color: #0e84b5; font-weight: bold;">System</span>;<br /><span style="color: #008800; font-weight: bold;">using</span> <span style="color: #0e84b5; font-weight: bold;">System.Collections.Generic</span>;<br /><span style="color: #008800; font-weight: bold;">using</span> <span style="color: #0e84b5; font-weight: bold;">System.Linq</span>;<br /><span style="color: #008800; font-weight: bold;">using</span> <span style="color: #0e84b5; font-weight: bold;">System.Text</span>;<br /><span style="color: #008800; font-weight: bold;">using</span> <span style="color: #0e84b5; font-weight: bold;">System.Threading.Tasks</span>;<br /><span style="color: #008800; font-weight: bold;">using</span> <span style="color: #0e84b5; font-weight: bold;">System.Management</span>;<br /><br /><span style="color: #008800; font-weight: bold;">namespace</span> <span style="color: #0e84b5; font-weight: bold;">ConsoleApplication1</span><br />{<br />&nbsp;&nbsp;&nbsp; <span style="color: #008800; font-weight: bold;">class</span> <span style="color: #bb0066; font-weight: bold;">Program</span><br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #008800; font-weight: bold;">static</span> <span style="color: #008800; font-weight: bold;">void</span> <span style="color: #0066bb; font-weight: bold;">Main</span>(<span style="color: #333399; font-weight: bold;">string</span>[] args)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GetCpuDetails();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #008800; font-weight: bold;">private</span> <span style="color: #008800; font-weight: bold;">static</span> <span style="color: #008800; font-weight: bold;">void</span> <span style="color: #0066bb; font-weight: bold;">GetCpuDetails</span>()<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #008800; font-weight: bold;">foreach</span> (<span style="color: #333399; font-weight: bold;">var</span> item <span style="color: #008800; font-weight: bold;">in</span> <span style="color: #008800; font-weight: bold;">new</span> System.Management.ManagementObjectSearcher(<span style="background-color: #fff0f0;">"Select * from Win32_ComputerSystem"</span>).Get())<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Console.WriteLine(<span style="background-color: #fff0f0;">"Number Of Physical Processors: {0} "</span>, item[<span style="background-color: #fff0f0;">"NumberOfProcessors"</span>]);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Console.WriteLine(<span style="background-color: #fff0f0;">"Number Of Logical Processors: {0} "</span>, item[<span style="background-color: #fff0f0;">"NumberOfLogicalProcessors"</span>]);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #333399; font-weight: bold;">var</span> numberOfCores = <span style="color: #6600ee; font-weight: bold;">0</span>;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #008800; font-weight: bold;">foreach</span> (<span style="color: #333399; font-weight: bold;">var</span> item <span style="color: #008800; font-weight: bold;">in</span> <span style="color: #008800; font-weight: bold;">new</span> System.Management.ManagementObjectSearcher(<span style="background-color: #fff0f0;">"Select * from Win32_Processor"</span>).Get())<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; numberOfCores += <span style="color: #333399; font-weight: bold;">int</span>.Parse(item[<span style="background-color: #fff0f0;">"NumberOfCores"</span>].ToString());<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Console.WriteLine(<span style="background-color: #fff0f0;">"Bitness: {0}"</span>, item[<span style="background-color: #fff0f0;">"AddressWidth"</span>]);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Console.WriteLine(<span style="background-color: #fff0f0;">"Architecture: {0}"</span>, GetArchitectureDetail(<span style="color: #333399; font-weight: bold;">int</span>.Parse(item[<span style="background-color: #fff0f0;">"Architecture"</span>].ToString())));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Console.WriteLine(<span style="background-color: #fff0f0;">"Number Of Cores: {0}"</span>, numberOfCores);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp; <br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #008800; font-weight: bold;">private</span> <span style="color: #008800; font-weight: bold;">static</span> <span style="color: #333399; font-weight: bold;">string</span> <span style="color: #0066bb; font-weight: bold;">GetArchitectureDetail</span>(<span style="color: #333399; font-weight: bold;">int</span> architectureNumber)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #008800; font-weight: bold;">switch</span> (architectureNumber)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #008800; font-weight: bold;">case</span> <span style="color: #6600ee; font-weight: bold;">0</span>: <span style="color: #008800; font-weight: bold;">return</span> <span style="background-color: #fff0f0;">"x86"</span>;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #008800; font-weight: bold;">case</span> <span style="color: #6600ee; font-weight: bold;">1</span>: <span style="color: #008800; font-weight: bold;">return</span> <span style="background-color: #fff0f0;">"MIPS"</span>;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #008800; font-weight: bold;">case</span> <span style="color: #6600ee; font-weight: bold;">2</span>: <span style="color: #008800; font-weight: bold;">return</span> <span style="background-color: #fff0f0;">"Alpha"</span>;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #008800; font-weight: bold;">case</span> <span style="color: #6600ee; font-weight: bold;">3</span>: <span style="color: #008800; font-weight: bold;">return</span> <span style="background-color: #fff0f0;">"PowerPC"</span>;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #008800; font-weight: bold;">case</span> <span style="color: #6600ee; font-weight: bold;">6</span>: <span style="color: #008800; font-weight: bold;">return</span> <span style="background-color: #fff0f0;">"Itanium-based systems"</span>;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #008800; font-weight: bold;">case</span> <span style="color: #6600ee; font-weight: bold;">9</span>: <span style="color: #008800; font-weight: bold;">return</span> <span style="background-color: #fff0f0;">"x64"</span>;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #008800; font-weight: bold;">default</span>:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #008800; font-weight: bold;">return</span> <span style="background-color: #fff0f0;">"Unkown"</span>;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; }<br />}</code></pre>
<p>&nbsp;</p>
<p>Here is the output of above program.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/metablogapi/1134.image_24247F4A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63-metablogapi/1134.image_5F00_24247F4A.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/metablogapi/6864.image_thumb_5F0BB213.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63-metablogapi/6864.image_5F00_thumb_5F00_5F0BB213.png" alt="image" width="765" height="159" border="0" /></a></p>
<p>You can explore <a href="http://msdn.microsoft.com/en-us/library/aa394373(v=vs.85).aspx">Win32_Processor</a> WMI class as well as the <a href="http://msdn.microsoft.com/en-us/library/aa394102(v=vs.85).aspx">Win32_ComputerSystem</a> to get more details.</p>
<p>Hope this helps,</p>
<p>Avtar</p>]]></content:encoded>
    </item>
    <item>
      <title>xaml syntax coloring is not working after installing visual studio 2012</title>
      <link>https://docs.microsoft.com/archive/blogs/avtarsohi/xaml-syntax-coloring-is-not-working-after-installing-visual-studio-2012</link>
      <pubDate>Tue, 16 Oct 2012 12:18:00 GMT</pubDate>
      <dc:creator><![CDATA[Avtar Sohi]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/avtarsohi/2012/10/16/xaml-syntax-coloring-is-not-working-after-installing-visual-studio-2012/</guid>
      <description><![CDATA[I am facing this issue after installing VS 2012. By some reason XAML editor in VS2012 doesn't show...]]></description>
      <content:encoded><![CDATA[<p><span style="color: black; font-family: 'Arial','sans-serif'; font-size: 9pt;">I am facing this issue after installing VS 2012. By some reason XAML editor in VS2012 doesn't show any syntax highlighting. It is just showing black text and even comments are not coming in green.</span></p>
<p><span style="color: black; font-family: 'Arial','sans-serif'; font-size: 9pt;">Its very difficult to understand xaml without syntax highlighting. If you are also facing this issue then below command might help you to fix this issue.</span></p>
<p><span style="color: black; font-family: 'Arial','sans-serif'; font-size: 9pt;">go to run -&gt; type -&gt; </span><code><strong><span style="color: black; font-size: 10pt;">devenv /resetuserdata</span></strong></code></p>
<p><span style="color: black; font-family: 'Arial','sans-serif'; font-size: 9pt;">then press enter.</span></p>
<p><span style="color: black; font-family: 'Arial','sans-serif'; font-size: 9pt;">It will fix the XAML highlighting issue.</span></p>]]></content:encoded>
    </item>
    <item>
      <title>Part 1: How to create window 8 app using "Grid App (XAML)" template from scratch.</title>
      <link>https://docs.microsoft.com/archive/blogs/avtarsohi/part-1-how-to-create-window-8-app-using-grid-app-xaml-template-from-scratch</link>
      <pubDate>Sun, 23 Sep 2012 13:09:00 GMT</pubDate>
      <dc:creator><![CDATA[Avtar Sohi]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/avtarsohi/2012/09/23/part-1-how-to-create-window-8-app-using-grid-app-xaml-template-from-scratch/</guid>
      <description><![CDATA[In this tutorial, you will&nbsp;learn the detail of &ldquo;Grid App (XAML)&rdquo; template and...]]></description>
      <content:encoded><![CDATA[<p style="padding-left: 30px;">In this tutorial, you will&nbsp;learn the detail of &ldquo;Grid App (XAML)&rdquo; template and understanding of this template will help you to create your window 8 app.</p>
<p><span style="color: #ff6600; font-size: medium;">Before you start&hellip;</span></p>
<ul>
<li>You need Windows&nbsp;8 or 8.1 OS</li>
<li>Microsoft Visual Studio Express&nbsp;2012 for Windows&nbsp;8. To download them, see <a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh974577.aspx">Get the tools</a>.</li>
<li>You also need a developer license. For instructions, see <a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh974578.aspx">Get a developer license</a>.</li>
</ul>
<p><span style="color: #ff6600; font-size: medium;">Abstract&hellip;</span></p>
<p>Here we will create a simple window 8 style app using C# and XAML and then we will investigate the XAML and code that Visual Studio 2012 generates when you create the solution. We will run the app and see that it uses sample data and its binding. On a high level, you will get a better understanding how the navigation within the app works and how binding is done. A deep understanding of this template will help you to design your application in a better manner plus you can decide whether this template is applicable to your window 8 app or not.</p>
<p><span style="color: #ff6600; font-size: medium;">Let&rsquo;s start&hellip;</span></p>
<ul>
<li>Launch Visual Studio 2012 by typing &ldquo;Vis&rdquo; and selecting visual studio.</li>
</ul>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/5008.1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/5008.1.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/5008.1.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/5008.1.png" alt="" border="0" /></a></p>
<ul>
<li>It will launch visual studio 2012.</li>
</ul>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/4111.2.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/4111.2.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/4111.2.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/4111.2.png" alt="" border="0" /></a></p>
<ul>
<li>Click File - &gt; New - &gt; Project</li>
</ul>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/8726.3.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/8726.3.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/8726.3.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/8726.3.png" alt="" border="0" /></a></p>
<ul>
<li>You should see the New Project dialog. Select <strong>Templates </strong>- &gt; <strong>Visual C#</strong> and then select the <strong>Windows Store</strong> category. Select the <strong>Grid App (XAML)</strong> template.</li>
</ul>
<p style="padding-left: 30px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/2350.4.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/2350.4.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/2350.4.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/2350.4.png" alt="" border="0" /></a></p>
<ul>
<li>Type <strong>MyFirstApp </strong>for the name of the app and accept the defaults for everything else. Click <strong>OK</strong> to create your new project. <strong>NOTE</strong>:&nbsp;In Windows 8, all software development will require a Developer License. After starting Visual Studio, you might be prompted to license your machine for Development. Click <strong>I agree</strong> when prompted. If Visual Studio&nbsp;asks for a Microsoft account, type in your Hotmail or live account and click OK. For more information: <a title="6)	In Windows 8, all software development will require a Developer License. After starting Visual Studio, you might be prompted to license your machine for Development. Click I agree when prompted. If Visual Studio asks for a Microsoft account, type in your Hotmail or live account and click OK. For more information: http://msdn.microsoft.com/en-us/library/windows/apps/hh974578.aspx" href="http://msdn.microsoft.com/en-us/library/windows/apps/hh974578.aspx">http://msdn.microsoft.com/en-us/library/windows/apps/hh974578.aspx</a></li>
</ul>
<p>&nbsp;</p>
<ul>
<li>
<p>Notice that Visual Studio creates a directory structure for you:</p>
</li>
</ul>
<p style="padding-left: 30px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/3480.5.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/3480.5.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/3480.5.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/3480.5.png" alt="" width="384" height="841" border="0" /></a></p>
<ol><ol>
<li>The <strong>Properties </strong>folder contains the some assemblyinfo and project properties.</li>
<li>The <strong>References </strong>folder contains references to other assemblies that this project needs.</li>
<li>The <strong>Assets </strong>folder contains default logos and SplashScreen images and you can use this folder to add custom logo too which can be used by window 8.</li>
<li>The <strong>Common </strong>folder contains classes and XAML styles that simplify application development. You can add your converted classes to this folder and there are already two converter provided by Grid App (XAML) template. It also has BindableBase.cs class which should be used as a base class for all datamodel classes. Now you no need to implement INotifyPropertyChanged Interface for your data model since BindableBase.cs has implemented INotifyPropertyChanged Interface. You can read the ReadMe.txt in that folder for more information. Apart from common source and style this folder also include file by name &ldquo;SuspensionManager.cs&rdquo; file. <strong>SuspensionManager</strong> is a helper class that we use to simplify lifecycle management for the app. It handles several things for you. It saves and restores the navigation state of the <a href="http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.frame.aspx"><strong>Frame</strong></a>&nbsp;that hosts the app pages. Basically it serializes the page state data and writes it to an XML file in your app's local storage.</li>
<li>The <strong>DataModel </strong>folder contains a <strong>SampleDataSource.cs </strong>file. The code in this file generates sample data.</li>
<li><strong>App.xaml </strong>contains the xaml and resources for the window 8 Style app. It initializes the singleton Application object.&nbsp; This is the first line of authored code executed, and as such is the logical equivalent of main() or WinMain(). It also has method which gets called while application move to suspended stage or application is launched normally by end user. You can hook your custom action in these methods if you want to perform certain action while application move to suspended or launch stage.</li>
<li><strong>GroupDetailPage.xaml </strong>displays a collection/Group and the items within it. Basically it enables a user to view group details on the left and items on the right, and select an item to navigate to the full-page item view and that is ItemDetailPage.xaml.</li>
<li><strong>GroupedItemsPage.xaml</strong> is the first page that appears when you&nbsp;run this app. It displays collections and the items in them. Basically it is the home page. It enables a user to view the groups and items, and either selects an item to navigate to the full-page item view, or a select a group label to navigate to the group details page.</li>
<li>
<p><strong>ItemDetailPage.xaml</strong> displays an individual item or full-page view for an item.</p>
</li>
<li>
<p><strong>Package.appxmanifest.xaml </strong>is a special file that details your application package, its capabilities, and how your app is represented to the user. This file includes several image files, like splashscreen.png for the splash screen image, and SmallLogo.png and Logo.png.</p>
</li>
</ol></ol>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/6825.6.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/6825.6.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/6825.6.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/6825.6.png" alt="" border="0" /></a></p>
<ul>
<li>Let&rsquo;s run the application and check how it looks like with default setting. Click <strong>Build -&gt;Build Solution</strong> to build the solution and then press <strong>F5</strong> to run the app.</li>
<li>
<p>Now when you run your application you can see &ldquo;Splash screen&rdquo; which you mentioned in your Package.appmanifest file.</p>
</li>
</ul>
<p style="padding-left: 30px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/2772.7.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/2772.7.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/2772.7.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/2772.7.png" alt="" border="0" /></a></p>
<ul>
<li>After some time, actual app will be loaded and when the app launches, the main page displays collections and the items in them.There are six collections and you can scroll left and right to view them all.</li>
</ul>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/6175.8.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/6175.8.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/6175.8.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/6175.8.png" alt="" border="0" /></a></p>
<ul>
<li>
<p>Select an <strong>ItemTitle: 1</strong> by clicking its rectangle. You will see the detail page for <strong>Item Title: 1</strong>.</p>
</li>
</ul>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/3858.9.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/3858.9.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/3858.9.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/3858.9.png" alt="" border="0" /></a></p>
<ul>
<li>Now if you want to move to Item2 then you can move/hover the mouse on the right and you should see a button with a right arrow. &nbsp;Click that to scroll to the next item in the list. On the left hand side you can click the left arrow button to scroll backwards. Similarly on touch screen device you can flick horizontally to move to next item.</li>
</ul>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/2061.10.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/2061.10.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/2061.10.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/2061.10.png" alt="" width="187" height="106" border="0" /></a></p>
<ul>
<li>
<p>Click or touch the back button in the upper left. You will go back to the main page.</p>
</li>
<li>Now let&rsquo;s go to Group Title 1 detail by clicking on <strong>&ldquo;Group Title: 1&rdquo; </strong>and now you will see the summary page for the Group.</li>
</ul>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/7360.11.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/7360.11.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/7360.11.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/7360.11.png" alt="" border="0" /></a></p>
<ul>
<li>
<p class="ppNumberList">Now one thing you might ask: where is close button to close this application? &hellip;&hellip;. A&nbsp;window 8&nbsp;style app is really a window that has no &ldquo;chrome&rdquo; hence we don&rsquo;t&rsquo; have any close button in win 8 app. You can alt-tab back to Visual Studio. Do that now and click on the stop debugging icon. Note: Stop debugging will not close the window 8 app. To close window 8 app you have to press Alt-F4. It will close the app. When user press Alt-F4, behind the seen app goes to suspended state for 10 second and then move to terminate state.</p>
</li>
<li>
<p class="ppNumberList">What is Simulator: Visual Studio 2012 offers several options to test your window 8 app. You can run the app in a simulator or you can run the app on the local machine, as you just did. To use the simulator, select <strong>Simulator</strong> from the drop-down list associated with the Run button.</p>
</li>
</ul>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/6558.12.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/6558.12.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/6558.12.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/6558.12.png" alt="" border="0" /></a></p>
<ul>
<li>
<p>Press <strong>F5 </strong>to run the app in the Simulator. It will take some while to launch app in Simulator. Once loaded you can notice the toolbar on the right. Click some of the buttons to check the functionality. For example: some of the buttons will rotate app horizontally or vertically to simulate the experience which end user will have on touch screen device.</p>
</li>
</ul>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/2450.13.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/2450.13.png" alt="" border="0" /></p>
<p style="padding-left: 60px;">The Simulator is a <strong>Terminal Services session</strong> into the local machine. You can bring up Task Manager and select the Users tab. You will see a second session under the same login credentials start up.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/8228.14.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/8228.14.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/8228.14.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/8228.14.png" alt="" border="0" /></a></p>
<p style="padding-left: 60px;">Return to Visual Studio and press the stop debugging icon. Notice stop debugging doesn&rsquo;t close the simulator, Simulator is still open. This can be a benefit to save time as you can keep it open across multiple debugging sessions. Now next question come up: How to close the simulator since there is no close button on simulator window: Since minimizing click does not exit the simulator. You can exit it by explicitly clicking exit in the task bar. Now close the simulator. Move back to Local Machine debugging by selecting <strong>Local Machine </strong>from the dropdown list associated with the Run button.</p>
<p style="padding-left: 60px;"><span style="color: #0000ff;"><em><span style="font-size: small;">Till now you understand the structure of the solution and different file and their importance and how to launch app in visual studio 2012. Let&rsquo;s move to next part where I will explain each file of this template.</span></em></span></p>
<ul>
<li>
<p class="ppNumberList">Let&rsquo;s start with <strong><span style="color: #ff6600;">App.xaml</span>:</strong> Open <span style="color: #ff6600;"><strong>App.xaml </strong></span>file. Check how it includes a file &ldquo;Common/StandardStyles.xaml&rdquo;. This file contains styles used throughout the app. Once style file added to <strong>ResourceDictionary</strong> it is available to all files included in current solution. It&rsquo;s like a global variable available to all, throughout the app.</p>
</li>
</ul>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/1586.15.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/1586.15.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/1586.15.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/1586.15.png" alt="" border="0" /></a></p>
<ul>
<li>Open<strong><span style="color: #ff6600;">App.xaml.cs</span> </strong>file. <span style="color: #ff6600;">App.xaml.cs</span> is the code-behind file for App.xaml and it is a partial calss. Together, the XAML and code-behind make a complete class. <span style="color: #ff6600;">App.xaml.cs</span> and is the entry point for your app. It contains a constructor that calls the <strong><code>InitializeComponent </code></strong>method. It's generated by Visual Studio, and its main purpose is to initialize the elements declared in the XAML file.<span style="color: #ff6600;"> <strong>App.xaml.cs</strong></span> also contains methods to handle activation and suspension of the app. It has two methods: OnLaunched and OnSuspending. As name suggesting OnLaunched gets called when app moves to Launch state and OnSuspending gets called when app moves to Suspended state.<span style="color: teal; font-size: small;">&nbsp;&nbsp; <br /></span></li>
</ul>
<p style="padding-left: 30px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<div style="color: black; background: none repeat scroll 0% 0% white; font-family: Consolas; font-size: 10pt; padding-left: 30px;">
<div style="color: black; background: white; font-family: Consolas; font-size: 10pt; border: 1px solid blue;">
<p style="margin: 0px;">&nbsp;<span style="color: blue;">sealed</span> <span style="color: blue;">partial</span> <span style="color: blue;">class</span> <span style="color: #2b91af;">App</span> : <span style="color: #2b91af;">Application</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: gray;">&lt;summary&gt;</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: green;"> Initializes the singleton Application object.&nbsp; This is the first line of authored code</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: green;"> executed, and as such is the logical equivalent of main() or WinMain().</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: gray;">&lt;/summary&gt;</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">public</span> App()</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">this</span>.InitializeComponent();</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">this</span>.Suspending += OnSuspending;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="background: #ededed; margin: 0px;">&nbsp;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: gray;">&lt;summary&gt;</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: green;"> Invoked when the application is launched normally by the end user.&nbsp; Other entry points</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: green;"> will be used when the application is launched to open a specific file, to display</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: green;"> search results, and so forth.</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: gray;">&lt;/summary&gt;</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: gray;">&lt;param name="args"&gt;</span><span style="color: green;">Details about the launch request and process.</span><span style="color: gray;">&lt;/param&gt;</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">protected</span> <span style="color: blue;">override</span> <span style="color: blue;">async</span> <span style="color: blue;">void</span> OnLaunched(<span style="color: #2b91af;">LaunchActivatedEventArgs</span> args)</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: #2b91af;">Frame</span> rootFrame = <span style="color: #2b91af;">Window</span>.Current.Content <span style="color: blue;">as</span> <span style="color: #2b91af;">Frame</span>;</p>
<p style="background: #ededed; margin: 0px;">&nbsp;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">// Do not repeat app initialization when the Window already has content,</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">// just ensure that the window is active</span></p>
<p style="margin: 0px;">&nbsp;</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">if</span> (rootFrame == <span style="color: blue;">null</span>)</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">// Create a Frame to act as the navigation context and navigate to the first page</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; rootFrame = <span style="color: blue;">new</span> <span style="color: #2b91af;">Frame</span>();</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">//Associate the frame with a SuspensionManager key&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: #2b91af;">SuspensionManager</span>.RegisterFrame(rootFrame, <span style="color: #a31515;">"AppFrame"</span>);</p>
<p style="background: #ededed; margin: 0px;">&nbsp;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">if</span> (args.PreviousExecutionState == <span style="color: #2b91af;">ApplicationExecutionState</span>.Terminated)</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">// Restore the saved session state only when appropriate</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">try</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">await</span> <span style="color: #2b91af;">SuspensionManager</span>.RestoreAsync();</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">catch</span> (<span style="color: #2b91af;">SuspensionManagerException</span>)</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">//Something went wrong restoring state.</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">//Assume there is no state and continue</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="background: #ededed; margin: 0px;">&nbsp;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">// Place the frame in the current Window</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: #2b91af;">Window</span>.Current.Content = rootFrame;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">if</span> (rootFrame.Content == <span style="color: blue;">null</span>)</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">// When the navigation stack isn't restored navigate to the first page,</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">// configuring the new page by passing required information as a navigation</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">// parameter</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">if</span> (!rootFrame.Navigate(<span style="color: blue;">typeof</span>(<span style="color: #2b91af;">GroupedItemsPage</span>), <span style="color: #a31515;">"AllGroups"</span>))</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">throw</span> <span style="color: blue;">new</span> <span style="color: #2b91af;">Exception</span>(<span style="color: #a31515;">"Failed to create initial page"</span>);</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">// Ensure the current window is active</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: #2b91af;">Window</span>.Current.Activate();</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="margin: 0px;">&nbsp;</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: gray;">&lt;summary&gt;</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: green;"> Invoked when application execution is being suspended.&nbsp; Application state is saved</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: green;"> without knowing whether the application will be terminated or resumed with the contents</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: green;"> of memory still intact.</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: gray;">&lt;/summary&gt;</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: gray;">&lt;param name="sender"&gt;</span><span style="color: green;">The source of the suspend request.</span><span style="color: gray;">&lt;/param&gt;</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: gray;">&lt;param name="e"&gt;</span><span style="color: green;">Details about the suspend request.</span><span style="color: gray;">&lt;/param&gt;</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">private</span> <span style="color: blue;">async</span> <span style="color: blue;">void</span> OnSuspending(<span style="color: blue;">object</span> sender, <span style="color: #2b91af;">SuspendingEventArgs</span> e)</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">var</span> deferral = e.SuspendingOperation.GetDeferral();</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">await</span> <span style="color: #2b91af;">SuspensionManager</span>.SaveAsync();</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; deferral.Complete();</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; }</p>
</div>
</div>
<ul>
<li>
<p>As we understand we have <strong>SuspensionManager</strong><strong> </strong>Class for navigation and in order to use its functionality, we have to register the main app Frame. We register the Frame in Onlaunched method</p>
</li>
</ul>
&nbsp;
<div style="color: black; background: white; font-family: Consolas; font-size: 10pt; border: 1px solid blue;">
<p style="margin: 0px;">&nbsp;<span style="color: blue;">if</span> (rootFrame == <span style="color: blue;">null</span>)</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">// Create a Frame to act as the navigation context and navigate to the first page</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; rootFrame = <span style="color: blue;">new</span> <span style="color: #2b91af;">Frame</span>();</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">//Associate the frame with a SuspensionManager key&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: #2b91af;">SuspensionManager</span>.RegisterFrame(rootFrame, <span style="color: #a31515;">"AppFrame"</span>);</p>
</div>
<p style="padding-left: 60px;">&nbsp;&nbsp;&nbsp;</p>
<ul>
<li>
<p><strong>LayoutAwarePage.cs </strong>file: As you know accelerometer is the feature used by tablets user which allow user to orient their tablets in any orientation they want. Developers have to handle these changes and in developer preview each page subscribed, in the code behind to the orientation event that gets fired but now this functionality has been moved to Layoutmanager.cs file. LayourManger class server as a base class of all code behind to provide dataViewModel functionality to them. Here are some of the methods that handle that:</p>
</li>
<li>
<div style="color: black; background: white; font-family: Consolas; font-size: 10pt; border: 1px solid blue;">
<p style="margin: 0px;"><span style="color: blue;">&nbsp;#region</span> Visual state switching</p>
<p style="background: #ededed; margin: 0px;">&nbsp;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: gray;">&lt;summary&gt;</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: green;"> Invoked as an event handler, typically on the </span><span style="color: gray;">&lt;see cref="FrameworkElement.Loaded"/&gt;</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: green;"> event of a </span><span style="color: gray;">&lt;see cref="Control"/&gt;</span><span style="color: green;"> within the page, to indicate that the sender should</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: green;"> start receiving visual state management changes that correspond to application view</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: green;"> state changes.</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: gray;">&lt;/summary&gt;</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: gray;">&lt;param name="sender"&gt;</span><span style="color: green;">Instance of </span><span style="color: gray;">&lt;see cref="Control"/&gt;</span><span style="color: green;"> that supports visual state</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: green;"> management corresponding to view states.</span><span style="color: gray;">&lt;/param&gt;</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: gray;">&lt;param name="e"&gt;</span><span style="color: green;">Event data that describes how the request was made.</span><span style="color: gray;">&lt;/param&gt;</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: gray;">&lt;remarks&gt;</span><span style="color: green;">The current view state will immediately be used to set the corresponding</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: green;"> visual state when layout updates are requested.&nbsp; A corresponding</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: gray;">&lt;see cref="FrameworkElement.Unloaded"/&gt;</span><span style="color: green;"> event handler connected to</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: gray;">&lt;see cref="StopLayoutUpdates"/&gt;</span><span style="color: green;"> is strongly encouraged.&nbsp; Instances of</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: gray;">&lt;see cref="LayoutAwarePage"/&gt;</span><span style="color: green;"> automatically invoke these handlers in their Loaded and</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: green;"> Unloaded events.</span><span style="color: gray;">&lt;/remarks&gt;</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: gray;">&lt;seealso cref="DetermineVisualState"/&gt;</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: gray;">&lt;seealso cref="InvalidateVisualState"/&gt;</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">public</span> <span style="color: blue;">void</span> StartLayoutUpdates(<span style="color: blue;">object</span> sender, <span style="color: #2b91af;">RoutedEventArgs</span> e)</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">var</span> control = sender <span style="color: blue;">as</span> <span style="color: #2b91af;">Control</span>;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">if</span> (control == <span style="color: blue;">null</span>) <span style="color: blue;">return</span>;</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">if</span> (<span style="color: blue;">this</span>._layoutAwareControls == <span style="color: blue;">null</span>)</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">// Start listening to view state changes when there are controls interested in updates</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: #2b91af;">Window</span>.Current.SizeChanged += <span style="color: blue;">this</span>.WindowSizeChanged;</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">this</span>._layoutAwareControls = <span style="color: blue;">new</span> <span style="color: #2b91af;">List</span>&lt;<span style="color: #2b91af;">Control</span>&gt;();</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">this</span>._layoutAwareControls.Add(control);</p>
<p style="margin: 0px;">&nbsp;</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">// Set the initial visual state of the control</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: #2b91af;">VisualStateManager</span>.GoToState(control, DetermineVisualState(<span style="color: #2b91af;">ApplicationView</span>.Value), <span style="color: blue;">false</span>);</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="margin: 0px;">&nbsp;</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">private</span> <span style="color: blue;">void</span> WindowSizeChanged(<span style="color: blue;">object</span> sender, <span style="color: #2b91af;">WindowSizeChangedEventArgs</span> e)</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">this</span>.InvalidateVisualState();</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="background: #ededed; margin: 0px;">&nbsp;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: gray;">&lt;summary&gt;</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: green;"> Invoked as an event handler, typically on the </span><span style="color: gray;">&lt;see cref="FrameworkElement.Unloaded"/&gt;</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: green;"> event of a </span><span style="color: gray;">&lt;see cref="Control"/&gt;</span><span style="color: green;">, to indicate that the sender should start receiving</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: green;"> visual state management changes that correspond to application view state changes.</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: gray;">&lt;/summary&gt;</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: gray;">&lt;param name="sender"&gt;</span><span style="color: green;">Instance of </span><span style="color: gray;">&lt;see cref="Control"/&gt;</span><span style="color: green;"> that supports visual state</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: green;"> management corresponding to view states.</span><span style="color: gray;">&lt;/param&gt;</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: gray;">&lt;param name="e"&gt;</span><span style="color: green;">Event data that describes how the request was made.</span><span style="color: gray;">&lt;/param&gt;</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: gray;">&lt;remarks&gt;</span><span style="color: green;">The current view state will immediately be used to set the corresponding</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: green;"> visual state when layout updates are requested.</span><span style="color: gray;">&lt;/remarks&gt;</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: gray;">&lt;seealso cref="StartLayoutUpdates"/&gt;</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">public</span> <span style="color: blue;">void</span> StopLayoutUpdates(<span style="color: blue;">object</span> sender, <span style="color: #2b91af;">RoutedEventArgs</span> e)</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">var</span> control = sender <span style="color: blue;">as</span> <span style="color: #2b91af;">Control</span>;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">if</span> (control == <span style="color: blue;">null</span> || <span style="color: blue;">this</span>._layoutAwareControls == <span style="color: blue;">null</span>) <span style="color: blue;">return</span>;</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">this</span>._layoutAwareControls.Remove(control);</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">if</span> (<span style="color: blue;">this</span>._layoutAwareControls.Count == 0)</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">// Stop listening to view state changes when no controls are interested in updates</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">this</span>._layoutAwareControls = <span style="color: blue;">null</span>;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: #2b91af;">Window</span>.Current.SizeChanged -= <span style="color: blue;">this</span>.WindowSizeChanged;</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
</div>
</li>
</ul>
<p style="padding-left: 60px;">And apart from these handlers there is a <strong>DefaultViewModel</strong> property in the LayoutAwarePage class. This property will be used to bind data to xaml control. You can check code behind of <strong>GroupedItemPage.xaml.cs.</strong></p>
<ul>
<li>
<div style="color: black; background: white; font-family: Consolas; font-size: 10pt; border: 1px solid blue;">
<p style="margin: 0px;">&nbsp;<span style="color: gray;">///</span><span style="color: gray;">&lt;summary&gt;</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: green;"> An implementation of </span><span style="color: gray;">&lt;see cref="IObservableMap&amp;lt;String, Object&amp;gt;"/&gt;</span><span style="color: green;"> designed to be</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: green;"> used as a trivial view model.</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: gray;">&lt;/summary&gt;</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">protected</span> <span style="color: #2b91af;">IObservableMap</span>&lt;<span style="color: #2b91af;">String</span>, <span style="color: #2b91af;">Object</span>&gt; DefaultViewModel</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">get</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">return</span> <span style="color: blue;">this</span>.GetValue(DefaultViewModelProperty) <span style="color: blue;">as</span> <span style="color: #2b91af;">IObservableMap</span>&lt;<span style="color: #2b91af;">String</span>, <span style="color: #2b91af;">Object</span>&gt;;</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="margin: 0px;">&nbsp;</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">set</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">this</span>.SetValue(DefaultViewModelProperty, <span style="color: blue;">value</span>);</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
</div>
</li>
</ul>
<p style="padding-left: 60px;"><strong>&nbsp;&nbsp; <br /></strong></p>
<ul>
<li>
<p><strong>GroupedItemsPage.xaml.cs:</strong> Open this page and you can see the collection of sample data group is added to the DefaultViewModel property bag.</p>
</li>
<li>
<div style="color: black; background: white; font-family: Consolas; font-size: 10pt; border: 1px solid blue;">
<p style="margin: 0px;">&nbsp;<span style="color: blue;">protected</span> <span style="color: blue;">override</span> <span style="color: blue;">void</span> LoadState(<span style="color: #2b91af;">Object</span> navigationParameter, <span style="color: #2b91af;">Dictionary</span>&lt;<span style="color: #2b91af;">String</span>, <span style="color: #2b91af;">Object</span>&gt; pageState)</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">// TODO: Create an appropriate data model for your problem domain to replace the sample data</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">var</span> sampleDataGroups = <span style="color: #2b91af;">SampleDataSource</span>.GetGroups((<span style="color: #2b91af;">String</span>)navigationParameter);</p>
<p>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">this</span>.DefaultViewModel[<span style="color: #a31515;">"Groups"</span>] = sampleDataGroups;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
</div>
</li>
</ul>
<ul>
<li>Now go to <strong>GroupedItemsPage.xaml</strong>, you can see at the top inside <strong>Page.Resources </strong>tag, that it uses this &ldquo;Groups&rdquo; as the Source of the <strong>CollectionViewSource</strong>. The name of this source is groupedItemsViewSource</li>
</ul>
<p style="padding-left: 90px;">&nbsp;&nbsp; &lt;CollectionViewSource<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x:Name="groupedItemsViewSource"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Source="{Binding Groups}"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IsSourceGrouped="true"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ItemsPath="TopItems"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d:Source="{Binding AllGroups, Source={d:DesignInstance Type=data:SampleDataSource, IsDesignTimeCreatable=True}}"/&gt;</p>
<p style="padding-left: 60px;">This page uses a <strong>GridView </strong>to display the collections and items. You can see the <strong>groupedItemsViewSource</strong> refer here which is bind to the <strong>ItemsSource</strong> property of <strong>GridView.</strong></p>
<p style="padding-left: 60px;"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/5582.22.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/5582.22.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/5582.22.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/5582.22.png" alt="" border="0" /></a></strong></p>
<p style="padding-left: 60px;">Inside <strong>GroupedItemsPage.xaml.cs</strong> file, when the user clicks an individual item, the code uses the Navigate method on the Frame again to go to the <strong>ItemDetailPage</strong>&nbsp;</p>
<ul>
<li><strong><strong></strong></strong>
<div style="color: black; background: white; font-family: Consolas; font-size: 10pt; border: 1px solid blue;">
<p style="margin: 0px;">&nbsp; <span style="color: blue;">void</span> ItemView_ItemClick(<span style="color: blue;">object</span> sender, <span style="color: #2b91af;">ItemClickEventArgs</span> e)</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">// Navigate to the appropriate destination page, configuring the new page</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">// by passing required information as a navigation parameter</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">var</span> itemId = ((<span style="color: #2b91af;">SampleDataItem</span>)e.ClickedItem).UniqueId;</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">this</span>.Frame.Navigate(<span style="color: blue;">typeof</span>(<span style="color: #2b91af;">ItemDetailPage</span>), itemId);</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
</div>
</li>
</ul>
<p style="padding-left: 60px;">In that same <strong>GroupedItemsPage.xaml.cs</strong> file, when the user clicks a Group header, the code uses the Navigate method on the Frame to go to the <strong>GroupDetailPage</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<ul>
<li><strong><strong></strong></strong>
<div style="color: black; background: white; font-family: Consolas; font-size: 10pt; border: 1px solid blue;">
<p style="margin: 0px;"><span style="color: blue;">void</span> Header_Click(<span style="color: blue;">object</span> sender, <span style="color: #2b91af;">RoutedEventArgs</span> e)</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">// Determine what group the Button instance represents</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">var</span> group = (sender <span style="color: blue;">as</span> <span style="color: #2b91af;">FrameworkElement</span>).DataContext;</p>
<p style="margin: 0px;">&nbsp;</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">// Navigate to the appropriate destination page, configuring the new page</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">// by passing required information as a navigation parameter</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">this</span>.Frame.Navigate(<span style="color: blue;">typeof</span>(<span style="color: #2b91af;">GroupDetailPage</span>), ((<span style="color: #2b91af;">SampleDataGroup</span>)group).UniqueId);</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
</div>
</li>
</ul>
<ul>
<li>Open the <strong>ItemDetailPage.xaml </strong>file. This page uses a <strong>FlipView</strong> to enable scrolling back and forth through the items in a collection.</li>
</ul>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/8322.25.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/8322.25.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/8322.25.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/8322.25.png" alt="" border="0" /></a></p>
<ul>
<li>
<p>Open the<strong> ItemDetailPage.xaml.cs</strong> file; it is inherited from <strong>LayoutAwarePage</strong>, which implements functionality such as <strong>GoHome </strong>and <strong>GoBack</strong> to navigate the stack of pages. Inside <strong>LoadState</strong> method it binds last clicked item and its group and group items.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
</li>
</ul>
<ul>
<li>
<div style="color: black; background: white; font-family: Consolas; font-size: 10pt; border: 1px solid blue;">
<p style="margin: 0px;">&nbsp;<span style="color: blue;">protected</span> <span style="color: blue;">override</span> <span style="color: blue;">void</span> LoadState(<span style="color: #2b91af;">Object</span> navigationParameter, <span style="color: #2b91af;">Dictionary</span>&lt;<span style="color: #2b91af;">String</span>, <span style="color: #2b91af;">Object</span>&gt; pageState)</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">// Allow saved page state to override the initial item to display</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">if</span> (pageState != <span style="color: blue;">null</span> &amp;&amp; pageState.ContainsKey(<span style="color: #a31515;">"SelectedItem"</span>))</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; navigationParameter = pageState[<span style="color: #a31515;">"SelectedItem"</span>];</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="background: #ededed; margin: 0px;">&nbsp;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">// TODO: Create an appropriate data model for your problem domain to replace the sample data</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">var</span> item = <span style="color: #2b91af;">SampleDataSource</span>.GetItem((<span style="color: #2b91af;">String</span>)navigationParameter);</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">this</span>.DefaultViewModel[<span style="color: #a31515;">"Group"</span>] = item.Group;</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">this</span>.DefaultViewModel[<span style="color: #a31515;">"Items"</span>] = item.Group.Items;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">this</span>.flipView.SelectedItem = item;</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
</div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
</ul>
<ul>
<li>
<p class="ppNumberList">Open the <strong>GroupDetailPage.xaml</strong> file. This page displays the category&rsquo;s/Groups&rsquo;s image and text on the left and then uses a GridView to display the items in the category.</p>
</li>
</ul>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/2084.27.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/2084.27.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/63/2084.27.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-63/2084.27.png" alt="" border="0" /></a></p>
<ul>
<li>
<p class="ppNumberList">Open the <strong>GroupDetailPage.xaml.cs</strong> file. It also inherits from <strong>LayoutAwarePage </strong>and gets the <strong>GoHome</strong> and <strong>GoBack</strong> methods from this parent. At the end open the <strong>SampleDataSource.cs</strong> file and move to the definition of the SampleDataSource class. This class creates collections and items using dummy data.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
</li>
</ul>
<ul>
<li>
<div style="color: black; background: white; font-family: Consolas; font-size: 10pt; border: 1px solid blue;">
<p style="margin: 0px;"><span style="color: blue;">public</span> <span style="color: blue;">sealed</span> <span style="color: blue;">class</span> <span style="color: #2b91af;">SampleDataSource</span></p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">private</span> <span style="color: blue;">static</span> <span style="color: #2b91af;">SampleDataSource</span> _sampleDataSource = <span style="color: blue;">new</span> <span style="color: #2b91af;">SampleDataSource</span>();</p>
<p style="background: #ededed; margin: 0px;">&nbsp;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">private</span> <span style="color: #2b91af;">ObservableCollection</span>&lt;<span style="color: #2b91af;">SampleDataGroup</span>&gt; _allGroups = <span style="color: blue;">new</span> <span style="color: #2b91af;">ObservableCollection</span>&lt;<span style="color: #2b91af;">SampleDataGroup</span>&gt;();</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">public</span> <span style="color: #2b91af;">ObservableCollection</span>&lt;<span style="color: #2b91af;">SampleDataGroup</span>&gt; AllGroups</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="background: #ededed; margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">get</span> { <span style="color: blue;">return</span> <span style="color: blue;">this</span>._allGroups; }</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
</div>
</li>
</ul>
<p><span style="color: #ff6600; font-size: medium;">Summary&hellip;..</span></p>
<p>In this tutorial you learnt Grid View (XAML) template and understand the structure of the project and files included in the project and navigation between pages and how data is bound to the Grid Control. Hope this can help you get excite about window 8 development. Please feel free to comment and share your thoughts.</p>
<p>In my next article I will explain how to modify SampleDataSource to use real data.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
  </channel>
</rss>