<?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>Going Metro</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/going_metro/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/going_metro/feed.xml</link>
    <description>This blog explores concepts pertaining to the development of Windows 8 Metro applications</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:23:23 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Modern App Automation</title>
      <link>https://docs.microsoft.com/archive/blogs/going_metro/modern-app-automation</link>
      <pubDate>Mon, 26 Nov 2012 12:07:00 GMT</pubDate>
      <dc:creator><![CDATA[Venkata Siva Prasad Vitakula]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/going_metro/2012/11/26/modern-app-automation/</guid>
      <description><![CDATA[I recently was assigned the task of doing a POC on Modern App Automation, specifically that are to...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: comic sans ms,sans-serif; font-size: small;">I recently was assigned the task of doing a POC on Modern App Automation, specifically that are to do with application state management. For instance things like,</span></p>
<ul>
<li><span style="font-family: comic sans ms,sans-serif; font-size: small;">Activating the App.</span></li>
<li><span style="font-family: comic sans ms,sans-serif; font-size: small;">Suspending/Resuming/Terminating an app.</span></li>
<li><span style="font-family: comic sans ms,sans-serif; font-size: small;">App Bar activation.</span></li>
<li><span style="font-family: comic sans ms,sans-serif; font-size: small;">Snapping the app.</span></li>
<li><span style="font-family: comic sans ms,sans-serif; font-size: small;">Activate Sharing etc.</span></li>
</ul>
<p>&nbsp;</p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: small;">&nbsp;I started off with the unmanaged&nbsp;code presented in the blog post <a href="http://blogs.msdn.com/b/windowsappdev/archive/2012/09/04/automating-the-testing-of-windows-8-apps.aspx">http://blogs.msdn.com/b/windowsappdev/archive/2012/09/04/automating-the-testing-of-windows-8-apps.aspx</a></span></p>
<p><span style="font-family: comic sans ms,sans-serif;">&nbsp;--------------------------------------------------------------------------------------------------------------------------------</span></p>
<p><span style="font-family: comic sans ms,sans-serif;">HRESULT LaunchApp(<span style="color: #0000ff;">const</span> std::wstring&amp; strAppUserModelId, PDWORD pdwProcessId)</span><br /><span style="font-family: comic sans ms,sans-serif;">{</span><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp; CComPtr&lt;IApplicationActivationManager&gt; spAppActivationManager;</span><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp; HRESULT hrResult = E_INVALIDARG;</span><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp; <span style="color: #0000ff;">if</span> (!strAppUserModelId.empty())</span><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp; {</span><br /><span style="color: #008000; font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Instantiate IApplicationActivationManager</span><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hrResult = CoCreateInstance(CLSID_ApplicationActivationManager,</span><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NULL,</span><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CLSCTX_LOCAL_SERVER,</span><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IID_IApplicationActivationManager,</span><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (LPVOID*)&amp;spAppActivationManager);</span><br /><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #0000ff;">if</span> (SUCCEEDED(hrResult))</span><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span><br /><span style="color: #008000; font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // This call ensures that the app is launched as the foreground window</span><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hrResult = CoAllowSetForegroundWindow(spAppActivationManager, NULL);</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /><span style="color: #008000; font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Launch the app</span><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #0000ff;">if</span> (SUCCEEDED(hrResult))</span><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hrResult = spAppActivationManager-&gt;ActivateApplication(strAppUserModelId.c_str(),</span><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NULL,</span><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AO_NONE,</span><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pdwProcessId);</span><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp; }</span><br /><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp; <span style="color: #0000ff;">return</span> hrResult;</span><br /><span style="font-family: comic sans ms,sans-serif;">}</span><br /><br /><span style="font-family: comic sans ms,sans-serif;"><span style="color: #0000ff;">int</span> _tmain(<span style="color: #0000ff;">int</span> argc, _TCHAR* argv[])</span><br /><span style="font-family: comic sans ms,sans-serif;">{</span><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp; HRESULT hrResult = S_OK;</span><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp; <span style="color: #0000ff;">if</span> (SUCCEEDED(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED)))</span><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp; {</span><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #0000ff;">if</span> (argc == 2)</span><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DWORD dwProcessId = 0;</span><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ++argv;</span><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hrResult = LaunchApp(*argv, &amp;dwProcessId);</span><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><br /><span style="color: #0000ff; font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else</span><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hrResult = E_INVALIDARG;</span><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><br /><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CoUninitialize();</span><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp; }</span><br /><br /><span style="font-family: comic sans ms,sans-serif;">&nbsp;&nbsp;&nbsp; <span style="color: #0000ff;">return</span> hrResult;</span><br /><span style="font-family: comic sans ms,sans-serif;">}</span></p>
<p><span style="font-family: comic sans ms,sans-serif;">---------------------------------------------------------------------------------------------------------------------------------</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: small;">&nbsp;One of the requirements was to be able to execute this from managed code. I did some reading on how to call Unmanaged COM Code from managed code and&nbsp;decided to try the below options.</span></p>
<p>&nbsp;</p>
<ol>
<li><span style="font-family: comic sans ms,sans-serif; font-size: small;">PINVOKE</span></li>
<li><span style="font-family: comic sans ms,sans-serif; font-size: small;">COM Class Wrappers. (<a href="http://msdn.microsoft.com/en-us/library/aa645736%28v=VS.71%29.aspx">http://msdn.microsoft.com/en-us/library/aa645736%28v=VS.71%29.aspx</a>)</span></li>
</ol>
<p><span style="font-family: comic sans ms,sans-serif;"><span style="font-size: small;">This article documents my&nbsp;efforts in getting the above piece of code executed from &nbsp;managed code using</span> <span style="font-size: large;"><strong>PINVOKE</strong></span>.&nbsp;<span style="font-size: small;">I am not familiar with COM &amp; Unmanaged Code (C++). I had to do a lot of learning before&nbsp;I attempted this.Some of the things that I write here can be very basic (as I mentioned this is my first try at Unmanaged COM code).</span></span></p>
<p>&nbsp;</p>
<ol>
<li><span style="font-family: comic sans ms,sans-serif; font-size: small;">I started by creating&nbsp;a C++ Dynamic Linked Library project called MAF32.</span></li>
<li><span style="font-family: comic sans ms,sans-serif; font-size: small;">Refactored the above code,</span></li>
</ol>
<ul>
<ul>
<li><span style="font-family: comic sans ms,sans-serif; font-size: small;">&nbsp;Moved everything&nbsp;into a single method (Moved the logic with the main method into the Launch app method.)</span></li>
<li><span style="font-family: comic sans ms,sans-serif;"><span style="font-size: small;">Updated the first parameter type from constant pointer to</span> <strong><span style="font-size: large;">std::wstring</span></strong> to&nbsp;<strong><span style="font-size: large;">LPWSTR. </span></strong><span style="font-size: small;">This was done to facilitate marshaling of managed types while using <strong>PINVOKE</strong>.</span></span></li>
</ul>
</ul>
<p><span style="font-family: comic sans ms,sans-serif;">-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p><span style="font-family: comic sans ms,sans-serif;">HRESULT LaunchApp(<strong>LPWSTR</strong> strAppUserModelId, PDWORD pdwProcessId)</span></p>
<p><span style="font-family: comic sans ms,sans-serif;">{</span></p>
<p><span style="font-family: comic sans ms,sans-serif;">HRESULT hrResult =</span></p>
<p><span style="font-family: comic sans ms,sans-serif;"><span style="color: #6f008a;"><span style="color: #6f008a;">S_OK</span></span>;</span></p>
<p><span style="font-family: comic sans ms,sans-serif;"><span style="color: #0000ff;"><span style="color: #0000ff;">if</span></span> (<span style="color: #6f008a;"><span style="color: #6f008a;">SUCCEEDED</span></span>(CoInitializeEx(<span style="color: #6f008a;"><span style="color: #6f008a;">NULL</span></span>, COINIT_APARTMENTTHREADED)))</span></p>
<p><span style="font-family: comic sans ms,sans-serif;">{</span></p>
<p><span style="font-family: comic sans ms,sans-serif;">CComPtr&lt;IApplicationActivationManager&gt; spAppActivationManager;</span></p>
<p><span style="font-family: comic sans ms,sans-serif;">HRESULT hrResult = <span style="color: #6f008a;"><span style="color: #6f008a;">E_INVALIDARG</span></span>;</span></p>
<p><span style="font-family: comic sans ms,sans-serif;">size_t&nbsp; strlength = wcslen(<span style="color: #808080;"><span style="color: #808080;">strAppUserModelId</span></span>);</span></p>
<p><span style="font-family: comic sans ms,sans-serif;"><span style="color: #0000ff;"><span style="color: #0000ff;">if</span></span> (strlength != 0)</span></p>
<p><span style="font-family: comic sans ms,sans-serif;">{</span></p>
<p><span style="color: #008000; font-family: comic sans ms,sans-serif;"><span style="color: #008000;">// Instantiate IApplicationActivationManager</span></span></p>
<p><span style="font-family: comic sans ms,sans-serif;">hrResult = CoCreateInstance(CLSID_ApplicationActivationManager,</span></p>
<p><span style="font-family: comic sans ms,sans-serif;"><span style="color: #6f008a;"><span style="color: #6f008a;">NULL</span></span>,</span></p>
<p><span style="font-family: comic sans ms,sans-serif;">CLSCTX_LOCAL_SERVER,</span></p>
<p><span style="font-family: comic sans ms,sans-serif;">IID_IApplicationActivationManager,</span></p>
<p><span style="font-family: comic sans ms,sans-serif;">(LPVOID*)&amp;spAppActivationManager);</span></p>
<p><span style="font-family: comic sans ms,sans-serif;"><span style="color: #0000ff;"><span style="color: #0000ff;">if</span></span> (<span style="color: #6f008a;"><span style="color: #6f008a;">SUCCEEDED</span></span>(hrResult))</span></p>
<p><span style="font-family: comic sans ms,sans-serif;">{</span></p>
<p><span style="color: #008000; font-family: comic sans ms,sans-serif;"><span style="color: #008000;">// This call ensures that the app is launched as the foreground window</span></span></p>
<p><span style="color: #008000; font-family: comic sans ms,sans-serif;"><span style="color: #008000;"><br /></span></span></p>
<p><span style="font-family: comic sans ms,sans-serif;">hrResult = CoAllowSetForegroundWindow(spAppActivationManager,</span></p>
<p><span style="font-family: comic sans ms,sans-serif;"><span style="color: #6f008a;"><span style="color: #6f008a;">NULL</span></span>);</span></p>
<p><span style="color: #008000; font-family: comic sans ms,sans-serif;"><span style="color: #008000;">// Launch the app</span></span></p>
<p><span style="color: #008000; font-family: comic sans ms,sans-serif;"><span style="color: #008000;"><br /></span></span></p>
<p><span style="font-family: comic sans ms,sans-serif;"><span style="color: #0000ff;"><span style="color: #0000ff;">if</span></span> (<span style="color: #6f008a;"><span style="color: #6f008a;">SUCCEEDED</span></span>(hrResult))</span></p>
<p><span style="font-family: comic sans ms,sans-serif;">{</span></p>
<p><span style="font-family: comic sans ms,sans-serif;">hrResult = spAppActivationManager-&gt;ActivateApplication(strAppUserModelId,</span></p>
<p><span style="font-family: comic sans ms,sans-serif;"><span style="color: #6f008a;"><span style="color: #6f008a;">NULL</span></span>,</span></p>
<p><span style="font-family: comic sans ms,sans-serif;">AO_NONE,</span></p>
<p><span style="font-family: comic sans ms,sans-serif;">pdwProcessId);</span></p>
<p><span style="font-family: comic sans ms,sans-serif;">}</span></p>
<p><span style="font-family: comic sans ms,sans-serif;">}</span></p>
<p><span style="font-family: comic sans ms,sans-serif;">}</span></p>
<p><span style="font-family: comic sans ms,sans-serif;">CoUninitialize();</span></p>
<p><span style="font-family: comic sans ms,sans-serif;">}</span></p>
<p><span style="font-family: comic sans ms,sans-serif;"><span style="color: #0000ff;"><span style="color: #0000ff;">return</span></span> hrResult;</span></p>
<p><span style="font-family: comic sans ms,sans-serif;">}</span></p>
<p><span style="font-family: comic sans ms,sans-serif;">---------------------------------------------------------------------------------------------------------------------------------------------------------</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: small;">&nbsp;In short, the above COM code does the following.</span></p>
<ul>
<li><span style="font-family: comic sans ms,sans-serif; font-size: small;">Initializes a COM instance (COM must be initialized&nbsp;for every thread that executes COM code).</span></li>
<li><span style="font-family: comic sans ms,sans-serif; font-size: small;">Creates an instance of the COM&nbsp;interface IApplicationActivationManager.</span></li>
<li><span style="font-family: comic sans ms,sans-serif; font-size: small;">Calls the activate application method.</span></li>
<li><span style="font-family: comic sans ms,sans-serif; font-size: small;">Un-Initializes the COM instance</span></li>
</ul>
<p><span style="font-family: comic sans ms,sans-serif;">3. <span style="font-size: small;">Created a C# Console application project and added the following code which allows us to call the</span> <span style="font-size: medium;"><strong>LaunchApp</strong></span> <span style="font-size: small;">method from the Unmanaged dll (MAF32.dll).</span></span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">&nbsp;</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">&nbsp;[<span style="color: #2b91af;"><span style="color: #2b91af;">DllImport</span></span>(<span style="color: #a31515;"><span style="color: #a31515;">"MAF32.dll"</span></span>)]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//Note: Name of the&nbsp;C++ dll that we created in Step 1.&nbsp;</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;"><span style="color: #0000ff;"><span style="color: #0000ff;">&nbsp; public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">static </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">extern </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">int</span></span> LaunchApp(&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//Note: Name of the method must be exactly same as the one defined in C++ code.</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;"><span style="color: #0000ff;"><span style="color: #0000ff;">&nbsp;&nbsp;&nbsp; string</span></span> processIdentifier,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;"><span style="color: #0000ff;"><span style="color: #0000ff;">&nbsp;&nbsp;&nbsp;&nbsp;out </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">int</span></span> processId); //The C++ code takes a pointer to DWORD as parameter. In C#, I am passing reference (note the out keyword)&nbsp;to a integer as a parameter.</span></p>
<p>&nbsp;</p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: small;">4. Now in the Console application's Main method, I called the method as follows.</span></p>
<p>&nbsp;</p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;"><span style="color: #0000ff;"><span style="color: #0000ff;">&nbsp;&nbsp; uint</span></span> processId;</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;"><span style="color: #2b91af;"><span style="color: #2b91af;">&nbsp;&nbsp; PlatformInvokeTest</span></span>.LaunchApp(<span style="color: #a31515;"><span style="color: #a31515;">@"Microsoft.BingTravel_8wekyb3d8bbwe!AppexTravel"</span></span>, <span style="color: #0000ff;"><span style="color: #0000ff;">out</span></span> processId);</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;"><span style="color: #2b91af;"><span style="color: #2b91af;">&nbsp;&nbsp; Console</span></span>.WriteLine(processId);</span></p>
<p>&nbsp;</p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: small;">Note: For this to work, the unmanaged dll created in step1 (MAF32.dll) must be present in the same directory as that of the C# application.</span></p>
<p>&nbsp;</p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: small;">5. On executing the managed code, I got "EntryPointNotFoundException".</span></p>
<p>&nbsp;</p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/4810.Picture1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/4810.Picture1.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/4810.Picture1.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/4810.Picture1.png" alt="" border="0" /></a></span></p>
<p>&nbsp;</p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: small;">6. I downloaded the Depends.exe (SysInternals tool) to see the methods exposed by MAF32.dll) .</span></p>
<p>&nbsp;</p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/6864.Picture2.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/6864.Picture2.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/6864.Picture2.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/6864.Picture2.png" alt="" border="0" /></a></span></p>
<p>&nbsp;</p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: small;">Even though "MAF.dll" contains a method call LaunchApp, it is not visible to the clients. In order to make this method visible to the clients we must do one of the following</span></p>
<ul>
<li><span style="font-family: comic sans ms,sans-serif; font-size: small;">Explicitly define the dll's interface using the dll export attribute. <a href="http://msdn.microsoft.com/en-us/library/3y1sfaz2(v=VS.80).aspx">http://msdn.microsoft.com/en-us/library/3y1sfaz2(v=VS.80).aspx</a></span></li>
<li><span style="font-family: comic sans ms,sans-serif; font-size: small;">Use Module definition&nbsp; (.def) files to specify the methods that are exposed by the dll. <a href="http://msdn.microsoft.com/en-us/library/d91k01sh.aspx">http://msdn.microsoft.com/en-us/library/d91k01sh.aspx</a></span></li>
</ul>
<p><span style="font-family: comic sans ms,sans-serif; font-size: small;">I chose to follow the first method. So I made the below changes.</span></p>
<ul>
<li><span style="font-family: comic sans ms,sans-serif; font-size: small;"><span style="font-family: comic sans ms,sans-serif; font-size: small;">Added the code <strong>"#define DllExport extern "C" __declspec( dllexport )"</strong> to the code.</span></span></li>
<li><span style="font-family: comic sans ms,sans-serif; font-size: small;"><span style="font-family: comic sans ms,sans-serif; font-size: small;">Decorated the LanuchApp method with the <strong>DllExport</strong> keyword.</span></span></li>
</ul>
<p><span style="font-family: comic sans ms,sans-serif; font-size: small;">Now on running the depends tool once again, you can see the LaunchApp method.</span></p>
<p>&nbsp;</p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/8156.Picture3.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/8156.Picture3.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/8156.Picture3.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/8156.Picture3.png" alt="" border="0" /></a></span></p>
<p>&nbsp;</p>
<p>&nbsp;<span style="font-family: comic sans ms,sans-serif; font-size: small;">7. I re-executed the C# Console application. I no longer got the EntryPointNotFound exception. However the method doesn't launch the app as expected. On debugging I found that the call to the method</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(<span style="color: #6f008a;"><span style="color: #6f008a;">SUCCEEDED</span></span>(CoInitializeEx(<span style="color: #6f008a;"><span style="color: #6f008a;">NULL</span></span>, <span style="color: #2f4f4f;"><span style="color: #2f4f4f;">COINIT_APARTMENTTHREADED</span></span>)))</span></p>
<p><span style="font-size: medium;"><span style="font-family: comic sans ms,sans-serif;"><span style="font-size: small;">always returns a failure and the rest of the code is not being executed. The CoInitializeEx method returns the error code</span> "<strong>RPC_E_CHANGED_MODE" </strong><span style="font-size: small;">which means the COM has been already initialized on that thread in a different mode.&nbsp; From .Net 2.0 onwards CLR initializes COM on every Dot net thread in Multi Threaded Apartment state by default.&nbsp;The C++ code is trying to initialize it in Single threaded apartment state, Hence the error.&nbsp;</span></span></span></p>
<p><span style="font-size: medium;"><span style="font-family: comic sans ms,sans-serif;"><span style="font-size: small;"><strong>I have removed the call to CoInitializeEx and CoUninitialize since this is already handle by CLR.</strong></span></span></span></p>
<p><span style="font-size: medium;"><span style="font-family: comic sans ms,sans-serif;"><span style="font-size: small;"><strong>8. </strong>On&nbsp; further execution, the call to the <strong>ActivateApplication</strong> method return the error code "-<strong>2144927148</strong>" (<strong>0x80270254</strong>)&nbsp;which is "</span></span></span><span style="font-family: comic sans ms,sans-serif;"><strong>E_APPLICATION_NOT_REGISTERED</strong>" . <span style="font-size: small;">After debugging for quiet sometime and trial and error, I figured out that this was because of marshaling issues. I changed the below marshaling code&nbsp;&nbsp;as follows,</span></span></p>
<p>&nbsp;&nbsp;<span style="font-family: comic sans ms,sans-serif; font-size: medium;"> [<span style="color: #2b91af;"><span style="color: #2b91af;">DllImport</span></span>(<span style="color: #a31515;"><span style="color: #a31515;">"MAF32.dll"</span></span>)]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;"><span style="color: #0000ff;"><span style="color: #0000ff;">&nbsp; public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">static </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">extern </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">int</span></span> LaunchApp(</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<span style="color: #2b91af;"><span style="color: #2b91af;">In</span></span>, <span style="color: #2b91af;"><span style="color: #2b91af;">MarshalAs</span></span>(<span style="color: #2b91af;"><span style="color: #2b91af;">UnmanagedType</span></span>.LPWStr)]<span style="color: #0000ff;"><span style="color: #0000ff;">string</span></span> processIdentifier,</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<span style="color: #2b91af;"><span style="color: #2b91af;">Out</span></span>, <span style="color: #2b91af;"><span style="color: #2b91af;">MarshalAs</span></span>(<span style="color: #2b91af;"><span style="color: #2b91af;">UnmanagedType</span></span>.U4)] <span style="color: #0000ff;"><span style="color: #0000ff;">out </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">int</span></span> processId);</span></p>
<p>&nbsp;</p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: small;">For more info on marshaling see</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: small;"><span style="font-family: comic sans ms,sans-serif;"><a href="http://msdn.microsoft.com/en-us/library/aa288468(v=VS.71).aspx#pinvoke_defaultmarshaling">http://msdn.microsoft.com/en-us/library/aa288468(v=VS.71).aspx#pinvoke_defaultmarshaling</a> </span></span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: small;"><a href="http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marshalasattribute(v=vs.71).aspx">http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marshalasattribute(v=vs.71).aspx</a></span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: small;"><a href="http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.unmanagedtype(v=vs.71).aspx">http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.unmanagedtype(v=vs.71).aspx</a></span></p>
<p>&nbsp;</p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">After this I&nbsp;was able to launch the application from managed code.</span></p>
<p>&nbsp;</p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">Final Code for launching a modern app from Managed code&nbsp;is below.</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">*************Unmanaged code in MAF32.cpp************************</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">#include&nbsp;<span style="color: #a31515;"><span style="color: #a31515;">"stdafx.h"</span></span></span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">#include <span style="color: #a31515;"><span style="color: #a31515;">"stdafx.h"</span></span></span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">#include&nbsp;<span style="color: #a31515;"><span style="color: #a31515;">&lt;shlobj.h&gt;</span></span></span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">#include <span style="color: #a31515;"><span style="color: #a31515;">&lt;stdio.h&gt;</span></span></span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">#include <span style="color: #a31515;"><span style="color: #a31515;">&lt;shobjidl.h&gt;</span></span></span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">#include&nbsp;<span style="color: #a31515;"><span style="color: #a31515;">&lt;objbase.h&gt;</span></span></span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">#include <span style="color: #a31515;"><span style="color: #a31515;">&lt;atlbase.h&gt;</span></span></span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">#include&nbsp;<span style="color: #a31515;"><span style="color: #a31515;">&lt;string&gt;</span></span></span></p>
<p>&nbsp;</p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">#define&nbsp;<span style="color: #6f008a;"><span style="color: #6f008a;">DllExport ext</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">ern </span></span><span style="color: #a31515;"><span style="color: #a31515;">"C" </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">__declspec</span></span>( <span style="color: #0000ff;"><span style="color: #0000ff;">dllexport</span></span> )</span></p>
<p>&nbsp;</p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">DllExport&nbsp;<span style="color: #2b91af;"><span style="color: #2b91af;">HRESULT</span></span> LaunchApp(<span style="color: #2b91af;"><span style="color: #2b91af;">LPWSTR</span></span><span style="color: #808080;"><span style="color: #808080;">strAppUserModelId</span></span>, <span style="color: #2b91af;"><span style="color: #2b91af;">PDWORD</span></span><span style="color: #808080;"><span style="color: #808080;">pdwProcessId</span></span>)</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">{</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;"><span style="color: #2b91af;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp; HRESULT</span></span> hrResult = <span style="color: #6f008a;"><span style="color: #6f008a;">E_INVALIDARG</span></span>; </span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;"><span style="color: #2b91af;"><span style="color: #2b91af;">&nbsp;&nbsp; CComPtr</span></span>&lt;<span style="color: #2b91af;"><span style="color: #2b91af;">IApplicationActivationManager</span></span>&gt; spAppActivationManager;</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;"><span style="color: #2b91af;"><span style="color: #2b91af;">&nbsp;&nbsp; size_t</span></span>&nbsp; strlength = wcslen(<span style="color: #808080;"><span style="color: #808080;">strAppUserModelId</span></span>);</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;"><span style="color: #0000ff;"><span style="color: #0000ff;">&nbsp; if</span></span> (strlength != 0)</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">&nbsp; {</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hrResult = CoCreateInstance(</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CLSID_ApplicationActivationManager,</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;"><span style="color: #6f008a;"><span style="color: #6f008a;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NULL</span></span>,</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;"><span style="color: #2f4f4f;"><span style="color: #2f4f4f;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CLSCTX_LOCAL_SERVER</span></span>,</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IID_IApplicationActivationManager,</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">&nbsp;&nbsp;&nbsp;&nbsp; (</span><span style="font-family: comic sans ms,sans-serif; font-size: medium;"><span style="color: #2b91af;"><span style="color: #2b91af;">LPVOID</span></span>*)&amp;spAppActivationManager);</span></p>
<p>&nbsp;</p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;"><span style="color: #0000ff;"><span style="color: #0000ff;">&nbsp;&nbsp;&nbsp; if</span></span> (<span style="color: #6f008a;"><span style="color: #6f008a;">SUCCEEDED</span></span>(hrResult))</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">&nbsp;&nbsp; {</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hrResult = CoAllowSetForegroundWindow(</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; spAppActivationManager,</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;"><span style="color: #6f008a;"><span style="color: #6f008a;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NULL</span></span>);</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;"><span style="color: #0000ff;"><span style="color: #0000ff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if</span></span> (<span style="color: #6f008a;"><span style="color: #6f008a;">SUCCEEDED</span></span>(hrResult))</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hrResult = spAppActivationManager-&gt;ActivateApplication(</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;"><span style="color: #808080;"><span style="color: #808080;">&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; strAppUserModelId</span></span>,</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;"><span style="color: #6f008a;"><span style="color: #6f008a;">&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; NULL</span></span>,</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;"><span style="color: #2f4f4f;"><span style="color: #2f4f4f;">&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; AO_NONE</span></span>,</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;"><span style="color: #808080;"><span style="color: #808080;">&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; pdwProcessId</span></span>);</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">&nbsp; }</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;"><span style="color: #0000ff;"><span style="color: #0000ff;">return</span></span> hrResult;</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">}</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">**********************************************************************************************************************************</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">***************Managed Code ********************************************************************</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;"><span style="color: #0000ff;"><span style="color: #0000ff;">class </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">Program</span></span></span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">{</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;"><span style="color: #0000ff;"><span style="color: #0000ff;">&nbsp;&nbsp;&nbsp; static </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">void</span></span> Main(<span style="color: #0000ff;"><span style="color: #0000ff;">string</span></span>[] args)</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;"><span style="color: #0000ff;"><span style="color: #0000ff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int</span></span> processId;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;"><span style="color: #2b91af;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Console</span></span>.WriteLine(<span style="color: #2b91af;"><span style="color: #2b91af;">PlatformInvokeTest</span></span>.LaunchApp(<span style="color: #a31515;"><span style="color: #a31515;">@"Microsoft.BingTravel_8wekyb3d8bbwe!AppexTravel"</span></span>,&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;"><span style="color: #0000ff;">out</span></span> processId));&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;"><span style="color: #2b91af;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Console</span></span>.WriteLine(processId);</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">&nbsp;&nbsp;&nbsp;}</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">&nbsp;}&nbsp;&nbsp;&nbsp;</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">class </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PlatformInvokeTest</span></span></span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">{</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<span style="color: #2b91af;"><span style="color: #2b91af;">DllImport</span></span>(<span style="color: #a31515;"><span style="color: #a31515;">"MAF32.dll"</span></span>)]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;"><span style="color: #0000ff;"><span style="color: #0000ff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">static </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">extern </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">int</span></span> LaunchApp(</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; [<span style="color: #2b91af;"><span style="color: #2b91af;">In</span></span>, <span style="color: #2b91af;"><span style="color: #2b91af;">MarshalAs</span></span>(<span style="color: #2b91af;"><span style="color: #2b91af;">UnmanagedType</span></span>.LPWStr)]<span style="color: #0000ff;"><span style="color: #0000ff;">string</span></span> processIdentifier,</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;[<span style="color: #2b91af;"><span style="color: #2b91af;">Out</span></span>, <span style="color: #2b91af;"><span style="color: #2b91af;">MarshalAs</span></span>(<span style="color: #2b91af;"><span style="color: #2b91af;">UnmanagedType</span></span>.U4)] <span style="color: #0000ff;"><span style="color: #0000ff;">out</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">int</span></span> processId);</span></p>
<p><span style="font-family: comic sans ms,sans-serif; font-size: medium;">&nbsp;}</span></p>
<p><br /><span style="font-family: comic sans ms,sans-serif; font-size: medium;">Similar code can then be used to perform other application level activities from managed code.</span></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Semantic Zoom only supports GridView and ListView?</title>
      <link>https://docs.microsoft.com/archive/blogs/going_metro/semantic-zoom-only-supports-gridview-and-listview</link>
      <pubDate>Wed, 18 Jul 2012 14:45:02 GMT</pubDate>
      <dc:creator><![CDATA[Venkata Siva Prasad Vitakula]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/going_metro/2012/07/18/semantic-zoom-only-supports-gridview-and-listview/</guid>
      <description><![CDATA[Many people have been asking why semantic zoom is limited while using GridView and ListView. The...]]></description>
      <content:encoded><![CDATA[<p>Many people have been asking why semantic zoom is limited while using GridView and ListView. The answer is, it is not limited to GridView and ListView. These are the only 2 out of box controls that support semantic zoom. And these are the 2 controls the make the most sense for me.What makes GridView and ListView capable of supporting Semantic zoom? Both GridView &amp; ListView inherit from ListViewBase.ListViewBase implements an interface called ISemanticZoomInformation.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/3884.1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/3884.1.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/3884.1.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/3884.1.png" border="0" /></a>&nbsp;&nbsp;<br />&nbsp;&nbsp;</p>
<p>So as long as the control implements this interface, it can be used with in the Semantic zoom. I have played with this interface and was able to come up with a basic implementation.</p>
<p>Please note that the below scenario is a hypothetical example. The example doesn&rsquo;t follow the guidelines for Semantic zoom and is a very crude implementation of ISemanticZoomInformation. But I am doing this just to demonstrate that other controls can be extended to use Semantic zoom.The hypothetical scenario is as follows.</p>
<p>I have a stack panel of buttons. In Zoomed in view I want to display the items Vertical orientation and in the Zoomed out view I want to display them in horizontal orientation.</p>
<ol></ol>
<ul>
<li>Create a custom stack panel which implements ISemanticZoomInformation.&nbsp;&nbsp;</li>
</ul>
<p>&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/52/44/2553.3.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/2553.3.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/2553.3.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/2553.3.png" border="0" /></a></p>
<p>Right click on ISemanticZoomInformation and use the &ldquo;Implement interface&rdquo; menu item to implement the interface.This adds the following methods and properties to your class. These methods and<br />Properties are wired to throw exceptions when they are called by default.&nbsp;</p>
<p><b>ISemanticZoomInformation Methods:&nbsp;</b><b>&nbsp;</b></p>
<p>Following ISemanticZoomInformation methods need to be implemented. For this basic example we don&rsquo;t need to put any code in these methods. Just comment out the line which throws the &ldquo;NotImplementedException&rdquo;</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/4274.4.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/4274.4.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/4274.4.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/4274.4.png" border="0" /></a></p>
<p>&nbsp;</p>
<p><b>ISemanticZoomInformation Properties:&nbsp;</b><b>&nbsp;</b></p>
<p>&nbsp;Following properties have to be implemented.&nbsp; Comment the lines which throw the exception. Change the code as follows.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/5807.5.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/5807.5.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/5807.5.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/5807.5.png" border="0" /></a><b>&nbsp;</b></p>
<p>That&rsquo;s it, now our Stack Panel is ready to be used with in the Semantic Zoom control.&nbsp;Use the above Stack Panel with in the Semantic Zoom control.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/6443.2.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/6443.2.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/6443.2.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/6443.2.png" border="0" /></a><br />&nbsp;</p>
<p>Build and Run.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/4212.6.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/4212.6.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/4212.6.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/4212.6.png" border="0" /></a><br />&nbsp;</p>
<p>Personally I don&rsquo;t see a reason for doing something like this in the real world. Semantic zoom is not meant for something like this. Thoroughly understand the purpose of Semantic Zoom before using it or before customizing<br />other controls to support Semantic zoom. Guidelines for Semantic Zoom&nbsp;can be found at.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh465319.aspx">http://msdn.microsoft.com/en-us/library/windows/apps/hh465319.aspx</a></p>
<p>&nbsp;</p>
<p>Hope this helps.</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Drag and Drop within a grouped grid view</title>
      <link>https://docs.microsoft.com/archive/blogs/going_metro/drag-and-drop-within-a-grouped-grid-view</link>
      <pubDate>Sun, 15 Jul 2012 23:45:51 GMT</pubDate>
      <dc:creator><![CDATA[Venkata Siva Prasad Vitakula]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/going_metro/2012/07/15/drag-and-drop-within-a-grouped-grid-view/</guid>
      <description><![CDATA[I was working on my app and I had to implement functionality to Drag and Drop items between...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: verdana,geneva; font-size: small;">I was working on my app and I had to implement functionality to Drag and Drop items between different groups of a Group Grid View.&nbsp; Out of box reordering (drag and drop) doesn&rsquo;t seem to work with Grouped Grid Views. So I implemented my own.&nbsp;This is very crude solution, but meets my requirements.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">Below is a snapshot of sample data.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/0537.1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/0537.1.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/0537.1.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/0537.1.png" border="0" /></a></span><br />&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;">Let&rsquo;s start by taking a look at my Data Model. I have three classes.</span></p>
<ol>
<li>
<p><span style="font-family: verdana,geneva; font-size: small;">MyDataSource &ndash; Contains an ObservableCollection of Group objects. This will be source of the CollectionViewSource (This collection view source is in turn used as an ItemSource of the GridView)</span></p>
</li>
<li>
<p><span style="font-family: verdana,geneva; font-size: small;">MyGroup &ndash; This represents a Group in the grouped grid view. It contains a collection of Items.</span></p>
</li>
<li>
<p><span style="font-family: verdana,geneva; font-size: small;">MyItem - Represents the individual item in the GridView. MyItem has a reference (cross reference) back to the Group that its part of.</span></p>
</li>
</ol>&nbsp;
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/2364.2.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/2364.2.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/2364.2.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/2364.2.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/3122.3.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/3122.3.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/3122.3.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/3122.3.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/0131.4.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/0131.4.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/0131.4.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/0131.4.png" border="0" /></a></span><br />&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;">&nbsp;Set the Data Context of the Page to the collection of groups.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/8836.5.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/8836.5.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/8836.5.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/8836.5.png" border="0" /></a>&nbsp;</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">Set the <b>CanDragItems</b> property of the GridView to true. Also handle the event &ldquo;DragItemsStarting&rdquo;</span></p>
&nbsp;
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/4186.6.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/4186.6.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/4186.6.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/4186.6.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">While the GridView handles the initiation of dragging, I have implemented the Drop related code on the VariableSizedWrapGrid which handles the layout of the Group&rsquo;s items.On the GroupStyle panel&rsquo;s VariableSizedWrapGrid, set<b> Allow Drop</b> property to true &nbsp;and also handle the <b>Drop</b> event.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/1856.7.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/1856.7.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/1856.7.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/1856.7.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">When the user starts dragging an item, the Grid view&rsquo;s &ldquo;DragItemsStarting&rdquo; event is raised. Within the even handler, I am saving a reference to the Dragged Item.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/6763.8.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/6763.8.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/6763.8.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/6763.8.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">When the user Drop&rsquo;s the item on another Group of items (wrapped in the VariableSizedWrapGrid) the wrapped grid&rsquo;s <b>Drop </b>event is raised. Within the Drop item, I have added logic to</span><br /><span style="font-family: verdana,geneva; font-size: small;">remove the item from the source group and then add it to the Target group. I am directly changing the source Groups and letting change notification do the rearranging.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/0410.9.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/0410.9.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/0410.9.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/0410.9.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">&nbsp;And this did the job for me.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/0272.10.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/0272.10.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/0272.10.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/0272.10.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">&nbsp;I will continue to work on improving the experience and try to find better options of implementing this. I will post a final update once the refinements are made. If you have suggestion or ideas, leave a comment. I will try them out.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">Thanks</span></p>]]></content:encoded>
    </item>
    <item>
      <title>Grid View Similar to People app's contacts page.</title>
      <link>https://docs.microsoft.com/archive/blogs/going_metro/grid-view-similar-to-people-apps-contacts-page</link>
      <pubDate>Sun, 15 Jul 2012 04:20:53 GMT</pubDate>
      <dc:creator><![CDATA[Venkata Siva Prasad Vitakula]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/going_metro/2012/07/15/grid-view-similar-to-people-apps-contacts-page/</guid>
      <description><![CDATA[Like everyone else I recently started learning to make Metro apps using C#. The best way to learn is...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: verdana,geneva; font-size: small;">Like everyone else I recently started learning to make Metro apps using C#. The best way to learn is by practice. People have been asking (in the forums) about how to make</span><br /><span style="font-family: verdana,geneva; font-size: small;">a Grid View similar to the People app. I decided to take a shot at it. Below blog post documents my attempt to create a Grid View similar to that of People App.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><b>Note:</b> I am not aware of the exact method used to create the&nbsp;contact view&nbsp;in people app. The below is the method&nbsp;that I used for&nbsp;creating a similar experience.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">&nbsp;The people apps Grid view has the following features</span></p>
<ol>
<li>
<p><span style="font-family: verdana,geneva; font-size: small;">Contacts are grouped by the first character.</span></p>
</li>
<li>
<p><span style="font-family: verdana,geneva; font-size: small;">The items flow from one group (Based on First Character) to another Group. The flow is continuous without any gaps.</span></p>
</li>
</ol>
<p><span style="font-family: verdana,geneva; font-size: small;">My first instinct was to use a &ldquo;<b>Grouped List View". However</b> I soon realized that this doesn&rsquo;t give the desired effect. There were huge gaps between items belonging to different groups, especially if the number</span><br /><span style="font-family: verdana,geneva; font-size: small;">of items within each group varies drastically.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">I decided to use a normal Grid view instead of a grouped view. I created a list of Comic characters to use as a source to my list view. The list contains the first characters, along with the actual names.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/2654.1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/2654.1.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/2654.1.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/2654.1.png" border="0" /></a></span></p>
<ol></ol>
<p><br /><span style="font-family: verdana,geneva; font-size: small;">Set the Item Source property of the Grid View to the above list.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/2318.2.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/2318.2.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/2318.2.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/2318.2.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">Now when displaying the Grid View, we have to use different Item Templates (Item Templates are used to specify the visualization of the data objects).</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">I created a Data Template called &ldquo;FirstCharacterTemplate&rdquo; to use while displaying the Characters. I have also created another template called the &ldquo;NameTemplate&rdquo; for displaying the actual names.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/6545.3.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/6545.3.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/6545.3.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/6545.3.png" border="0" /></a></span></p>
<p>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/5086.4.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/5086.4.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/5086.4.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/5086.4.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">Once the templates are defined, we need to tie the above templates to the appropriate entries. For instance, if the string is a single character string, the FirstCharacterTemplate needs to be used. This can be done by using an ItemTemplateSelector.</span></p>
<ul>
<li>
<p><span style="font-family: verdana,geneva; font-size: small;">Create a new class called ContactListTemplateSelector and derive it from the DataTemplateSelector class.</span></p>
</li>
<li>
<p><span style="font-family: verdana,geneva; font-size: small;">Override the method &ldquo;SelectTemplateCore&rdquo;. The method takes 2 parameters. The first parameter is the object that is being displayed (In our case the string) and the second parameter is Dependency object. Within this method check the length of the data. Based on the length of the data, return the appropriate Data Template.</span></p>
</li>
</ul>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/8078.5.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/8078.5.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/8078.5.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/8078.5.png" border="0" /></a></span></p>
<ul></ul>
<p><span style="font-family: verdana,geneva; font-size: small;">Add an instance of this DataTemplateSelector to the page&rsquo;s resource section.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/7384.6.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/7384.6.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/7384.6.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/7384.6.png" border="0" /></a></span></p>
<p>&nbsp;<br /><span style="font-family: verdana,geneva; font-size: small;">Associate this DataTemplateSelector to the Grid view using the ItemTemplateSelector property.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/5621.7.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/5621.7.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/5621.7.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/5621.7.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">&nbsp;One more thing left to do. Even though we used different data templates to display the single character string and the names, the type of container for these items remains the same. In this case the container happens to be a GridViewItem. Because of this, the user will still be able to click on the &ldquo;Single Character&rdquo; item. Even though nothing happens, the click animation is still shown. We don&rsquo;t want this to happen (as designed in the people app).&nbsp;</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">This can be done by setting the GridViewItem&rsquo;s (only the Single Character items) IsHitTestVisible property to false.&nbsp;One way of doing this is to use <b>ContainerStyleSelector </b>and set different Container styles based on the data (steps similar to the ones used with ItemTemplateSelector)</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">&nbsp;I have used a different way of doing this. Remember our ContactListTemplateSelector class, where we have overridden the &ldquo;SelectTemplateCore&rdquo; method. The second parameter to that method is the container&nbsp; In our case GridViewItem). We can set the IsHitTestVisible property to false (In case of a single character item) right here.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/3603.8.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/3603.8.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/3603.8.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/3603.8.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">We&nbsp;are now ready to run our app.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/8233.9.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/8233.9.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/8233.9.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/8233.9.png" 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/52/44/2045.9.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/2045.9.png"></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">Pretty close.&nbsp;Hope this helps.</span></p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Semantic Zoom In Windows 8 Metro Applications</title>
      <link>https://docs.microsoft.com/archive/blogs/going_metro/semantic-zoom-in-windows-8-metro-applications</link>
      <pubDate>Tue, 03 Jul 2012 17:11:05 GMT</pubDate>
      <dc:creator><![CDATA[Venkata Siva Prasad Vitakula]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/going_metro/2012/07/03/semantic-zoom-in-windows-8-metro-applications/</guid>
      <description><![CDATA[&nbsp;
Semantic Zoom

Semantic zoom is a technique used for presenting and navigating large...]]></description>
      <content:encoded><![CDATA[<div>
<p align="center">&nbsp;</p>
<p align="center"><span style="font-family: verdana,geneva; font-size: small;">Semantic Zoom</span></p>
</div>
<p><span style="font-family: verdana,geneva; font-size: small;">Semantic </span><span style="font-family: verdana,geneva; font-size: small;">zoom is a technique used for presenting and navigating large data sets with in </span><span style="font-family: verdana,geneva; font-size: small;">single view.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><b>Problem:</b></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">Consider </span><span style="font-family: verdana,geneva; font-size: small;">the app &ldquo;Cars 2 Go&rdquo;. </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/52/44/2620.Picture1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/2620.Picture1.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/2620.Picture1.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/2620.Picture1.png" border="0" /></a><br />&nbsp;<br /> <span style="font-family: verdana,geneva; font-size: small;">The </span><span style="font-family: verdana,geneva; font-size: small;">Group details page lists huge number of car models, grouped by their </span><span style="font-family: verdana,geneva; font-size: small;">manufacturer in alphabetical order. Take a look at the scroll bar at the bottom </span><span style="font-family: verdana,geneva; font-size: small;">of the view and just imagine the amount of scrolling/panning that is needed to </span><span style="font-family: verdana,geneva; font-size: small;">view cars manufactured by &ldquo;<b>Tesla</b>&rdquo;. &nbsp;Panning and Scrolling are great for small sets </span><span style="font-family: verdana,geneva; font-size: small;">of data; however navigation becomes cumbersome for huge data sets as above. </span><span style="font-family: verdana,geneva; font-size: small;">Semantic zoom is tailored made for these situations.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">Semantic&nbsp;Z</span><span style="font-family: verdana,geneva; font-size: small;">oom uses two zoom levels</span></p>
<ol>
<li><span style="font-family: verdana,geneva; font-size: small;">Zoomed </span><span style="font-family: verdana,geneva; font-size: small;">In view / Low level View. Above Image is an example of a Zoomed in view, where all </span><span style="font-family: verdana,geneva; font-size: small;">the manufactures and models are displayed.</span></li>
<li><span style="font-family: verdana,geneva; font-size: small;">Zoomed </span><span style="font-family: verdana,geneva; font-size: small;">Out view /High level View. Below image&nbsp;is an example of a Zoomed out view, </span><span style="font-family: verdana,geneva; font-size: small;">where only the manufacturers are displayed.</span></li>
</ol>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/7144.Picture2.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/7144.Picture2.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/7144.Picture2.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/7144.Picture2.png" border="0" /></a></span></p>
<span style="font-family: verdana,geneva; font-size: small;"></span>
<p><span style="font-family: verdana,geneva; font-size: small;">Now all </span><span style="font-family: verdana,geneva; font-size: small;">that the user has to do is click on the manufacturer that he likes, and he will </span><span style="font-family: verdana,geneva; font-size: small;">be taken back to the zoomed in view, and will be automatically panned/scrolled </span><span style="font-family: verdana,geneva; font-size: small;">to the tapped/selected point.</span><span style="font-family: verdana,geneva; font-size: small;">Consider </span><span style="font-family: verdana,geneva; font-size: small;">for example, the user clicks on &ldquo;<b>Saab</b>&rdquo; </span><span style="font-family: verdana,geneva; font-size: small;">in the Zoomed out view. The user will be zoomed in, and will be automatically </span><span style="font-family: verdana,geneva; font-size: small;">panned to <b>Saab</b>. This automatic </span><span style="font-family: verdana,geneva; font-size: small;">panning is handled by the Semantic Zoom control internally and happens when the </span><span style="font-family: verdana,geneva; font-size: small;">user taps or selects an item in the Zoomed out view. This is also referred to </span><span style="font-family: verdana,geneva; font-size: small;">as &ldquo;<b>Scroll Jump</b>&rdquo; in MSDN.</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/52/44/7080.Picture3.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/7080.Picture3.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/7080.Picture3.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/7080.Picture3.png" border="0" /></a><br /><span style="font-family: verdana,geneva; font-size: small;"></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">To </span><span style="font-family: verdana,geneva; font-size: small;">begin with, I have a Data Source which returns a collection of Make objects </span><span style="font-family: verdana,geneva; font-size: small;">(manufactures). Each Make object contains a list of Model (car models &ndash; exposed </span><span style="font-family: verdana,geneva; font-size: small;">using the property AllModels) objects. I started with the default grid template </span><span style="font-family: verdana,geneva; font-size: small;">which comes out of the box. </span><span style="font-family: verdana,geneva; font-size: small;">The Grouped </span><span style="font-family: verdana,geneva; font-size: small;">Items page will be my entry point and will act as my high level view. The </span><span style="font-family: verdana,geneva; font-size: small;">grouped items page has a</span></p>
<ol>
<li><span style="font-family: verdana,geneva; font-size: small;">Grouped </span><span style="font-family: verdana,geneva; font-size: small;">Collection View source.</span></li>
<li><span style="font-family: verdana,geneva; font-size: small;">Grid </span><span style="font-family: verdana,geneva; font-size: small;">view which displays the contents of the Grouped collection view source.</span></li>
</ol>
<p><span style="font-family: verdana,geneva; font-size: small;">All </span><span style="font-family: verdana,geneva; font-size: small;">I need to do to create a Zoomed In view is to hook up the Collection View </span><span style="font-family: verdana,geneva; font-size: small;">Source to the collection.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/7282.Picture4.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/7282.Picture4.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/7282.Picture4.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/7282.Picture4.png" border="0" /></a></span></p>
<p><br />&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/0383.Picture5.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/0383.Picture5.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/0383.Picture5.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/0383.Picture5.png" border="0" /></a></p>
<p align="center"><span style="font-family: verdana,geneva; font-size: small;"></span>&nbsp;</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/3513.Picture6.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/3513.Picture6.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/3513.Picture6.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/3513.Picture6.png" border="0" /></a></p>
<p>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;">Now </span><span style="font-family: verdana,geneva; font-size: small;">we have a zoomed in view, which will display all the models, grouped by their </span><span style="font-family: verdana,geneva; font-size: small;">manufactures. In order to tell the runtime that this is the Zoomed in view, do </span><span style="font-family: verdana,geneva; font-size: small;">the following.</span></p>
<ol>
<li><span style="font-family: verdana,geneva; font-size: small;">Add </span><span style="font-family: verdana,geneva; font-size: small;">a Semantic zoom control to the Xaml, and define Zoomed In and Zoomed Out views </span><span style="font-family: verdana,geneva; font-size: small;">as follows.</span></li>
</ol>
<p><span style="font-family: verdana,geneva; font-size: small;">&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/52/44/8780.Picture7.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/8780.Picture7.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/8780.Picture7.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/8780.Picture7.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp; 2. </span><span style="font-family: verdana,geneva; font-size: small;">Now </span><span style="font-family: verdana,geneva; font-size: small;">make the above Grid View, part of the ZoomedInView definition as below</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"></span>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;">&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/52/44/6644.Picture8.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/6644.Picture8.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/6644.Picture8.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/6644.Picture8.png" border="0" /></a></span></p>
<ol></ol>
<p><span style="font-family: verdana,geneva; font-size: small;">Now </span><span style="font-family: verdana,geneva; font-size: small;">it is time to define the Zoomed out view. Following are the mistakes that I </span><span style="font-family: verdana,geneva; font-size: small;">made.</span></p>
<ol>
<li><span style="font-family: verdana,geneva; font-size: small;">When </span><span style="font-family: verdana,geneva; font-size: small;">I did this the first time, I just copied the initial grid view and removed the Group </span><span style="font-family: verdana,geneva; font-size: small;">Style and made it part of the Zoomed out View. Now both the grid views (one </span><span style="font-family: verdana,geneva; font-size: small;">with Group Style and the other without Group Style) have the same grouped </span><span style="font-family: verdana,geneva; font-size: small;">collection view source.</span></li>
</ol>
<p><span style="font-family: verdana,geneva; font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Also </span><span style="font-family: verdana,geneva; font-size: small;">remember we need to keep track of the selected group between the views in order </span><span style="font-family: verdana,geneva; font-size: small;">to support Scroll Jump. Having the same collection view source as the Items </span><span style="font-family: verdana,geneva; font-size: small;">Source for both the views should help. </span><span style="font-family: verdana,geneva; font-size: small;">But </span><span style="font-family: verdana,geneva; font-size: small;">there is one small problem. The CollectionViewSource is grouped by </span><span style="font-family: verdana,geneva; font-size: small;">Manufacturer. So it basically behaves as a list of models (grouped by manufacturers). </span><span style="font-family: verdana,geneva; font-size: small;">The first Grid view which defined Group Style knows how to display the data. The S</span><span style="font-family: verdana,geneva; font-size: small;">econd Grid View because of the absence of the Group Style is not aware of the </span><span style="font-family: verdana,geneva; font-size: small;">Grouping Context (that is manufacturer) and considers the CollectionViewSource </span><span style="font-family: verdana,geneva; font-size: small;">as a list of car models (without being aware&nbsp;of the manufacturers)</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; In </span><span style="font-family: verdana,geneva; font-size: small;">this scenario, the Zoom out view displays all the car models. We wanted it to </span><span style="font-family: verdana,geneva; font-size: small;">display only the manufacturers.</span></p>
<p><br />&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/8814.Picture9.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/8814.Picture9.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/8814.Picture9.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/8814.Picture9.png" border="0" /></a></p>
<p>&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/8311.Picture10.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/8311.Picture10.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/8311.Picture10.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/8311.Picture10.png" border="0" /></a></p>
<p>2.&nbsp; <span style="font-family: verdana,geneva; font-size: small;">After </span><span style="font-family: verdana,geneva; font-size: small;">the first failed attempt, I was thinking of setting the Data Context to the </span><span style="font-family: verdana,geneva; font-size: small;">collection of Makes and then binding the Zoomed out Grid View to that data </span><span style="font-family: verdana,geneva; font-size: small;">context. The Data Context is aware of only the top level collection </span><span style="font-family: verdana,geneva; font-size: small;">(manufacturers, not car models). This worked. My Zoomed Out view now shows a </span><span style="font-family: verdana,geneva; font-size: small;">list of manufacturers which is quiet small and can be displayed in a single </span><span style="font-family: verdana,geneva; font-size: small;">view.&nbsp; But there is a draw back. Because </span><span style="font-family: verdana,geneva; font-size: small;">both the Grid Views are pointing to different Sources (one pointing to CVS and </span><span style="font-family: verdana,geneva; font-size: small;">the other pointing to DC), current position cannot be tacked across the views. </span><span style="font-family: verdana,geneva; font-size: small;">This will break &ldquo;<b>Scroll Jump</b>&rdquo; functionality.</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/52/44/5618.Picture12.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/5618.Picture12.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/5618.Picture12.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/5618.Picture12.png" border="0" /></a></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/4527.Picture11.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/4527.Picture11.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/4527.Picture11.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/4527.Picture11.png" border="0" /></a>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;">After </span><span style="font-family: verdana,geneva; font-size: small;">a bit of researching I found that, The CollectionViewSource contains a Collection </span><span style="font-family: verdana,geneva; font-size: small;">View object. The Collection View defines a property called &ldquo;Collection Groups&rdquo; </span><span style="font-family: verdana,geneva; font-size: small;">which is a collection of grouping contexts (In our case Manufacturer/Make). So </span><span style="font-family: verdana,geneva; font-size: small;">we can bind the Zoom out view to the Collection groups (a list of manufacturers). </span><span style="font-family: verdana,geneva; font-size: small;">And because of this both the Zoom In and Zoom Out views can be bound to the </span><span style="font-family: verdana,geneva; font-size: small;">same collection view source (in different contexts), which means the current </span><span style="font-family: verdana,geneva; font-size: small;">position can be tracked and therefore &ldquo;Scroll Jump&rdquo; can be supported.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"></span>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/3733.Picture13.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/3733.Picture13.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/3733.Picture13.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/3733.Picture13.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"></span>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/7573.Picture14.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/7573.Picture14.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/7573.Picture14.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/7573.Picture14.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"></span>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/7457.Picture15.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/7457.Picture15.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/7457.Picture15.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/7457.Picture15.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"></span>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;"></span>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;">Its amazing how easy it is to implement Semantic zoom. Hope this helps.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"></span>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;">Thanks</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">Shiva.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"></span>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;"></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"></span></p>
<p></p>
<p>&nbsp;</p>
<p></p>
<p>&nbsp;</p>
<p></p>]]></content:encoded>
    </item>
    <item>
      <title>Working with Streams: Creating RandomAccessStreamReference from Image downloaded from Web.</title>
      <link>https://docs.microsoft.com/archive/blogs/going_metro/working-with-streams-creating-randomaccessstreamreference-from-image-downloaded-from-web</link>
      <pubDate>Mon, 14 May 2012 16:39:00 GMT</pubDate>
      <dc:creator><![CDATA[Venkata Siva Prasad Vitakula]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/going_metro/2012/05/14/working-with-streams-creating-randomaccessstreamreference-from-image-downloaded-from-web/</guid>
      <description><![CDATA[I am currently writing my first windows 8 applications. One of the user scenario&rsquo;s was, to be...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: verdana,geneva; font-size: small;">I am currently writing my first windows 8 applications. One of the user scenario&rsquo;s was, to be download images from a website and to be able to share it with other apps using share contract. I had to spend quite a bit of time to figure out how to do this. I decided to put together a blog post with various samples on how to work with streams.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><b><span style="text-decoration: underline;">Scenario 1:</span>&nbsp; Download image as Bytes&nbsp;and convert into&nbsp;RandomAccessStreamReference.</b></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"> In order to share image data, we need object of type &ldquo;RandomAccessStreamReference&rdquo;.</span></p>
<ul>
<li><span style="font-family: verdana,geneva; font-size: small;">Download the image data using <b>HttpClient</b> class.</span></li>
</ul>
<ul>
<li><span style="font-family: verdana,geneva; font-size: small;">Write this data into <b>IRandomAccessStream. </b>There are a few WinRT classes which implement the IRandomAccessStream interface. I will use <b>InMemoryRandomAccessStream, </b>as I do not need to store the data in a file, an in memory stream should suffice. In order to write to the <b>InMemoryRandomAccessStream</b>, we need to </span><span style="font-family: verdana,geneva; font-size: small;">acquire it as a writable stream (<b>IOutputStream</b>) and then write to it using a <b>DataWriter </b>class.</span></li>
</ul>
<ul>
<li><span style="font-family: verdana,geneva; font-size: small;">Create the <b>RandomAccessStreamReference, </b>to be used to set the bitmap data for the share data package</span></li>
</ul>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/5100.Picture4.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/5100.Picture4.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/5100.Picture4.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/5100.Picture4.png" border="0" /></a>&nbsp;</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><b><span style="text-decoration: underline;">Scenario 2:</span> Download image from a website as a stream and create a RandomAccessStreamReference from it&nbsp;</b>&nbsp;</span></p>
<ul>
<li><span style="font-family: verdana,geneva; font-size: small;">Download the image as Stream. This returns a non seekable stream (this means we cannot read the size or length of the stream, during read operations.&nbsp;</span></li>
</ul>
<p><span style="font-family: verdana,geneva; font-size: small;"></span>&nbsp;</p>
<ul>
<li><span style="font-family: verdana,geneva; font-size: small;">Convert the Non Seekable stream into an IRandomAccessStream. I have created an extension method to do this .</span></li>
</ul>
<p><span style="font-family: verdana,geneva; font-size: small;"><b></b></span>&nbsp;</p>
<ul>
<li><span style="font-family: verdana,geneva; font-size: small;">Use the IRandomAccessStream and created the </span><span style="font-family: verdana,geneva; font-size: small;">RandomAccessStreamReference to set the bitmap data.</span></li>
</ul>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/7367.Picture5.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/7367.Picture5.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/7367.Picture5.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/7367.Picture5.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"></span>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/3515.Picture6.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/3515.Picture6.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/3515.Picture6.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/3515.Picture6.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"></span>&nbsp;</p>
<p>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;"><b></b></span>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Integrating With Windows 8 Share Charm - Long Running Shares - Multiple data providers</title>
      <link>https://docs.microsoft.com/archive/blogs/going_metro/integrating-with-windows-8-share-charm-long-running-shares-multiple-data-providers</link>
      <pubDate>Mon, 14 May 2012 16:10:27 GMT</pubDate>
      <dc:creator><![CDATA[Venkata Siva Prasad Vitakula]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/going_metro/2012/05/14/integrating-with-windows-8-share-charm-long-running-shares-multiple-data-providers/</guid>
      <description><![CDATA[In the previous blog post...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: verdana,geneva; font-size: small;">In the previous blog post <a href="http://blogs.msdn.com/b/going_metro/archive/2012/05/12/integrating-with-windows-8-share-charm-long-running-shares.aspx">http://blogs.msdn.com/b/going_metro/archive/2012/05/12/integrating-with-windows-8-share-charm-long-running-shares.aspx</a>&nbsp;we have seen how to handle&nbsp;long running shares. I wanted to share one more thing that I have observed. In the previous example, we have used the "<strong>SetDataProvider"</strong> method to specify the callback method which provides the Bitmap data . What if I have set other type of data like Text or Html which also require some asynchronous processing.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">Following is the implementation using the SetDataProvider method.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/5430.Picture1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/5430.Picture1.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/5430.Picture1.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/5430.Picture1.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">While I was extending my App, I realized that I also need to&nbsp;set the Text data. And my method which returns Text data is also an asynchronous method. I have already used the SetDataProvider method, to set the callback for getting bitmap data. So I was thinking how can I use the SetDataProvider method again to get the text data. Apparently we can use the SetDataProvider method multiple times for different format's. So I modified my code as follows.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/3312.Picture2.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/3312.Picture2.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/3312.Picture2.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/3312.Picture2.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"></span>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;"></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/3302.Picture3.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/3302.Picture3.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/3302.Picture3.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/3302.Picture3.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"></span>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;"></span></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Integrating With Windows 8 Share Charm - Long Running Shares.</title>
      <link>https://docs.microsoft.com/archive/blogs/going_metro/integrating-with-windows-8-share-charm-long-running-shares</link>
      <pubDate>Sat, 12 May 2012 15:08:00 GMT</pubDate>
      <dc:creator><![CDATA[Venkata Siva Prasad Vitakula]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/going_metro/2012/05/12/integrating-with-windows-8-share-charm-long-running-shares/</guid>
      <description><![CDATA[In the previous posts, I have explained about the Sharing and Receiving data.
1....]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: verdana,geneva; font-size: small;">In the previous posts, I have explained about the Sharing and Receiving data.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">1. <a href="http://blogs.msdn.com/b/going_metro/archive/2012/05/02/integrating-with-windows-8-share-charm-part-1-sharing-data.aspx">http://blogs.msdn.com/b/going_metro/archive/2012/05/02/integrating-with-windows-8-share-charm-part-1-sharing-data.aspx</a></span><br /><span style="font-family: verdana,geneva; font-size: small;">2. <a href="http://blogs.msdn.com/b/going_metro/archive/2012/05/03/integrating-with-windows-8-share-charm-part-1-receiving-data.aspx">http://blogs.msdn.com/b/going_metro/archive/2012/05/03/integrating-with-windows-8-share-charm-part-1-receiving-data.aspx</a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">In this post, I will discuss the concept of Long Running Shares, using a sample App called "Bing Images" .</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">The Bing Images app can be used to search for images. In the previous&nbsp;posts I wrote code to share the Uri of the image.&nbsp;I am going to implement functionality to be able to share the image along with the Url.</span><span style="font-family: verdana,geneva; font-size: small;">&nbsp;</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">Following is the code, I used to share the image .</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/7343.Picture1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/7343.Picture1.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/7343.Picture1.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/7343.Picture1.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">When I run the app and try to share the image, Win RT displays the message "<strong>Images Can't Share</strong>" as shown below.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/8322.Picture2.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/8322.Picture2.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/8322.Picture2.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/8322.Picture2.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"></span>&nbsp;</p>
<p><strong><span style="font-family: verdana,geneva; font-size: small;">Why is this ? </span></strong></p>
<p><span style="font-family: verdana,geneva; font-size: small;">This is because of the code we added to download the image for sharing. Note that we are using <strong>asynchronous</strong> methods and also using the "<strong>await</strong>" keyword to download the image.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">When the&nbsp;execution reaches an awaited&nbsp;asynchronous call which&nbsp;is not yet complete, it returns at that point. In our case, the method "Data Requested" handler returns before setting the contents of the data package, hence the message.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">However WinRT supports asynchronous sharing operations, by creating a <strong>Deferral</strong> (DataRequestDeferral) and waiting for it to complete. I modified my code, to obtain a deferral using the "<strong>DataRequest.GetDeferral</strong>" method and to call the "<strong>DataRequestDeferral.Complete"</strong>&nbsp; method once data content for the asynchronous share is ready.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/1351.Picture3.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/1351.Picture3.png"><img width="637" height="334" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/1351.Picture3.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/1351.Picture3.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">Now when we will be able to share the data with other apps.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/4186.Picture4.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/4186.Picture4.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/4186.Picture4.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/4186.Picture4.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><span style="font-size: medium;"><strong>Note :</strong></span> <span style="font-size: medium; background-color: #ffff00;">This method will only work if the asynchronous operation completes within <strong>200 mill seconds</strong>.</span></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"></span><span style="font-family: verdana,geneva; font-size: small;">In our case, some of the images were taking more than 200 mill seconds to download, and in those cases Sharing failed. WinRT provides another mechanism for handling such situations using a delegate (callback method).</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">We can define a call back delegate using the "SetDataProvider" method.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/5460.Picture5.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/5460.Picture5.png"><img width="669" height="193" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/5460.Picture5.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/5460.Picture5.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">Once the target app is selected in the sharing pane, the target app calls the Callback method. </span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">Within the callback method, I added the asynchronous download code.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/4505.Picture6.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/4505.Picture6.png"><img width="641" height="276" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/4505.Picture6.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/4505.Picture6.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"></span>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;"><strong>Note:</strong>&nbsp;<span style="background-color: #ffff00;">We still have to acquire a "Deferral"&nbsp; within the Callback method, and call the Complete method once the data is set </span></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">It got me thinking, why is this. In both the methods we acquired a deferral, but in the first method the asynchronous call should complete with-in 200 milli-seconds, but in the case of call back scenario, we do not have this restriction (200 MS).&nbsp;The secret lies in the <strong>DataRequest</strong> objects "<strong>Deadline</strong>" property.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">In both the scenario's I have set a break point and observed the DeadLine property.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">In first scenario, the Deadline (In our ex: it is 4:35:10) and the time at which sharing is initiated (In our ex it is 4:35:10),&nbsp;is the same to the second. This explains the 200 milli seconds restriction.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/1145.Picture7.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/1145.Picture7.png"><img width="755" height="277" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/1145.Picture7.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/1145.Picture7.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">In the second scenario (Callback), the requests Deadline is set&nbsp;to approximately&nbsp;6 minutes from the time the call back is initiated. In our example, the callback was initiated at 4:39:10, but the deadline was set to 4:45 (6 minutes).</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/2364.Picture8.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/2364.Picture8.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/2364.Picture8.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/2364.Picture8.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">So even in the case of the Callback, there is a limitation (from my experimentation, it is around 6 minutes). I think this is&nbsp;a good enough time for any share operations that I could think of.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"></span>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;">Hope this helps.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"></span>&nbsp;</p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>]]></content:encoded>
    </item>
    <item>
      <title>Integrating With Windows 8 Share Charm - Part 2: Receiving Data</title>
      <link>https://docs.microsoft.com/archive/blogs/going_metro/integrating-with-windows-8-share-charm-part-2-receiving-data</link>
      <pubDate>Thu, 03 May 2012 15:49:00 GMT</pubDate>
      <dc:creator><![CDATA[Venkata Siva Prasad Vitakula]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/going_metro/2012/05/03/integrating-with-windows-8-share-charm-part-2-receiving-data/</guid>
      <description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs...]]></description>
      <content:encoded><![CDATA[<h1><span style="color: #365f91;" color="#365f91"><span style="font-family: Cambria;" face="Cambria">&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Windows 8 Share Charm&nbsp;&ndash; Receiving Data</span></span>&nbsp;</h1>
<p><span style="font-family: verdana,geneva; font-size: small;">In the previous blog post <a href="http://blogs.msdn.com/b/going_metro/archive/2012/05/02/integrating-with-windows-8-share-charm-part-1-sharing-data.aspx"><span style="color: #0000ff;" color="#0000ff">Integrating with Windows 8 Share Charm - Sharing Data</span></a> &nbsp;I have discussed how to Share data from an App. In this blog post I will discuss on how to create the target app capable of receiving the shared data.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">I already created a simple application which will act as the target application. In order to enable it to receive shared data, the following needs to be done.</span></p>
<ol>
<li><span style="font-family: verdana,geneva; font-size: small;">Mark this app as a share target, by adding the share target declaration in Package.appxmanifest file .</span></li>
</ol>
<p><span style="font-family: verdana,geneva; font-size: small;">&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/52/44/6136.Pic1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/6136.Pic1.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/6136.Pic1.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/6136.Pic1.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp; 2.&nbsp; Add the supported file types. We can specify specific file types or we can choose to support all the file types. Since our Images app is sharing only URI data, I am adding only the URI type to the supported types.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">&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/52/44/4532.Pic2.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/4532.Pic2.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/4532.Pic2.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/4532.Pic2.png" border="0" /></a></span></p>
<p>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;">3. Add a new page to the app which will be activated, when this app is chosen in the share pane. I have added a Web View to this page to display the content of the received URL.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/1715.Pic3.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/1715.Pic3.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/1715.Pic3.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/1715.Pic3.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">4. Override the applications &ldquo;OnShareTargetActivated&rdquo; method. The OnShareTargetActivated method is called when the application is chosen in the share pane.</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/7380.Pic4.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/7380.Pic4.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/7380.Pic4.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/7380.Pic4.png" border="0" /></a></p>
<p>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;">Within the OnShareTargetActivated method, I am instantiating the sharing page, and calling the Activate method of the share page and passing it the &ldquo;ShareTargetActivateEventArgs&rdquo; object as the parameter.</span></p>
<p>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;">5. In the Activate method, write code to retrieve the Uri from the &ldquo;ShareTargetActivateEventArgs&rdquo; object. For every Set method used to set the data, there is a Get method to retrieve the data. If you remember in our source app I used the SetUri method to set the uri content of the data packet. In order to retrieve the uri we use the <b>GetUriAsync</b> method as shown below.</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/2526.Pic5.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/2526.Pic5.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/2526.Pic5.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/2526.Pic5.png" border="0" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;"><b>Note:</b> In this app I am just displaying the received data. This can be extended to work with the received data. For example, I can write code to save this image within the target app .</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">Our target app is now ready to receive Uri data. When the user shares (using the share charm), our sample target application is listed under the list available applications.</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/52/44/6840.Pic6.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/6840.Pic6.png"><img width="416" height="301" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/6840.Pic6.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/6840.Pic6.png" border="0" /></a></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/3566.Pic7.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/3566.Pic7.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/3566.Pic7.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/3566.Pic7.png" border="0" /></a></p>
<p>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;">Visual studio provides a &ldquo;Share Contract&rdquo; template which performs steps 1 to 5 for us. We just need to update the code within Activate method that is generated and modify the generated share UI to our needs.</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/52/44/7875.Pic8.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/7875.Pic8.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/7875.Pic8.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/7875.Pic8.png" border="0" /></a></p>
<p><span style="font-family: verdana,geneva; font-size: small;">This will generate a default share page Xaml and code behind (with a default activate method). The default share UI contains elements to display Title, Image and Description. The default share UI also contains &ldquo;Share&rdquo; button which can be used to process the Shared data.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/7848.Pic9.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/7848.Pic9.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/7848.Pic9.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/7848.Pic9.png" border="0" /></a></span></p>
<p></p>
<p><span style="font-family: verdana,geneva; font-size: small;">Also the Share target declaration is automatically added Package.appxmanifest. However we still have to add Uri data type to the list of supported types.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">Let us replace the Xaml with the Xaml used in the previous example and add a Share button to it. Also I am replacing the logic in the &ldquo;Activate&rdquo; method, with the code used in previous example.<b> </b></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">We are ready to run the Images app once again and share.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/8446.Pic10.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/8446.Pic10.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/8446.Pic10.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/8446.Pic10.png" border="0" /></a></span></p>
<p>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;">Until now we are just displaying the shared content, I am going to add some code to handle the process the shared data. Before we start the processing we have to indicate to WinRT that the share operation has started by calling the ShareOperation's Report Started method, and once done we have to indicate to WinRT the operation is completed by calling the Report Completed method .</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/52/44/5340.Pic11.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/5340.Pic11.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/5340.Pic11.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/5340.Pic11.png" border="0" /></a></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><b>Note :</b></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">The&nbsp; share UI is automatically dismissed when the share operation is reported as completed or an error is reported .</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">In case there is an exception, I am calling the ReportError method, which immediately closes the share pane and throws an error popup as shown below .</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/52/44/7002.Pic12.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/7002.Pic12.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/7002.Pic12.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/7002.Pic12.png" border="0" /></a></p>
<p><span style="font-family: verdana,geneva; font-size: small;">When this popup is clicked, another page opens which displays the actual error message.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/2678.Pic13.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/2678.Pic13.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/2678.Pic13.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/2678.Pic13.png" border="0" /></a></span></p>
<p>&nbsp;</p>
<p>In the next blog post I will implement Quick links and deferrals</p>
<p><span style="font-family: verdana,geneva; font-size: small;"><span face="Times New Roman" size="3">&nbsp;</span></span></p>]]></content:encoded>
    </item>
    <item>
      <title>Integrating With Windows 8 Share Charm - Part 1: Sharing Data</title>
      <link>https://docs.microsoft.com/archive/blogs/going_metro/integrating-with-windows-8-share-charm-part-1-sharing-data</link>
      <pubDate>Tue, 01 May 2012 17:31:00 GMT</pubDate>
      <dc:creator><![CDATA[Venkata Siva Prasad Vitakula]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/going_metro/2012/05/01/integrating-with-windows-8-share-charm-part-1-sharing-data/</guid>
      <description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n...]]></description>
      <content:encoded><![CDATA[<p></p>
<h1><span style="color: #365f91;" color="#365f91"><span style="font-family: Cambria;" face="Cambria">&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;&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;&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Windows 8 Share Charm&nbsp;&ndash; Sharing Data</span></span></h1>
<p><span style="font-family: verdana,geneva; font-size: small;">This&nbsp;blog post describes the process&nbsp;of implementing sharing in Windows 8. Windows 8 share charms lets the users share content from within the app with other people or apps, and receive shared content. Below is a snapshot of the Images App that I will be using to demonstrate. The app uses &ldquo;Bing Image Search&rdquo;&nbsp;API to search for images based on the keyword provided by the user.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/2727.Pic1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/2727.Pic1.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/2727.Pic1.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/2727.Pic1.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">There are 2 parts to sharing content. One is to be able to share content with other apps and the other is the ability to receive content from other applications. I will implement the sharing logic with in the Bing Images app, and will create another target app to demonstrate how to receive the shared content. In this blog post I will only discuss the, Sharing part of the application.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">When the user selects an image, it is displayed in its full view as shown below.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/6735.Pic2.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/6735.Pic2.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/6735.Pic2.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/6735.Pic2.png" border="0" /></a></span></p>
<p>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;">Within this view, I want to enable the user, to share this image with other apps.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">There is a static class called <b>DataTransferManager</b> that allows apps to initiate sharing operations. Within the constructor of the full view page, get the reference to the DataTransferManager using the static method <b>GetForCurrentView </b>and register for the<b> DataRequested </b>event.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/7652.Pic3.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/7652.Pic3.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/7652.Pic3.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/7652.Pic3.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><b>Pitfalls:</b></span></p>
<ol>
<li><span style="font-family: verdana,geneva; font-size: small;">The method DataTransferManager.GetForCurrentView returns the reference to the DTM of the Window, not the page that is currently loaded within the Window. This will result in a situation, where sharing can be initiated from within any page. For instance once the user opens the image in FullImageView (for the first time) and then goes back to Main page, he will still be able to initiate sharing (from the Main page) even though our intention was to allow sharing &nbsp;only in the FullImageView.</span></li>
<li><span style="font-family: verdana,geneva; font-size: small;">The second pitfall is that every time the user navigated to the FullImageView the constructor gets called and within the constructor we are registering to the <b>DataRequested </b>event. Everything is good when the user navigates to the FullImageView, but every subsequent navigation to the FullImageView will result in an exception, as shown below.</span></li>
</ol>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/8666.Pic4.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/8666.Pic4.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/8666.Pic4.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/8666.Pic4.png" border="0" /></a></span></p>
<p></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><b>Solution:</b></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">One way to solve these problems is to unregister the DataRequested event, when we navigate away from the FullImageView by overriding the FullImageView&rsquo;s <b>OnNavigatedFrom</b> method as shown below.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/4578.Pic5.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/4578.Pic5.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/4578.Pic5.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/4578.Pic5.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">The DataRequested event that we have registered to is called whenever the Share contract is selected. Within the event handler we need to write logic to share the data. The <b>DataRequestedEventArgs object</b> passed to the event handler has the property called <b>Request. </b>The <b>request</b> property contains a <a href="http://msdn.microsoft.com/en-us/library/windows/apps/windows.applicationmodel.datatransfer.datarequest.aspx"><b>Data</b></a> property of type DataPackage that can be used to share data with other Apps. The DataPackage can contain various types Data including Text, URI, Bitmap, HtmlText etc. These can be set using the DataPackage classes &ldquo;<b>Set</b>&rdquo; methods.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/5164.Pic6.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/5164.Pic6.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/5164.Pic6.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/5164.Pic6.png" border="0" /></a></span></p>
<p></p>
<p><span style="font-family: verdana,geneva; font-size: small;">For this example,&nbsp;we will set only&nbsp;the Uri content.&nbsp;In the DataRequested event handler, set the Uri content using the <strong>SetUri</strong> method.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/1781.Pic9.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/1781.Pic9.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/1781.Pic9.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/1781.Pic9.png" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">Now we are ready to share data, by clicking<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/2656.Pic7.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/2656.Pic7.png"></a> the share charm, when in the FullPageView.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/4377.Pic7.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/4377.Pic7.png"><img width="375" height="355" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/4377.Pic7.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/4377.Pic7.png" border="0" /></a></span><br />&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;">Windows RT returned the mail app only. This is because among the applications currently on the system, Mail is the only app which supports Uri data. If we supported other types of data like Text, Bitmap, HtmlContent then there might be more applications in the list. In short it is a good practice to share as many types of data as possible. When Mail app is selected, the Mail app will be activated. The logic for using the data that we have shared is implemented within the target app, in our case the mail app.<span size="3"><span face="Calibri"> </span></span></span></p>
<p><span style="font-family: verdana,geneva; font-size: small;" size="3"><span face="Calibri"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/4263.Pic8.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/4263.Pic8.png"><img alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/52/44/4263.Pic8.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-52-44/4263.Pic8.png" border="0" /></a></span></span></p>
<p></p>
<p><span style="font-family: verdana,geneva; font-size: small;" size="3"><span face="Calibri">In the next blog post I will discuss the logic for receiving the shared data.</span></span></p>
<p></p>]]></content:encoded>
    </item>
  </channel>
</rss>