<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Sidharth Sehgal's blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/ssehgal/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/ssehgal/feed.xml</link>
    <description>New technologies, Code samples, Automation examples, best practices.</description>
    <lastBuildDate>Fri, 10 Apr 2015 07:16:55 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Windows 8 App Fest live photoblog</title>
      <link>https://docs.microsoft.com/archive/blogs/ssehgal/windows-8-app-fest-live-photoblog</link>
      <pubDate>Fri, 21 Sep 2012 03:07:37 GMT</pubDate>
      <dc:creator><![CDATA[Sidharth Sehgal]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ssehgal/2012/09/21/windows-8-app-fest-live-photoblog/</guid>
      <description><![CDATA[]]></description>
      <content:encoded><![CDATA[<iframe height="128" src="https://skydrive.live.com/embed?cid=19BDE29726AD3219&amp;resid=19BDE29726AD3219%211509&amp;authkey=AC7NS9VQ3k9h13c" frameborder="0" width="165" scrolling="no"></iframe>]]></content:encoded>
    </item>
    <item>
      <title>Windows Phone Emulator frame rate counters</title>
      <link>https://docs.microsoft.com/archive/blogs/ssehgal/windows-phone-emulator-frame-rate-counters</link>
      <pubDate>Tue, 17 Jul 2012 04:40:36 GMT</pubDate>
      <dc:creator><![CDATA[Sidharth Sehgal]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ssehgal/2012/07/17/windows-phone-emulator-frame-rate-counters/</guid>
      <description><![CDATA[&#160;  Ever wondered what the red and white colored numbers on the top right side of Windows Phone...]]></description>
      <content:encoded><![CDATA[<p>&#160;</p>  <p>Ever wondered what the red and white colored numbers on the top right side of Windows Phone Emulator mean? Always wanted to make sense out of them or hide them? If yes, read on…</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/20/80/metablogapi/3527.image_52B363DC.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-20-80-metablogapi/3527.image_5F00_52B363DC.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/20/80/metablogapi/5277.image_thumb_69FE684D.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-20-80-metablogapi/5277.image_5F00_thumb_5F00_69FE684D.png" width="159" height="392" /></a></p>  <p>&#160;</p>  <p>These numbers are frame rate counters to monitor your application performance. The figure below (source: <a href="https://msdn.microsoft.com/en-us/library/gg588380(v=VS.92).aspx" target="_blank">MSDN</a>) shows what they mean</p>  <p><img title="Frame Rate Counters with Labels" alt="Frame Rate Counters with Labels" src="https://i.msdn.microsoft.com/dynimg/IC468501.png" /></p>  <p>&#160;</p>  <p>&#160;</p>  <table style="word-wrap: break-word; border-top: #bbb 1px solid; border-right: #bbb 1px solid; border-collapse: collapse; border-bottom: #bbb 1px solid; border-left: #bbb 1px solid" width="516"><tbody>     <tr style="vertical-align: top">       <th style="border-top: 1px solid; border-right: 1px solid; border-bottom: 1px solid; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: 1px solid; padding-right: 4px; background-color: #e5e5e5" height="21" width="214" align="left">         <p><font size="3">Frame rate counter</font></p>       </th>        <th style="border-top: 1px solid; border-right: 1px solid; border-bottom: 1px solid; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: 1px solid; padding-right: 4px; background-color: #e5e5e5" height="21" width="300" align="left">         <p><font size="3">Description</font></p>       </th>     </tr>      <tr style="vertical-align: top">       <td style="border-top: 1px solid; border-right: 1px solid; border-bottom: 1px solid; padding-bottom: 9px; padding-top: 9px; padding-left: 4px; border-left: 1px solid; line-height: 17pt; padding-right: 4px; background-color: #fff" width="214">         <p style="margin-bottom: 0px; position: relative; margin-top: 0px"><font size="2">Composition (Render) Thread Frame Rate (FPS)</font></p>       </td>        <td style="border-top: 1px solid; border-right: 1px solid; border-bottom: 1px solid; padding-bottom: 9px; padding-top: 9px; padding-left: 4px; border-left: 1px solid; line-height: 17pt; padding-right: 4px; background-color: #fff" width="300">         <p style="margin-bottom: 0px; position: relative; margin-top: 0px"><font size="2">The rate at which the screen is updated.</font></p>       </td>     </tr>      <tr style="vertical-align: top">       <td style="border-top: 1px solid; border-right: 1px solid; border-bottom: 1px solid; padding-bottom: 9px; padding-top: 9px; padding-left: 4px; border-left: 1px solid; line-height: 17pt; padding-right: 4px; background-color: #fff" width="214">         <p style="margin-bottom: 0px; position: relative; margin-top: 0px"><font size="2">User Interface Thread Frame Rate (FPS)</font></p>       </td>        <td style="border-top: 1px solid; border-right: 1px solid; border-bottom: 1px solid; padding-bottom: 9px; padding-top: 9px; padding-left: 4px; border-left: 1px solid; line-height: 17pt; padding-right: 4px; background-color: #fff" width="300">         <p style="margin-bottom: 0px; position: relative; margin-top: 0px"><font size="2">The rate at which the UI thread is running.</font></p>       </td>     </tr>      <tr style="vertical-align: top">       <td style="border-top: 1px solid; border-right: 1px solid; border-bottom: 1px solid; padding-bottom: 9px; padding-top: 9px; padding-left: 4px; border-left: 1px solid; line-height: 17pt; padding-right: 4px; background-color: #fff" width="214">         <p style="margin-bottom: 0px; position: relative; margin-top: 0px"><font size="2">Texture Memory Usage</font></p>       </td>        <td style="border-top: 1px solid; border-right: 1px solid; border-bottom: 1px solid; padding-bottom: 9px; padding-top: 9px; padding-left: 4px; border-left: 1px solid; line-height: 17pt; padding-right: 4px; background-color: #fff" width="300">         <p style="margin-bottom: 0px; position: relative; margin-top: 0px"><font size="2">The video memory and system memory copies of textures being used in the application.</font></p>       </td>     </tr>      <tr style="vertical-align: top">       <td style="border-top: 1px solid; border-right: 1px solid; border-bottom: 1px solid; padding-bottom: 9px; padding-top: 9px; padding-left: 4px; border-left: 1px solid; line-height: 17pt; padding-right: 4px; background-color: #fff" width="214">         <p style="margin-bottom: 0px; position: relative; margin-top: 0px"><font size="2">Surface Counter</font></p>       </td>        <td style="border-top: 1px solid; border-right: 1px solid; border-bottom: 1px solid; padding-bottom: 9px; padding-top: 9px; padding-left: 4px; border-left: 1px solid; line-height: 17pt; padding-right: 4px; background-color: #fff" width="300">         <p style="margin-bottom: 0px; position: relative; margin-top: 0px"><font size="2">The number of explicit surfaces being passed to the GPU for processing.</font></p>       </td>     </tr>      <tr style="vertical-align: top">       <td style="border-top: 1px solid; border-right: 1px solid; border-bottom: 1px solid; padding-bottom: 9px; padding-top: 9px; padding-left: 4px; border-left: 1px solid; line-height: 17pt; padding-right: 4px; background-color: #fff" width="214">         <p style="margin-bottom: 0px; position: relative; margin-top: 0px"><font size="2">Intermediate Surface Counter</font></p>       </td>        <td style="border-top: 1px solid; border-right: 1px solid; border-bottom: 1px solid; padding-bottom: 9px; padding-top: 9px; padding-left: 4px; border-left: 1px solid; line-height: 17pt; padding-right: 4px; background-color: #fff" width="300">         <p style="margin-bottom: 0px; position: relative; margin-top: 0px"><font size="2">The number of implicit surfaces generated as a result of cached surfaces.</font></p>       </td>     </tr>      <tr style="vertical-align: top">       <td style="border-top: 1px solid; border-right: 1px solid; border-bottom: 1px solid; padding-bottom: 9px; padding-top: 9px; padding-left: 4px; border-left: 1px solid; line-height: 17pt; padding-right: 4px; background-color: #fff" width="214">         <p style="margin-bottom: 0px; position: relative; margin-top: 0px"><font size="2">Screen Fill Rate Counter</font></p>       </td>        <td style="border-top: 1px solid; border-right: 1px solid; border-bottom: 1px solid; padding-bottom: 9px; padding-top: 9px; padding-left: 4px; border-left: 1px solid; line-height: 17pt; padding-right: 4px; background-color: #fff" width="300">         <p style="margin-bottom: 0px; position: relative; margin-top: 0px"><font size="2">The number of pixels being painted per frame in terms of screens. A value of 1 represents 480 x 800 pixels.</font></p>       </td>     </tr>   </tbody></table>  <p>&#160;</p>  <p>You can turn them ON or OFF by modifying the App.xaml.cs file </p>  <p><font color="#008000">// Show graphics profiling information while debugging.</font>     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font color="#4f81bd">&#160;</font><font color="#0000ff"> if</font> (System.Diagnostics.<font color="#4f81bd">Debugger</font>.IsAttached)     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font color="#008000">// Display the current frame rate counters.</font>     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font color="#4f81bd">Application</font>.Current.Host.Settings.EnableFrameRateCounter = <font color="#0000ff">true</font>;     <br /></p>  <p>&#160;</p>  <p>To hide the counters, just change EnableFrameRateCounter value to false.</p>  <p><font color="#008000">// Show graphics profiling information while debugging.</font>     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font color="#4f81bd">&#160;</font><font color="#0000ff"> if</font> (System.Diagnostics.<font color="#4f81bd">Debugger</font>.IsAttached)     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font color="#008000">// Display the current frame rate counters.</font>     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font color="#4f81bd">Application</font>.Current.Host.Settings.EnableFrameRateCounter = <font color="#0000ff">false</font>;</p>]]></content:encoded>
    </item>
    <item>
      <title>Windows Phone code sample: Capturing image from camera and updating live tile</title>
      <link>https://docs.microsoft.com/archive/blogs/ssehgal/windows-phone-code-sample-capturing-image-from-camera-and-updating-live-tile</link>
      <pubDate>Fri, 03 Feb 2012 02:16:01 GMT</pubDate>
      <dc:creator><![CDATA[Sidharth Sehgal]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ssehgal/2012/02/03/windows-phone-code-sample-capturing-image-from-camera-and-updating-live-tile/</guid>
      <description><![CDATA[This blog post walks you through an app which captures image from the device camera using the...]]></description>
      <content:encoded><![CDATA[<p>This blog post walks you through an app which captures image from the device camera using the CameraCapture Chooser, saves it on the phone storage, retrieve it back and update the app live tile with this image</p>  <p>1. Lets get started by creating a new Windows Phone Application from the Visual Studio File Menu. We are using Visual C# - Silverlight for Windows Phone Template for this project.</p>  <p>2. Now drag two Image controls and three buttons from Windows Phone Control Toolbox on the page. Name the first image as myImage, second image as smallerImage, buttons as btnClick (set content property as Capture), btnRead (content as Retrieve), btnTile (content as Set Tile). Your page should look like the one shown below:</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/20/80/metablogapi/3312.image_17776013.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-20-80-metablogapi/3312.image_5F00_17776013.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/20/80/metablogapi/8105.image_thumb_49FABD85.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-20-80-metablogapi/8105.image_5F00_thumb_5F00_49FABD85.png" width="201" height="367" /></a></p>  <p>3. Add the following namespaces which we will be requiring in our code</p>  <div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; height: 95px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">   <div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet">     <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">using</span> System.IO.IsolatedStorage;</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">using</span> System.Windows.Media.Imaging;</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">using</span> Microsoft.Phone.Shell;</pre>
<!--CRLF--></div>
</div>

<p>4. Create an object for CameraCaptureTask and couple of other data members for working with the image</p>

<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; height: 109px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
  <div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet">
    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">private</span> <span style="color: #0000ff">byte</span>[] _imageBytes;</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">CameraCaptureTask CCT = <span style="color: #0000ff">new</span> CameraCaptureTask();</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">string</span> imageFolder = <span style="color: #006080">@&quot;\Shared\ShellContent&quot;</span>;</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">string</span> imageFileName = <span style="color: #006080">&quot;DemoImage.jpg&quot;</span>;</pre>
<!--CRLF--></div>
</div>

<p>5. Add an eventHandler to the constructor so that it looks like this</p>

<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; height: 126px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
  <div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet">
    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">public</span> MainPage()</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">{</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    InitializeComponent();            </pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    CCT.Completed += <span style="color: #0000ff">new</span> EventHandler&lt;PhotoResult&gt;(capture_completed);</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">}</pre>
<!--CRLF--></div>
</div>

<p>6. Now, we will add code for button Click event for the Capture button</p>

<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; height: 228px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
  <div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet">
    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">private</span> <span style="color: #0000ff">void</span> btnClick_Click(<span style="color: #0000ff">object</span> sender, RoutedEventArgs e)</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">{</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">try</span></pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    {                </pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        CCT.Show();</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    }</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">catch</span> (System.InvalidOperationException ex)</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    {</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        MessageBox.Show(<span style="color: #006080">&quot;An error occurred&quot;</span>);</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    }</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">}</pre>
<!--CRLF--></div>
</div>

<p>7. And code to execute when CameraCapture task is complete. The code below displays the image in an image control and saves the captured image in Isolated storage</p>

<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; height: 249px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
  <div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet">
    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">void</span> capture_completed(<span style="color: #0000ff">object</span> sender, PhotoResult e)</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">{</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">if</span> (e.TaskResult == TaskResult.OK)</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    {</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        <span style="color: #008000">//Display the photo in an image control named myImage and save the image with dimensions of 150x150 pixels</span></pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        WriteableBitmap WriteableBMP = <span style="color: #0000ff">new</span> WriteableBitmap(150, 150);</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        WriteableBMP.LoadJpeg(e.ChosenPhoto);</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        System.Windows.Media.Imaging.BitmapImage bmp = <span style="color: #0000ff">new</span> System.Windows.Media.Imaging.BitmapImage();</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        bmp.SetSource(e.ChosenPhoto);</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        myImage.Source = bmp;                </pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        <span style="color: #008000">//Using Isolated storage for storage</span></pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">using</span> (var isoFile = IsolatedStorageFile.GetUserStoreForApplication())</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        {</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">if</span> (!isoFile.DirectoryExists(imageFolder))</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">            {</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">                isoFile.CreateDirectory(imageFolder);</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">            }</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">string</span> filePath = System.IO.Path.Combine(imageFolder, imageFileName);</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">using</span> (var stream = isoFile.CreateFile(filePath))</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">            {</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">                WriteableBMP.SaveJpeg(stream, WriteableBMP.PixelWidth, WriteableBMP.PixelHeight, 0, 100);</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">            }</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        }</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    }</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">}</pre>
<!--CRLF--></div>
</div>

<p>8. Next step is to Read the image back in the second image control (to prove we actually saved the image)</p>

<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; height: 244px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
  <div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet">
    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">private</span> <span style="color: #0000ff">void</span> btnRead_Click(<span style="color: #0000ff">object</span> sender, RoutedEventArgs e)</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">{</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    <span style="color: #008000">//Reading the image back from storage</span></pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    BitmapImage imgFromStorage = <span style="color: #0000ff">new</span> BitmapImage();</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">using</span> (var isoFile = IsolatedStorageFile.GetUserStoreForApplication())</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    {</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">string</span> filePath = System.IO.Path.Combine(imageFolder, imageFileName);</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">using</span> (var imageStream = isoFile.OpenFile(</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">            filePath, FileMode.Open, FileAccess.Read))</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        {</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">            imgFromStorage.SetSource(imageStream);</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        }</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    }</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    smallerImage.Source = imgFromStorage;</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">}</pre>
<!--CRLF--></div>
</div>

<p>9. Now that we have retrieved the image, lets set the Live Tile with this image as the tile image and some content</p>

<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
  <div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet">
    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> CreateApplicationTile()</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">{</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    var appTile = ShellTile.ActiveTiles.First();</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    <span style="color: #008000">//Retrieve the seconds part of current timestamp</span></pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">int</span> Sec=System.DateTime.Now.Second;</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    var store = IsolatedStorageFile.GetUserStoreForApplication();</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">if</span> (appTile != <span style="color: #0000ff">null</span>)</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    {</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        var standardTile = <span style="color: #0000ff">new</span> StandardTileData</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        {</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">            Title = <span style="color: #006080">&quot;Live Tile Demo&quot;</span>,</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">            BackgroundImage = <span style="color: #0000ff">new</span> Uri(<span style="color: #006080">@&quot;isostore:/Shared/ShellContent/DemoImage.jpg&quot;</span>, UriKind.Absolute),</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">            <span style="color: #008000">//Set the tile count to current seconds value</span></pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">            Count=Sec,</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">            BackTitle = <span style="color: #006080">&quot;Tile Back Title&quot;</span>,</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">            BackBackgroundImage = <span style="color: #0000ff">new</span> Uri(<span style="color: #006080">@&quot;isostore:/Shared/ShellContent/DemoImage.jpg&quot;</span>, UriKind.Absolute),</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">            BackContent = <span style="color: #006080">&quot;Live Tile Demo Back Title&quot;</span></pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        };</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        appTile.Update(standardTile);</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    }</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">}</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">private</span> <span style="color: #0000ff">void</span> btnTile_Click(<span style="color: #0000ff">object</span> sender, RoutedEventArgs e)</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">{</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    CreateApplicationTile();</pre>
<!--CRLF-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">}</pre>
<!--CRLF--></div>
</div>

<p>And we are done. Go ahead and test the app on Emulator. You can see every time you capture and set tile, the current seconds value will be displayed on the top right end of tile.</p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/20/80/metablogapi/2728.image_529B1611.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-20-80-metablogapi/2728.image_5F00_529B1611.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/20/80/metablogapi/4314.image_thumb_0BD17D07.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-20-80-metablogapi/4314.image_5F00_thumb_5F00_0BD17D07.png" width="208" height="383" /></a></p>

<p>&#160;</p>

<p><strong><u><font size="3">Related Resources</font></u></strong></p>

<p><a href="https://msdn.microsoft.com/en-us/library/ff402541(v=vs.92).aspx" target="_blank">Isolated Storage for Windows Phone</a></p>

<p><a href="https://msdn.microsoft.com/en-us/library/ff769543(v=vs.92).aspx" target="_blank">Choosers for Windows Phone</a></p>

<p><a href="https://msdn.microsoft.com/en-us/library/hh202948(v=vs.92).aspx" target="_blank">Tiles overview for Windows Phone</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Windows Phone code sample : showing current location on map and sharing it using Email</title>
      <link>https://docs.microsoft.com/archive/blogs/ssehgal/windows-phone-code-sample-showing-current-location-on-map-and-sharing-it-using-email</link>
      <pubDate>Thu, 02 Feb 2012 10:05:00 GMT</pubDate>
      <dc:creator><![CDATA[Sidharth Sehgal]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ssehgal/2012/02/02/windows-phone-code-sample-showing-current-location-on-map-and-sharing-it-using-email/</guid>
      <description><![CDATA[In this post, we will create a simple Windows Phone app which uses Bing map control. We will then...]]></description>
      <content:encoded><![CDATA[<p>In this post, we will create a simple Windows Phone app which uses Bing map control. We will then locate our current location on the Bing map. The app will also have a option to share the current location (Latitude and Longitude) using Email Launcher.</p>
<p>&nbsp;</p>
<p>1. Lets get started by creating a new Windows Phone Application from the Visual Studio File Menu. We are using Visual C# - Silverlight for Windows Phone Template for this project.</p>
<p>2. Now drag the Map control from Windows Phone Control Toolbox on the page. Stretch and Scale the Map as per your requirements.</p>
<p>3. We want to have the ZoomBar visible on the map control, for which you need to add the following line of code to the Constructor. Here map1 is the name of the map control we are using.</p>
<blockquote>
<div class="csharpcode">
<pre class="alt"><span class="kwrd">public</span> MainPage()</pre>
<pre>        {</pre>
<pre class="alt">            InitializeComponent();</pre>
<pre>            map1.ZoomBarVisibility = <span style="color: #4bacc6;" color="#4bacc6">Visibility</span>.Visible;</pre>
<pre class="alt">        }</pre>
</div>
</blockquote>
<p>If you run the app, you will see a map with the ZoomBar. Our next task is to locate the current co-ordinates on this map.</p>
<p>4. For using the GeoCoordinateWatcher class, you will need to include System.Device.Location namespace:</p>
<blockquote>
<pre class="csharpcode"><span class="kwrd">using</span> System.Device.Location;</pre>
</blockquote>
<p><span style="color: #333333;" color="#333333">5. Initialize the object</span></p>
<blockquote>
<pre class="csharpcode"><span class="kwrd">private</span> <span style="color: #4bacc6;" color="#4bacc6">GeoCoordinateWatcher</span> loc = <span class="kwrd">null</span>;</pre>
</blockquote>
<p>6. Now we will add a button, clicking which will take us to our current location on the map. Lets name this button btnMe and change the content to &ldquo;Me&rdquo;.</p>
<p>7. We will now add code for button click event:</p>
<blockquote>
<div class="csharpcode">
<pre class="alt"><span class="kwrd">private</span> <span class="kwrd">void</span> btnMe_Click(<span class="kwrd">object</span> sender, RoutedEventArgs e)</pre>
<pre>        {</pre>
<pre class="alt">            loc = <span class="kwrd">new</span> GeoCoordinateWatcher(GeoPositionAccuracy.Default); </pre>
<pre>            <span class="rem">//EventHandler for location service status changes</span></pre>
<pre class="alt">            loc.StatusChanged += loc_StatusChanged; </pre>
<pre>            <span class="rem">//If the location service is disabled or not supported</span></pre>
<pre class="alt">            <span class="kwrd">if</span> (loc.Status == GeoPositionStatus.Disabled) </pre>
<pre>            { </pre>
<pre class="alt">                <span class="rem">//Display a message</span></pre>
<pre>                MessageBox.Show(<span class="str">"Location services must be enabled"</span>); </pre>
<pre class="alt">                <span class="kwrd">return</span>; </pre>
<pre>            } </pre>
<pre class="alt">            loc.Start();</pre>
<pre>        }</pre>
</div>
</blockquote>
<p>8. Move and zoom the map view to current location</p>
<blockquote>
<div class="csharpcode">
<pre class="alt"><span class="kwrd">void</span> loc_StatusChanged(<span class="kwrd">object</span> sender, GeoPositionStatusChangedEventArgs e)</pre>
<pre>        {</pre>
<pre class="alt">           <span class="kwrd">if</span> (e.Status == GeoPositionStatus.Ready)</pre>
<pre>            {                </pre>
<pre class="alt">                map1.SetView(loc.Position.Location, 10.0);</pre>
<pre>                loc.Stop();</pre>
<pre class="alt">            }</pre>
<pre>        }</pre>
</div>
</blockquote>
<p>9. Now that we have the map showing our current location, lets add code to Email our coordinates. First of all we will add another button, name it btnEmail and change the content to &ldquo;Email&rdquo;. Your page should now look like the one shown below:</p>
<blockquote>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/20/80/metablogapi/2047.image_26EFE1D4.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-20-80-metablogapi/2047.image_5F00_26EFE1D4.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border: 0px;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/20/80/metablogapi/4604.image_thumb_4264BE0A.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-20-80-metablogapi/4604.image_5F00_thumb_5F00_4264BE0A.png" width="200" height="376" /></a></p>
</blockquote>
<p>10. Add the namespace Microsoft.Phone.Tasks to use EmailCompose Task</p>
<blockquote>
<pre class="csharpcode"><span class="kwrd">using</span> Microsoft.Phone.Tasks;</pre>
<pre class="csharpcode">&nbsp;</pre>
</blockquote>
<p>11. Add the following code to button Click event</p>
<blockquote>
<div class="csharpcode">&nbsp;</div>
<div class="csharpcode">
<pre class="alt"><span class="kwrd">private</span> <span class="kwrd">void</span> btnEmail_Click(<span class="kwrd">object</span> sender, RoutedEventArgs e)</pre>
<pre>        {</pre>
<pre class="alt">            <span class="kwrd">string</span> Msg = <span class="str">"Lat="</span> + loc.Position.Location.Latitude.ToString();</pre>
<pre>            Msg=Msg + <span class="str">" Long="</span> + loc.Position.Location.Longitude.ToString();</pre>
<pre class="alt">            EmailComposeTask emailcomposer = <span class="kwrd">new</span> EmailComposeTask();</pre>
<pre>            emailcomposer.To = <span class="str">"someone@somedomain.com"</span>;</pre>
<pre class="alt">            emailcomposer.Subject = <span class="str">"My current location"</span>;</pre>
<pre>            emailcomposer.Body = Msg;</pre>
<pre class="alt">            <span class="rem">//Show the Email application </span></pre>
<pre>            emailcomposer.Show();</pre>
<pre class="alt">        }</pre>
</div>
</blockquote>
<p>Your application is now ready</p>
<p><strong><span style="text-decoration: underline;"><span style="font-size: small;" size="3">Testing your application</span></span></strong></p>
<p>You can test your app on the Emulator by pressing F5. Once your app is up on the Emulator, you can simulate your current location by using the additional tools on the emulator. Goto the Location tab and select a location to simulate.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/20/80/metablogapi/2570.image_53F4A8D5.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-20-80-metablogapi/2570.image_5F00_53F4A8D5.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border: 0px;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/20/80/metablogapi/6443.image_thumb_131286D9.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-20-80-metablogapi/6443.image_5F00_thumb_5F00_131286D9.png" width="747" height="484" /></a></p>
<p>&nbsp;</p>
<p><strong><span style="text-decoration: underline;"><span style="font-size: small;" size="3">Related Resources</span></span></strong></p>
<p><span style="font-size: x-small;" size="2"><a href="https://msdn.microsoft.com/en-us/library/ff941096(v=vs.92).aspx" target="_blank">Bing Map control for Windows Phone</a></span></p>
<p><span style="font-size: x-small;" size="2"><a href="https://msdn.microsoft.com/en-us/library/ff769550(v=vs.92).aspx" target="_blank">Launchers for Windows Phone</a></span></p>]]></content:encoded>
    </item>
    <item>
      <title>Windows Phone Camps resources</title>
      <link>https://docs.microsoft.com/archive/blogs/ssehgal/windows-phone-camps-resources</link>
      <pubDate>Fri, 27 Jan 2012 10:12:17 GMT</pubDate>
      <dc:creator><![CDATA[Sidharth Sehgal]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ssehgal/2012/01/27/windows-phone-camps-resources/</guid>
      <description><![CDATA[&#160;  &lt;Update: 6 Feb 2012&gt;  Code walkthrough for apps shown during my session on “Developing...]]></description>
      <content:encoded><![CDATA[<p>&#160;</p>  <p>&lt;Update: 6 Feb 2012&gt;</p>  <p>Code walkthrough for apps shown during my session on “Developing applications for Windows Phone”&#160; during <a href="https://www.microsoft.com/india/events/windowsphonecamps/Default.aspx" target="_blank">Windows Phone Camps</a> Hyderabad are available at the posts below:</p>  <p><a href="https://blogs.msdn.com/b/ssehgal/archive/2012/02/02/windows-phone-code-sample-showing-current-location-on-map-and-sharing-it-using-email.aspx">Windows Phone code sample : showing current location on map and sharing it using Email</a></p>  <p><a href="https://blogs.msdn.com/b/ssehgal/archive/2012/02/03/windows-phone-code-sample-capturing-image-from-camera-and-updating-live-tile.aspx">Windows Phone code sample: Capturing image from camera and updating live tile</a></p>  <p>There were a couple of questions asked during the Q&amp;A time, responses to which are given below:</p>  <p>Q. Is there a limit to Isolated storage which can be used by Windows Phone apps?</p>  <p>A. There is no such limit for Windows Phone apps. More details about Windows Phone Isolated storage can be found <a href="https://msdn.microsoft.com/en-us/library/ff402541(v=vs.92).aspx" target="_blank">here</a></p>  <p>&#160;</p>  <p>Q. What is maximum allowed size of XAP package file?</p>  <p>A. It is 225 MB. More details <a href="https://msdn.microsoft.com/en-us/library/hh184844(v=vs.92).aspx" target="_blank">here</a></p>  <p>&#160;</p>  <p>Q. Can we connect to web services from Windows Phone apps?</p>  <p>A. Yes. See this <a href="https://msdn.microsoft.com/en-us/library/ff637518(v=vs.92).aspx" target="_blank">link</a> for details on Networking and Web Services support.</p>]]></content:encoded>
    </item>
    <item>
      <title>Windows Phone 7 development : CTD Hyderabad session resources</title>
      <link>https://docs.microsoft.com/archive/blogs/ssehgal/windows-phone-7-development-ctd-hyderabad-session-resources</link>
      <pubDate>Sat, 18 Dec 2010 00:59:24 GMT</pubDate>
      <dc:creator><![CDATA[Sidharth Sehgal]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ssehgal/2010/12/18/windows-phone-7-development-ctd-hyderabad-session-resources/</guid>
      <description><![CDATA[I just finished my session on Windows Phone 7 Development during CommunityTechDays Hyderabad. I am...]]></description>
      <content:encoded><![CDATA[<p>I just finished my session on Windows Phone 7 Development during <a href="https://communitytechdays.com/agenda.aspx#hyderabad" target="_blank">CommunityTechDays Hyderabad</a>. I am including resources I talked about to get you started on Windows Phone 7 Development and links to some demos I presented during the session. The live webcast for other sessions is being streamed at <a title="https://communitytechdays.com/join_session.aspx" href="https://communitytechdays.com/join_session.aspx">https://communitytechdays.com/join_session.aspx</a> right now.</p>  <p>General Information about WP7</p>  <blockquote>   <p><a href="https://www.windowsphone7.com/">https://</a><a href="https://www.windowsphone7.com">www.windowsphone7.com</a></p> </blockquote>  <p>Free Developer tools download and developer resources</p>  <blockquote>   <p><a href="https://developer.windowsphone.com">https://developer.windowsphone.com</a></p> </blockquote>  <p>Have some fun with the personalized demo</p>  <blockquote>   <p><a title="https://apps.facebook.com/meetnewwpdemo/" href="https://apps.facebook.com/meetnewwpdemo/">https://apps.facebook.com/meetnewwpdemo/</a></p> </blockquote>  <p>Some of the demos presented during the session</p>  <blockquote>   <p><a title="https://msdn.microsoft.com/en-us/library/ff431744(v=VS.92).aspx" href="https://msdn.microsoft.com/en-us/library/ff431744(v=VS.92).aspx">https://msdn.microsoft.com/en-us/library/ff431744(v=VS.92).aspx</a></p></blockquote>]]></content:encoded>
    </item>
    <item>
      <title>Loading April CTP Refresh Windows Phone 7 projects using Developer Tools RTM</title>
      <link>https://docs.microsoft.com/archive/blogs/ssehgal/loading-april-ctp-refresh-windows-phone-7-projects-using-developer-tools-rtm</link>
      <pubDate>Thu, 21 Oct 2010 04:24:16 GMT</pubDate>
      <dc:creator><![CDATA[Sidharth Sehgal]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ssehgal/2010/10/21/loading-april-ctp-refresh-windows-phone-7-projects-using-developer-tools-rtm/</guid>
      <description><![CDATA[With the release of Windows Phone 7 Developer Tools RTM, you may see the below message if you try to...]]></description>
      <content:encoded><![CDATA[<p>With the release of <a href="https://developer.windowsphone.com/" target="_blank">Windows Phone 7 Developer Tools RTM</a>, you may see the below message if you try to open the project you built with earlier versions of Developer Tools. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/20/80/metablogapi/8831.image_09C52849.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-20-80-metablogapi/8831.image_5F00_09C52849.png"><img style="background-image: none; border-right-width: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/20/80/metablogapi/8358.image_thumb_33E4B064.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-20-80-metablogapi/8358.image_5F00_thumb_5F00_33E4B064.png" width="395" height="375" /></a></p>  <p>The message is self-explanatory and you can easily make the changes as suggested, but if you want to save some time by not manually making each of the entries as suggested, copy and paste the code segment given below in this post.</p>  <p>Open the WMAppManifest.xml file under properties node in your project </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/20/80/metablogapi/0535.image_21D86CD7.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-20-80-metablogapi/0535.image_5F00_21D86CD7.png"><img style="background-image: none; border-right-width: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/20/80/metablogapi/1031.image_thumb_6E9C336D.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-20-80-metablogapi/1031.image_5F00_thumb_5F00_6E9C336D.png" width="209" height="115" /></a></p>  <p>&#160;</p>  <p>Look for the &lt;Capabilities&gt;&#160;&#160;&#160; &lt;/Capabilities&gt; node in the file and copy/paste the following elements inside the node:</p>  <p>&lt;Capability Name=&quot;ID_CAP_NETWORKING&quot;/&gt;    <br />&lt;Capability Name=&quot;ID_CAP_LOCATION&quot;/&gt;     <br />&lt;Capability Name=&quot;ID_CAP_SENSORS&quot;/&gt;     <br />&lt;Capability Name=&quot;ID_CAP_MICROPHONE&quot;/&gt;     <br />&lt;Capability Name=&quot;ID_CAP_MEDIALIB&quot;/&gt;     <br />&lt;Capability Name=&quot;ID_CAP_GAMERSERVICES&quot;/&gt;     <br />&lt;Capability Name=&quot;ID_CAP_PHONEDIALER&quot;/&gt;     <br />&lt;Capability Name=&quot;ID_CAP_PUSH_NOTIFICATION&quot;/&gt;     <br />&lt;Capability Name=&quot;ID_CAP_WEBBROWSERCOMPONENT&quot;/&gt;</p>  <p>&#160;</p>  <p>To make your migration experience easy, it is recommended to go through Jaime’s blog post <a href="https://blogs.msdn.com/b/jaimer/archive/2010/06/28/migrating-apps-from-windows-phone-ctps-to-the-beta-build.aspx?wa=wsignin1.0" target="_blank">here</a> which will help you fix any build errors.</p>]]></content:encoded>
    </item>
    <item>
      <title>Learn about WCF, watch WCF FireStarter Deep Dive Simulcast</title>
      <link>https://docs.microsoft.com/archive/blogs/ssehgal/learn-about-wcf-watch-wcf-firestarter-deep-dive-simulcast</link>
      <pubDate>Thu, 17 Jun 2010 07:13:20 GMT</pubDate>
      <dc:creator><![CDATA[Sidharth Sehgal]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ssehgal/2010/06/17/learn-about-wcf-watch-wcf-firestarter-deep-dive-simulcast/</guid>
      <description><![CDATA[Can’t make it to the New York Windows Communication Foundation (WCF) Firestarter?   Watch it online...]]></description>
      <content:encoded><![CDATA[<p>Can’t make it to the New York Windows Communication Foundation (WCF) Firestarter? </p>  <p>Watch it online : <a href="https://bit.ly/90Mq2i">https://bit.ly/90Mq2i</a></p>  <table border="0" cellspacing="0" cellpadding="0"><tbody>     <tr>       <td valign="top" width="249">         <p><b>Time:&#160; (Pacific)</b></p>       </td>        <td valign="top" width="283">         <p><b>Session</b></p>       </td>        <td valign="top" width="108">         <p><b>Presenter</b></p>       </td>     </tr>      <tr>       <td valign="top" width="249">         <p>6:00 AM – 7:30 AM </p>       </td>        <td valign="top" width="283">         <p>Keynote: Intro to SOA &amp; WCF</p>       </td>        <td valign="bottom" width="108">         <p>Miguel Castro</p>       </td>     </tr>      <tr>       <td valign="top" width="249">         <p>7:45 AM – 9:00 AM</p>       </td>        <td valign="top" width="283">         <p>Most Common WCF Usage Configurations</p>       </td>        <td valign="top" width="108">         <p>Miguel Castro</p>       </td>     </tr>      <tr>       <td valign="top" width="249">         <p>9:45 AM – 11:00 AM</p>       </td>        <td valign="top" width="283">         <p>REST Programming With WCF</p>       </td>        <td valign="bottom" width="108">         <p>Peter Laudati</p>       </td>     </tr>      <tr>       <td valign="top" width="249">         <p>11:15 AM – 12:30 PM</p>       </td>        <td valign="top" width="283">         <p>WCF Made Easy: Data &amp; RIA Services</p>       </td>        <td valign="top" width="108">         <p>Don Demsak</p>       </td>     </tr>      <tr>       <td valign="top" width="249">         <p>12:45 PM – 2:00 PM</p>       </td>        <td valign="top" width="283">         <p>What's New with WCF 4.0</p>       </td>        <td valign="top" width="108">         <p>Miguel Castro</p>       </td>     </tr>   </tbody></table>]]></content:encoded>
    </item>
    <item>
      <title>Bing Twitter Maps for your site</title>
      <link>https://docs.microsoft.com/archive/blogs/ssehgal/bing-twitter-maps-for-your-site</link>
      <pubDate>Tue, 16 Mar 2010 23:33:06 GMT</pubDate>
      <dc:creator><![CDATA[Sidharth Sehgal]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ssehgal/2010/03/16/bing-twitter-maps-for-your-site/</guid>
      <description><![CDATA[Now you can embed Bing twitter maps on your site and scope a search by @user, location or keyword....]]></description>
      <content:encoded><![CDATA[<p>Now you can embed Bing twitter maps on your site and scope a search by @user, location or keyword.</p>  <p>Simply go to <a href="https://www.bing.com/maps/explore/">https://www.bing.com/maps/explore/</a> and click on maps app on the bottom left of the screen. Select Twitter Maps and then put in your search using the Search Filters then click the link to embed in your site. </p>  <p>Here is an example below, where I have filtered the maps for Tweets in Delhi area.</p> <iframe height="350" src="https://www.bing.com/twitter/maps/embed?version=1.0&amp;eid=312995361&amp;lat=28.6593799591064&amp;lon=77.2287139892578&amp;z=9" frameborder="0" width="350" scrolling="no"></iframe>]]></content:encoded>
    </item>
    <item>
      <title>Free Technical and Soft skills Webcasts this Fall for students</title>
      <link>https://docs.microsoft.com/archive/blogs/ssehgal/free-technical-and-soft-skills-webcasts-this-fall-for-students</link>
      <pubDate>Sun, 21 Feb 2010 01:18:47 GMT</pubDate>
      <dc:creator><![CDATA[Sidharth Sehgal]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ssehgal/2010/02/21/free-technical-and-soft-skills-webcasts-this-fall-for-students/</guid>
      <description><![CDATA[Are you graduating from college soon and feel ill-prepared to enter the workforce directly out of an...]]></description>
      <content:encoded><![CDATA[<p>Are you graduating from college soon and feel ill-prepared to enter the workforce directly out of an academic setting. These webcasts attempt to help students bridge the gap between college and the workplace. Through a combination of soft-skills training and introduction to Microsoft products these webcasts will provide students with essential tools for advancing their careers.</p>  <p>These webcasts will be held every other Wednesday at 2:30 EST from February 24<sup>th</sup> until May 5<sup>th</sup>. For the list of upcoming webcasts and more information, log onto <a href="https://tiny.cc/sws19">https://tiny.cc/sws19</a></p>]]></content:encoded>
    </item>
  </channel>
</rss>