<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7491841004385098831</id><updated>2011-10-24T07:08:36.981-07:00</updated><category term='tube companion'/><category term='service reference'/><category term='select'/><category term='BingMapsTask'/><category term='RouteResponse'/><category term='Control'/><category term='Jogging'/><category term='paused'/><category term='medialibrary'/><category term='xna'/><category term='CTP'/><category term='Route Service'/><category term='RouteServiceClient'/><category term='photochoosertask'/><category term='Windows'/><category term='Phone'/><category term='GeoCoordinateWatcher'/><category term='locked'/><category term='Windows Phone 7'/><category term='WayPoint'/><category term='photo'/><category term='April'/><category term='Refresh'/><category term='push'/><category term='tube'/><category term='Bing Maps'/><category term='Location Services'/><category term='underground'/><category term='Pushpin'/><category term='london'/><category term='RouteRequest'/><category term='notification'/><category term='toast'/><category term='Sat Nav'/><category term='Silverlight'/><category term='WMAppManifest.xml'/><title type='text'>Andy-TeamG</title><subtitle type='html'>Experiences with C#, Silverlight, Windows Phone, SQL Server and plenty more.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://andy-teamg.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7491841004385098831/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://andy-teamg.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Andy</name><uri>http://www.blogger.com/profile/03011911310665411434</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7491841004385098831.post-3286225857918018135</id><published>2010-09-14T07:25:00.001-07:00</published><updated>2010-09-14T07:40:10.096-07:00</updated><title type='text'>Windows Phone 7 – Tube Companion (Pre RTM)</title><content type='html'>&lt;p&gt;Ive recently completed my Tube Companion application for Windows Phone 7.&amp;#160; The application was built with a pre-RTM version of the toolkit, but once the RTM version has been released then i’ll retest the code base, and barring any major breaking changes I should be good to go.&lt;/p&gt;  &lt;p&gt;The application itself is basically a tool to assist users who utilise the London Underground.&amp;#160; A complete list of functionality in this first release is as follows:&lt;/p&gt;  &lt;p&gt;Line Status - Live updates of the status of each of the tube lines.&lt;/p&gt;  &lt;p&gt;Tube Map - A version of the tube map with pinch/zoom enabled.&lt;/p&gt;  &lt;p&gt;Station lookup – Lookup every station on the London Underground network.&lt;/p&gt;  &lt;p&gt;Live Departure Boards – Display the live departure boards for certain tube station/tube line pairings. &lt;/p&gt;  &lt;p&gt;Stations Near Me – Shows the ten nearest stations to the user within a 10 mile radius,&lt;/p&gt;  &lt;p&gt;Tube This Weekend – Displays the planned disruptions to the tube lines/stations for the forthcoming weekend. &lt;/p&gt;  &lt;p&gt;Push Notifications – Push notifications can be enabled to alert users of problems with each of the tube lines.&lt;/p&gt;  &lt;p&gt;Demo of the app here:&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:41bd786f-c46f-4309-b512-c12e230d1449" class="wlWriterEditableSmartContent"&gt;&lt;div id="69844da9-6b48-4f88-8e08-1639d2b4ec14" style="margin: 0px; padding: 0px; display: inline;"&gt;&lt;div&gt;&lt;a href="http://www.youtube.com/watch?v=8z2GZt1K16A" target="_new"&gt;&lt;img src="http://lh3.ggpht.com/_uTVaTcwFmrQ/TI-JR8NkZKI/AAAAAAAAAF4/BPBLm1smGxM/video837485f0d4a4%5B2%5D.jpg?imgmax=800" style="border-style: none" galleryimg="no" onload="var downlevelDiv = document.getElementById('69844da9-6b48-4f88-8e08-1639d2b4ec14'); downlevelDiv.innerHTML = &amp;quot;&amp;lt;div&amp;gt;&amp;lt;object width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;param name=\&amp;quot;movie\&amp;quot; value=\&amp;quot;http://www.youtube.com/v/8z2GZt1K16A&amp;amp;hl=en\&amp;quot;&amp;gt;&amp;lt;\/param&amp;gt;&amp;lt;embed src=\&amp;quot;http://www.youtube.com/v/8z2GZt1K16A&amp;amp;hl=en\&amp;quot; type=\&amp;quot;application/x-shockwave-flash\&amp;quot; width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;\/embed&amp;gt;&amp;lt;\/object&amp;gt;&amp;lt;\/div&amp;gt;&amp;quot;;" alt=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7491841004385098831-3286225857918018135?l=andy-teamg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andy-teamg.blogspot.com/feeds/3286225857918018135/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://andy-teamg.blogspot.com/2010/09/windows-phone-7-tube-companion-pre-rtm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7491841004385098831/posts/default/3286225857918018135'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7491841004385098831/posts/default/3286225857918018135'/><link rel='alternate' type='text/html' href='http://andy-teamg.blogspot.com/2010/09/windows-phone-7-tube-companion-pre-rtm.html' title='Windows Phone 7 – Tube Companion (Pre RTM)'/><author><name>Andy</name><uri>http://www.blogger.com/profile/03011911310665411434</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_uTVaTcwFmrQ/TI-JR8NkZKI/AAAAAAAAAF4/BPBLm1smGxM/s72-c/video837485f0d4a4%5B2%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7491841004385098831.post-5341535046321272067</id><published>2010-07-08T01:15:00.001-07:00</published><updated>2010-07-08T02:30:44.345-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='photo'/><category scheme='http://www.blogger.com/atom/ns#' term='photochoosertask'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Phone 7'/><category scheme='http://www.blogger.com/atom/ns#' term='xna'/><category scheme='http://www.blogger.com/atom/ns#' term='select'/><category scheme='http://www.blogger.com/atom/ns#' term='medialibrary'/><title type='text'>Windows Phone 7 - Selecting device photos without PhotoChooserTask</title><content type='html'>&lt;span style=";font-family:verdana;font-size:100%;" class="Apple-style-span"  &gt;&lt;span class="Apple-style-span"&gt;A common feature of mobile based applications is the ability to let you view photos that have been taken with the device.  For Silverlight based Windows Phone 7 applications, this functionality would generally be achieved by utilising the PhotoChooserTask.&lt;br /&gt;&lt;br /&gt;The PhotoChooser task navigates to the phones photo gallery section, allows the user to select a photo and then returns this photo to the calling application.  Now this approach is fine for the majority of circumstances, but what happens if more flexibility is required by the application for image selection?  In this case the MediaLibrary class can be utilised to retrieve images from the device, and then displayed in whichever way the application chooses.&lt;/span&gt;&lt;/span&gt;&lt;p  class="MsoNormal" style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:100%;"&gt;&lt;span class="Apple-style-span"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p  class="MsoNormal" style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:100%;"&gt;&lt;span class="Apple-style-span"&gt;The following shows simple examples of both approaches.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;b&gt;PhotoChooserTask Implementation&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;insert photo=""&gt;&lt;/insert&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;img src="http://4.bp.blogspot.com/_uTVaTcwFmrQ/TDWNiWnL3OI/AAAAAAAAAFE/ZD4-8qgk__E/s320/PhotoChooserTask01.png" style="cursor: pointer; width: 164px; height: 320px;" alt="" id="BLOGGER_PHOTO_ID_5491450941973191906" border="0" /&gt;&lt;/p&gt;&lt;p  class="MsoNormal" style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Here we have a very simple UI that contains a button to select a photo and a currently unassigned image control.&lt;/span&gt;&lt;/p&gt;&lt;p  class="MsoNormal" style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=";font-family:arial;font-size:medium;" class="Apple-style-span"  &gt;The following code is then used to display the images on the phone.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;span style="color:blue;"&gt;private&lt;/span&gt; &lt;span style="color:blue;"&gt;void&lt;/span&gt; butSelectPhoto_Click(&lt;span style="color:blue;"&gt;object&lt;/span&gt; sender, &lt;span style="color: rgb(43, 145, 175);"&gt;RoutedEventArgs&lt;/span&gt; e)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;PhotoChooserTask&lt;/span&gt; photo = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;PhotoChooserTask&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;photo.ShowCamera = &lt;span style="color:blue;"&gt;true&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;photo.Show();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span class="Apple-style-span"  style="font-family:Consolas;"&gt;&lt;span class="Apple-style-span"  style="font-size:13px;"&gt;&lt;span style=""&gt;        &lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span class="Apple-style-span"  style="font-family:Consolas;"&gt;&lt;span class="Apple-style-span"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:Consolas;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;This now opens up a gallery of photos to choose from.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;img src="http://3.bp.blogspot.com/_uTVaTcwFmrQ/TDWN8mWlCOI/AAAAAAAAAFM/md81kR4xcfk/s320/PhotoChooserTask02.png" alt="" id="BLOGGER_PHOTO_ID_5491451392875104482" style="cursor: pointer; width: 164px; height: 320px;" border="0" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span class="Apple-style-span" style=";font-family:Consolas;font-size:100%;"  &gt;&lt;span class="Apple-style-span"  style="font-size:13px;"&gt;&lt;insert photo=""&gt;&lt;/insert&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span class="Apple-style-span" style=";font-family:Consolas;font-size:100%;"  &gt;&lt;span class="Apple-style-span"  style="font-size:13px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span class="Apple-style-span" style=";font-family:Consolas;font-size:100%;"  &gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;Once the user has selected a picture from the gallery, then the image is returned as a stream to the calling application. The application then overrides the OnChooserReturn method(used to capture the results from all chooser operations) and simply assigns the returned stream to a Bitmap image, which is then assigned to the image on the user interface.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 255);font-family:Consolas;" &gt;&lt;span class="Apple-style-span" style=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 255);font-family:Consolas;" &gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;override&lt;/span&gt; &lt;span style="color:blue;"&gt;void&lt;/span&gt; OnChooserReturn(&lt;span style="color:blue;"&gt;object&lt;/span&gt; sender, &lt;span style="color: rgb(43, 145, 175);"&gt;EventArgs&lt;/span&gt; e)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color:blue;"&gt;base&lt;/span&gt;.OnChooserReturn(sender, e);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;TaskEventArgs&lt;/span&gt;&lt;&lt;span style="color: rgb(43, 145, 175);"&gt;PhotoResult&lt;/span&gt;&gt; photo = e &lt;span style="color:blue;"&gt;as&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;TaskEventArgs&lt;/span&gt;&lt;&lt;span style="color: rgb(43, 145, 175);"&gt;PhotoResult&lt;/span&gt;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt; (photo != &lt;span style="color:blue;"&gt;null&lt;/span&gt; &amp;amp;&amp;amp; photo.Result != &lt;span style="color:blue;"&gt;null&lt;/span&gt; &amp;amp;&amp;amp; photo.Result.ChosenPhoto != &lt;span style="color:blue;"&gt;null&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;BitmapImage&lt;/span&gt; image = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;BitmapImage&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;                &lt;/span&gt;image.SetSource(photo.Result.ChosenPhoto);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;                &lt;/span&gt;imgPhoto.Source = image;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;img src="http://3.bp.blogspot.com/_uTVaTcwFmrQ/TDWQLDeDXMI/AAAAAAAAAFU/dwDsnDpoQy0/s320/PhotoChooserTask03.png" style="cursor: pointer; width: 164px; height: 320px;" alt="" id="BLOGGER_PHOTO_ID_5491453840232504514" border="0" /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;b&gt;Media Library Implementation&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;The media library implementation example simply displays a horizontally scrolling list containing all of the photos on the device. When a user selects an item from the list, then a larger version of the image is simply displayed above the list.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_uTVaTcwFmrQ/TDWRGZmRjII/AAAAAAAAAFk/evn8XwKAHZg/s1600/MediaLib02.png"&gt;&lt;img style="cursor: pointer; width: 164px; height: 320px;" src="http://2.bp.blogspot.com/_uTVaTcwFmrQ/TDWRGZmRjII/AAAAAAAAAFk/evn8XwKAHZg/s320/MediaLib02.png" alt="" id="BLOGGER_PHOTO_ID_5491454859784850562" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_uTVaTcwFmrQ/TDWRF6cIuyI/AAAAAAAAAFc/Xsud9dYWisY/s1600/MediaLib01.png"&gt;&lt;img style="cursor: pointer; width: 164px; height: 320px;" src="http://3.bp.blogspot.com/_uTVaTcwFmrQ/TDWRF6cIuyI/AAAAAAAAAFc/Xsud9dYWisY/s320/MediaLib01.png" alt="" id="BLOGGER_PHOTO_ID_5491454851420830498" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;In order to achieve this first a reference to the Microsoft.XNA.Framework assembly needs to be added to the project, as it is this assembly which contains the MediaLibrary class which does most of the work.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;A simple class is now created called MediaImage, and this simply holds a reference to an individual&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;BitmapImage which represents a photo.&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;This is required to allow us to use data binding within the the listbox.&lt;/span&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 255);font-family:Consolas;" &gt;&lt;span class="Apple-style-span" style=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 255);font-family:Consolas;" &gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;MediaImage&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;    &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;BitmapImage&lt;/span&gt; ImageFile { &lt;span style="color:blue;"&gt;get&lt;/span&gt;; &lt;span style="color:blue;"&gt;set&lt;/span&gt;; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;color:blue;"   &gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-family:Consolas;font-size:9.5pt;"  &gt;ListBox.ItemTemplate&lt;/span&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;color:blue;"   &gt;&gt;&lt;/span&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 36pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;color:blue;"   &gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-family:Consolas;font-size:9.5pt;"  &gt;DataTemplate&lt;/span&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;color:blue;"   &gt;&gt;&lt;/span&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 36pt; text-indent: 36pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;color:blue;"   &gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-family:Consolas;font-size:9.5pt;"  &gt;Image&lt;/span&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;color:red;"   &gt; Source&lt;/span&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;color:blue;"   &gt;="{&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-family:Consolas;font-size:9.5pt;"  &gt;Binding&lt;/span&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;color:red;"   &gt; ImageFile&lt;/span&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;color:blue;"   &gt;}"&lt;/span&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;color:red;"   &gt; Width&lt;/span&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;color:blue;"   &gt;="100"&lt;/span&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;color:red;"   &gt; Height&lt;/span&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;color:blue;"   &gt;="100"/&gt;&lt;/span&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 36pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;color:blue;"   &gt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-family:Consolas;font-size:9.5pt;"  &gt;DataTemplate&lt;/span&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;color:blue;"   &gt;&gt;&lt;/span&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;color:blue;"   &gt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-family:Consolas;font-size:9.5pt;"  &gt;ListBox.ItemTemplate&lt;/span&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;color:blue;"   &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div&gt;&lt;p class="MsoNormal"&gt;The following method is then called from the page’s constructor, and this method is responsible for&lt;span style=""&gt;  &lt;/span&gt;populating the list with the images.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;span style="color:blue;"&gt;private&lt;/span&gt; &lt;span style="color:blue;"&gt;void&lt;/span&gt; GetImages()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;MediaLibrary&lt;/span&gt; mediaLibrary = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;MediaLibrary&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color:blue;"&gt;var&lt;/span&gt; pictures = mediaLibrary.Pictures;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color:blue;"&gt;foreach&lt;/span&gt; (&lt;span style="color:blue;"&gt;var&lt;/span&gt; picture &lt;span style="color:blue;"&gt;in&lt;/span&gt; pictures)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;BitmapImage&lt;/span&gt; image = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;BitmapImage&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;                &lt;/span&gt;image.SetSource(picture.GetImage());&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;MediaImage&lt;/span&gt; mediaImage = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;MediaImage&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;                &lt;/span&gt;mediaImage.ImageFile = image;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;                &lt;/span&gt;lstImages.Items.Add(mediaImage);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span class="Apple-style-span" style=";font-family:Consolas;font-size:13px;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"  style="margin-bottom: 0.0001pt; line-height: normal;font-family:arial;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Finally the list’s SelectionChanged event is handled to simply populate the Image with the selected image from the list.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 255);font-family:Consolas;" &gt;&lt;span class="Apple-style-span" style=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 255);font-family:Consolas;" &gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;color:blue;"   &gt;private&lt;/span&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt; &lt;span style="color:blue;"&gt;void&lt;/span&gt; lstImages_SelectionChanged(&lt;span style="color:blue;"&gt;object&lt;/span&gt; sender, &lt;span style="color: rgb(43, 145, 175);"&gt;SelectionChangedEventArgs&lt;/span&gt; e)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 36pt; line-height: normal;"&gt;&lt;span style="color: rgb(43, 145, 175);font-family:Consolas;font-size:9.5pt;"  &gt;MediaLibrary&lt;/span&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt; mediaLibrary = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;MediaLibrary&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;BitmapImage&lt;/span&gt; image = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;BitmapImage&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;       &lt;/span&gt;image.SetSource(mediaLibrary.Pictures[lstImages.SelectedIndex].GetImage());&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;span style=""&gt;       &lt;/span&gt;imgSelectedPhoto.Source = image;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:Consolas;font-size:9.5pt;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7491841004385098831-5341535046321272067?l=andy-teamg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andy-teamg.blogspot.com/feeds/5341535046321272067/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://andy-teamg.blogspot.com/2010/07/windows-phone-7-selecting-device-photos.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7491841004385098831/posts/default/5341535046321272067'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7491841004385098831/posts/default/5341535046321272067'/><link rel='alternate' type='text/html' href='http://andy-teamg.blogspot.com/2010/07/windows-phone-7-selecting-device-photos.html' title='Windows Phone 7 - Selecting device photos without PhotoChooserTask'/><author><name>Andy</name><uri>http://www.blogger.com/profile/03011911310665411434</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uTVaTcwFmrQ/TDWNiWnL3OI/AAAAAAAAAFE/ZD4-8qgk__E/s72-c/PhotoChooserTask01.png' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7491841004385098831.post-4409021625019576576</id><published>2010-05-25T02:52:00.001-07:00</published><updated>2010-05-25T05:23:57.121-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='london'/><category scheme='http://www.blogger.com/atom/ns#' term='notification'/><category scheme='http://www.blogger.com/atom/ns#' term='underground'/><category scheme='http://www.blogger.com/atom/ns#' term='toast'/><category scheme='http://www.blogger.com/atom/ns#' term='tube'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Phone 7'/><category scheme='http://www.blogger.com/atom/ns#' term='tube companion'/><category scheme='http://www.blogger.com/atom/ns#' term='push'/><title type='text'>Windows Phone 7 - London Tube Companion Application</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_uTVaTcwFmrQ/S_u96RV-RFI/AAAAAAAAACk/lSMwJXGejnk/s1600/TubeCompanion-ServiceStatus.png"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 164px; height: 320px;" src="http://1.bp.blogspot.com/_uTVaTcwFmrQ/S_u96RV-RFI/AAAAAAAAACk/lSMwJXGejnk/s320/TubeCompanion-ServiceStatus.png" alt="" id="BLOGGER_PHOTO_ID_5475178580784596050" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;As part of my continual learning of Windows Phone 7, I decided to develop an application which displays the status of tube lines for the London Underground.  As well as displaying the line status, the application also allows users to request push notifications when the status of a tube line changes.&lt;br /&gt;Windows Phone 7 architecture allows for several types of push notifications, all of which are delivered by the cloud based Push Notification service.  The notification types are as follows:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Raw Notification : Raw Data is sent to the application. Only available when the application is open.&lt;/li&gt;&lt;li&gt;Tile Notification:    If the application is pinned to the phone’s start  screen, then the application’s tile can be modified.&lt;/li&gt;&lt;li&gt;Toast Application: Text based notification is displayed to the currently active screen. This does not require the application to be open.&lt;/li&gt;&lt;/ul&gt;In this example I decided to use toast notifications to inform the u&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_uTVaTcwFmrQ/S_vAzPvofxI/AAAAAAAAAEU/LJkFP59QOtw/s1600/TubeCompanion-Settings.png"&gt;&lt;img style="float: right; margin: 0pt 0pt 10px 10px; cursor: pointer; width: 164px; height: 320px;" src="http://2.bp.blogspot.com/_uTVaTcwFmrQ/S_vAzPvofxI/AAAAAAAAAEU/LJkFP59QOtw/s320/TubeCompanion-Settings.png" alt="" id="BLOGGER_PHOTO_ID_5475181758631149330" border="0" /&gt;&lt;/a&gt;ser of any changes to the tube line status, as it would allow the user to be informed no matter which application they were using on the phone.&lt;br /&gt;&lt;br /&gt;The article &lt;a href="http://windowsteamblog.com/windows_phone/b/wpdev/archive/2010/05/04/understanding-how-microsoft-push-notification-works-part-2.aspx"&gt;here &lt;/a&gt;details the push notification  architecture.  In my example the Windows Phone application is the Tube Companion  windows phone application, and the cloud application is a service which periodically polls for changes in tube status, and then sends out notifications to the relevant subscribers.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Setting up the phone application to receive toast notifications&lt;/span&gt;&lt;br /&gt;In order for the phone to receive toast notifications, the phone application must carry out the following:&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Create a channel to the Push Notification service.&lt;/span&gt; Although the phone application itself does not create the notifications, it is the phone’s responsibility to create the notification channel between itself and the push notification service.  Once the channel has been created and opened, a unique Uri for the application and device instance is created, and this can passed to any external cloud based service.  It is then the responsibility of the cloud based service to post messages to the Uri, which results in the notification being sent to the device.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Register to receive the relevant channel events&lt;/span&gt;.  The ChannelUriUpdated event is fired when the channel has been opened. Once this occurs the application and device specific Uri is available.  The ShellNotificationReceived event is fired once a toast notification is received and the application is running.  This would allow you to apply additional application logic when the application has context.  If the application is not running then this event &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_uTVaTcwFmrQ/S_vAVItzMAI/AAAAAAAAAEM/tQWs7RlgdEM/s1600/TubeCompanion-NorthernLineToastNotification.png"&gt;&lt;img style="float: right; margin: 0pt 0pt 10px 10px; cursor: pointer; width: 164px; height: 320px;" src="http://1.bp.blogspot.com/_uTVaTcwFmrQ/S_vAVItzMAI/AAAAAAAAAEM/tQWs7RlgdEM/s320/TubeCompanion-NorthernLineToastNotification.png" alt="" id="BLOGGER_PHOTO_ID_5475181241348337666" border="0" /&gt;&lt;/a&gt;would not fire and a standard toast notification would be received in the normal manner.&lt;/li&gt;&lt;/ul&gt;&lt;ul style="font-weight: bold;"&gt;&lt;li&gt;Open the channel. &lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Bind to the relevant notification type&lt;/span&gt;. In order to receive toast notifications from the Push Notification service we have to explicitly request to receive toast notifications, otherwise only raw notification types would be sent to the application.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Subscribe to notifications.&lt;/span&gt;  The Channel Uri is sent from the phone application to my cloud service, and stored in it’s notification subscription database.  The cloud service then uses this Uri in order to send notifications back to the device.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;pre name="code" class="c#"&gt; try&lt;br /&gt;{&lt;br /&gt;_httpChannel = new HttpNotificationChannel(CHANNEL_NAME, "TubeCompanionService");&lt;br /&gt;_httpChannel.ChannelUriUpdated += new EventHandler&lt;notificationchannelurieventargs&gt;(_httpChannel_ChannelUriUpdated);&lt;br /&gt;_httpChannel.Open();&lt;br /&gt;&lt;br /&gt;.....&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void _httpChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;System.Diagnostics.Debug.WriteLine("Received application uri: " + e.ChannelUri.ToString());&lt;br /&gt;_httpChannel.HttpNotificationReceived += new EventHandler&lt;httpnotificationeventargs&gt;(_httpChannel_HttpNotificationReceived);&lt;br /&gt;_httpChannel.ShellEntryPointNotificationReceived += new EventHandler&lt;notificationeventargs&gt;(_httpChannel_ShellEntryPointNotificationReceived);&lt;br /&gt;_httpChannel.ShellNotificationReceived += new EventHandler&lt;notificationeventargs&gt;(_httpChannel_ShellNotificationReceived);&lt;br /&gt;_httpChannel.ExceptionOccurred += new EventHandler&lt;notificationchannelexceptioneventargs&gt;(_httpChannel_ExceptionOccurred);&lt;br /&gt;_httpChannel.BindToShellEntryPoint();&lt;br /&gt;_httpChannel.BindToShellNotification();&lt;br /&gt;&lt;br /&gt;_tubeCompanionWS.SubscribeToNotifications(e.ChannelUri.ToString());&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/notificationchannelexceptioneventargs&gt;&lt;/notificationeventargs&gt;&lt;/notificationeventargs&gt;&lt;/httpnotificationeventargs&gt;&lt;/notificationchannelurieventargs&gt;&lt;/pre&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Setting up the service to send toast notifications&lt;/span&gt;&lt;br /&gt;In order for the  service to send toast notifications, the following needs to occur:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The toast notification XML message is created.   The XML message must conform to the schema documented &lt;a href="http://msdn.microsoft.com/en-us/library/ff402545%28v=VS.92%29.aspx"&gt;here&lt;/a&gt;, and essentially details the notification message to be displayed.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;A HttpWebRequest object is created, and is passed the phone/device instance Uri as it’s constructor.&lt;/li&gt;&lt;li&gt;The toast notification XML is converted to a byte array and passed as the content of the HttpWebRequest .&lt;/li&gt;&lt;li&gt;Request headers are set. Documented &lt;a href="http://msdn.microsoft.com/en-us/library/ff402545%28v=VS.92%29.aspx"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The HttpWebRequest is posted.  This results in the notification being sent to the application on the device.&lt;/li&gt;&lt;/ul&gt;public class PushNotification&lt;br /&gt;&lt;pre name="code" class="c#"&gt;    {&lt;br /&gt;const string MESSAGE_ID = "X-MessageID";&lt;br /&gt;const string NOTIFICATION_CLASS = "X-NotificationClass";&lt;br /&gt;const string NOTIFICATION_STATUS = "X-NotificationStatus";&lt;br /&gt;const string SUBSCRIPTION_STATUS = "X-SubscriptionStatus";&lt;br /&gt;const string DEVICE_CONNECTION_STATUS = "X-DeviceConnectionStatus";&lt;br /&gt;const string WINDOWSPHONE_TARGET_HEADER = "X-WindowsPhone-Target";&lt;br /&gt;public void SendToastNotification(Uri channelUri, string message)&lt;br /&gt;{&lt;br /&gt;ToastNotificationMessage toastMessage = new ToastNotificationMessage();&lt;br /&gt;&lt;br /&gt;HttpWebRequest request = (HttpWebRequest)WebRequest.Create(channelUri);&lt;br /&gt;request.Method = "POST";&lt;br /&gt;request.ContentType = "text/xml";&lt;br /&gt;request.Headers = new WebHeaderCollection();&lt;br /&gt;request.Headers.Add(MESSAGE_ID,Guid.NewGuid().ToString());&lt;br /&gt;request.Headers.Add(NOTIFICATION_CLASS, "2");&lt;br /&gt;//request.Headers[WINDOWSPHONE_TARGET_HEADER] = "toast";&lt;br /&gt;byte[] toastMessageBytes = toastMessage.CreateToastMessage(message);&lt;br /&gt;request.ContentLength = toastMessageBytes.Length;&lt;br /&gt;using (Stream requestStream = request.GetRequestStream())&lt;br /&gt;{&lt;br /&gt;requestStream.Write(toastMessageBytes, 0, toastMessageBytes.Length);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;HttpWebResponse response = (HttpWebResponse)request.GetResponse();&lt;br /&gt;string notificationStatus = response.Headers[NOTIFICATION_STATUS];&lt;br /&gt;string subscriptionStatus = response.Headers[SUBSCRIPTION_STATUS];&lt;br /&gt;string deviceConnectionStatus = response.Headers[DEVICE_CONNECTION_STATUS];&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class ToastNotificationMessage&lt;br /&gt;{&lt;br /&gt;public byte[] CreateToastMessage(string message)&lt;br /&gt;{&lt;br /&gt;string prefix = "Content-Type: text/xml\r\nX-WindowsPhone-Target: toast\r\n\r\n";&lt;br /&gt;StringBuilder builder = new StringBuilder();&lt;br /&gt;builder.Append("");&lt;br /&gt;builder.Append("&lt;wp:notification wp="\&amp;quot;WPNotification\&amp;quot;"&gt;");&lt;br /&gt;builder.Append("&lt;wp:toast&gt;");&lt;br /&gt;builder.Append("&lt;wp:text1&gt;");&lt;br /&gt;builder.Append(message);&lt;br /&gt;builder.Append("&lt;/wp:text1&gt;");&lt;br /&gt;builder.Append("&lt;/wp:toast&gt;");&lt;br /&gt;builder.Append("&lt;/wp:notification&gt;");&lt;br /&gt;ASCIIEncoding encoding = new ASCIIEncoding();&lt;br /&gt;string messageXML = builder.ToString();&lt;br /&gt;messageXML = prefix + messageXML;&lt;br /&gt;return encoding.GetBytes(messageXML);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Windows Phone 7 CTP April Refresh&lt;/span&gt;&lt;br /&gt;This application was built with the Windows Phone 7 CTP April refresh, and it is worth stating that there is currently an issue with this version of the emulator whereby the notification channel cannot be opened until the emulator has been running for around two minutes.  Therefore a delay has to be introduced prior to creating and opening this channel.&lt;br /&gt;&lt;br /&gt;Additionally changes to the WMAppManifest.xml also have to be made and these are documented &lt;a href="http://www.artificialignorance.net/blog/windows-phone/push-notifications-in-windows-phone-7-developer-tools-ctp-april-refresh/"&gt;here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7491841004385098831-4409021625019576576?l=andy-teamg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andy-teamg.blogspot.com/feeds/4409021625019576576/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://andy-teamg.blogspot.com/2010/05/windows-phone-7-london-tube-companion.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7491841004385098831/posts/default/4409021625019576576'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7491841004385098831/posts/default/4409021625019576576'/><link rel='alternate' type='text/html' href='http://andy-teamg.blogspot.com/2010/05/windows-phone-7-london-tube-companion.html' title='Windows Phone 7 - London Tube Companion Application'/><author><name>Andy</name><uri>http://www.blogger.com/profile/03011911310665411434</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_uTVaTcwFmrQ/S_u96RV-RFI/AAAAAAAAACk/lSMwJXGejnk/s72-c/TubeCompanion-ServiceStatus.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7491841004385098831.post-3870444297477367327</id><published>2010-05-03T06:17:00.000-07:00</published><updated>2010-05-03T11:33:40.108-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Control'/><category scheme='http://www.blogger.com/atom/ns#' term='Bing Maps'/><category scheme='http://www.blogger.com/atom/ns#' term='CTP'/><category scheme='http://www.blogger.com/atom/ns#' term='BingMapsTask'/><category scheme='http://www.blogger.com/atom/ns#' term='WMAppManifest.xml'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Phone 7'/><category scheme='http://www.blogger.com/atom/ns#' term='April'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='Refresh'/><title type='text'>Windows Phone 7 CTP April Refresh - Bing Maps Silverlight Control</title><content type='html'>The April refresh of the Windows Phone 7 CTP was released the other day, and for some reason the BingMapsTask has been removed from this release and im assuming that this had led to the Bing Maps Silverlight control not working.&lt;br /&gt;&lt;br /&gt;Ive asked a few people on the dev team about a work around, but Ive yet to receive a response. Im guessing that it would simply be a case of adding a new capability to the WMAppManifest.xml file.&lt;br /&gt;&lt;br /&gt;***UPDATE***&lt;br /&gt;&lt;br /&gt;My assumption that the removal of the BingMapsTask being removed prevented the Silverlight control from working was incorrect.  &lt;br /&gt;&lt;br /&gt;As Ryan has stated below, it was merely the issue of the Authenticode Signed Assemblies failing to load, as detailed in Tim Heur's &lt;a href="http://timheuer.com/blog/archive/2010/04/29/windows-phone-tools-update-april-2010-silverlight-xna.aspx"&gt;post&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;As Ryan correctly states, this workaround needs to be applied to &lt;br /&gt;Microsoft.Maps.MapControl.dll and System.Windows.Browser, but it also needs applying to  Microsoft.Maps.MapControl.Common&lt;br /&gt;&lt;br /&gt;Apologies if my initial post misled anyone, it wasnt my intention.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7491841004385098831-3870444297477367327?l=andy-teamg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andy-teamg.blogspot.com/feeds/3870444297477367327/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://andy-teamg.blogspot.com/2010/05/windows-phone-7-ctp-april-refresh-bing.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7491841004385098831/posts/default/3870444297477367327'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7491841004385098831/posts/default/3870444297477367327'/><link rel='alternate' type='text/html' href='http://andy-teamg.blogspot.com/2010/05/windows-phone-7-ctp-april-refresh-bing.html' title='Windows Phone 7 CTP April Refresh - Bing Maps Silverlight Control'/><author><name>Andy</name><uri>http://www.blogger.com/profile/03011911310665411434</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7491841004385098831.post-6386632138293543773</id><published>2010-04-29T08:01:00.000-07:00</published><updated>2010-04-29T08:16:51.091-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CTP'/><category scheme='http://www.blogger.com/atom/ns#' term='Phone'/><category scheme='http://www.blogger.com/atom/ns#' term='paused'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Phone 7'/><category scheme='http://www.blogger.com/atom/ns#' term='Sat Nav'/><category scheme='http://www.blogger.com/atom/ns#' term='locked'/><title type='text'>Windows Phone 7 CTP - Events when the phone is locked</title><content type='html'>If you've seen my initial blog &lt;a href="http://andy-teamg.blogspot.com/2010/04/windows-phone-7-location-services-and.html"&gt;post&lt;/a&gt; regarding the development of a Jogging application for Windows Phone 7 then you'll have seen that I raised a concern about developing the application further.&lt;br /&gt;&lt;br /&gt;Basically I was concerned that when the phone is locked, either manually or due to a lack of activity from the end user, that the application would go into a paused state thereby rendering this type of application useless.  I asked this question to Peter Torr (Microsoft Program Manager), and unfortunately this is the current behavior.  On a positive note he has stated that this area is still under investigation, so fingers crossed this may get resolved prior to launch.&lt;br /&gt;&lt;br /&gt;My gut feeling is that this would be addressed as lucrative Sat Nav applications would also be affected by the same problem, unless there's a way to code around this.&lt;br /&gt;&lt;br /&gt;The full response from Peter follows:&lt;br /&gt;&lt;br /&gt;"Hi Andy,&lt;br /&gt;&lt;br /&gt;The current builds pause the application when the phone locks (not that you can really lock the emulator) but we have been investigating ways to change this behavior for launch. You won't notice any changes in the up-coming refresh (sorry, I don't have a date for it) but any changes we make would come after that.&lt;br /&gt;&lt;br /&gt;Peter  &lt;br /&gt;"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7491841004385098831-6386632138293543773?l=andy-teamg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andy-teamg.blogspot.com/feeds/6386632138293543773/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://andy-teamg.blogspot.com/2010/04/windows-phone-7-ctp-events-when-phone.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7491841004385098831/posts/default/6386632138293543773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7491841004385098831/posts/default/6386632138293543773'/><link rel='alternate' type='text/html' href='http://andy-teamg.blogspot.com/2010/04/windows-phone-7-ctp-events-when-phone.html' title='Windows Phone 7 CTP - Events when the phone is locked'/><author><name>Andy</name><uri>http://www.blogger.com/profile/03011911310665411434</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7491841004385098831.post-6034900412833076056</id><published>2010-04-29T02:54:00.000-07:00</published><updated>2010-07-27T08:54:10.495-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WayPoint'/><category scheme='http://www.blogger.com/atom/ns#' term='Pushpin'/><category scheme='http://www.blogger.com/atom/ns#' term='service reference'/><category scheme='http://www.blogger.com/atom/ns#' term='Bing Maps'/><category scheme='http://www.blogger.com/atom/ns#' term='RouteResponse'/><category scheme='http://www.blogger.com/atom/ns#' term='RouteRequest'/><category scheme='http://www.blogger.com/atom/ns#' term='Location Services'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Phone 7'/><category scheme='http://www.blogger.com/atom/ns#' term='Route Service'/><category scheme='http://www.blogger.com/atom/ns#' term='Jogging'/><category scheme='http://www.blogger.com/atom/ns#' term='RouteServiceClient'/><title type='text'>Windows Phone 7 - Jogging Application Part 2</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_uTVaTcwFmrQ/S9lahduO6rI/AAAAAAAAACc/ug2cbEriev4/s1600/JoggingDistance.jpg"&gt;&lt;img style="margin: 0px 10px 10px 0px; width: 156px; float: left; height: 320px; cursor: hand" id="BLOGGER_PHOTO_ID_5465499153751534258" border="0" alt="" src="http://3.bp.blogspot.com/_uTVaTcwFmrQ/S9lahduO6rI/AAAAAAAAACc/ug2cbEriev4/s320/JoggingDistance.jpg" /&gt;&lt;/a&gt;  &lt;br /&gt;In an earlier &lt;a href="http://andy-teamg.blogspot.com/2010/04/windows-phone-7-location-services-and.html"&gt;blog&lt;/a&gt;, I produced a very basic application for Windows Phone 7 that allowed joggers to track their progress of a training session on a Bing Map. The application simply plotted a map polyline whenever there was a change in the device’s location, with the changes in the devices location being raised as events by the GeoCoordinateWatcher class, which is part of the Windows Phone 7 API.  &lt;br /&gt;  &lt;br /&gt;Now although the user’s training session was plotted on the map, with the start and end points being identified with pushpins on the map, the application didn’t indicate to the user the total distance travelled, so to obtain this I decided to use the Route Service, which is one of the Bing Maps Web Services.  &lt;br /&gt;  &lt;br /&gt;&lt;span style="font-weight: bold"&gt;Route Service&lt;/span&gt;  &lt;br /&gt;As the name suggests, the route service is an API used to calculate routes between designated start and end points.  &lt;br /&gt;  &lt;br /&gt;In order to use the Route service, a service reference to &lt;a href="http://dev.virtualearth.net/webservices/v1/routeservice/routeservice.svc?wsdl"&gt;http://dev.virtualearth.net/webservices/v1/routeservice/routeservice.svc?wsdl&lt;/a&gt; needs to be added to the project.   &lt;br /&gt;Please note that currently you are unable to add a service reference from a Windows Phone 7 project within the Visual Studio 2010 release candidate, although this functionality does work correctly within Visual Studio 2010 Express for Windows Phone, so you can simply add the reference there, then reopen the project from within Visual Studio.  &lt;br /&gt;  &lt;br /&gt;Upon adding the reference to the service, the RouteServiceClient becomes available. Now to calculate a route you would typically just pass to the RouteServiceClient the details of the start and end points for your route, now in my case this is still the case, but I also pass in the location details of the jogger’s entire route. This then ensures that the Route Service will use exactly the same route as that used by the jogger.  &lt;br /&gt;  &lt;br /&gt;To pass in the route details to the client, you create an instance of the RouteRequest class. This class has a WayPoints property, which is a collection that holds instances of WayPoint classes, with a WayPoint class simply acting as a container for a single location, represented by longitude and latitude.   &lt;br /&gt;  &lt;br /&gt;Once all of the Way Points have been set, you simply pass the RouteRequest to the CalculateRouteAsync method of the RouteServiceClient. Once the asynchronous call to the web service is complete a RouteResponse is returned, and this details all of the directions of the route (represented as RouteLegs), as well the total distance travelled.  &lt;br /&gt;  &lt;br /&gt;Now although the distance travelled seemed accurate to me, I needed to verify that the route returned by the route service, was identical to each of the locations that I had passed to it. To do this I simply iterated through each of the returned RouteLegs and overlaid them as a new Map Polyline on my Bing Map. Seeing this overlay on the map verified that the data returned was as expected.  &lt;br /&gt;  &lt;pre class="c#" name="code"&gt;&lt;br /&gt; private void CalculateRoute()&lt;br /&gt; {&lt;br /&gt;   RouteRequest routeRequest = new RouteRequest();&lt;br /&gt;   ApplicationIdCredentialsProvider mapCredentials = (ApplicationIdCredentialsProvider)Application.Current.Resources[&amp;quot;MapCredentials&amp;quot;];&lt;br /&gt;   string credentialID = mapCredentials.ApplicationId; &lt;br /&gt;   routeRequest.Credentials = new Credentials() { ApplicationId = credentialID };&lt;br /&gt;   Waypoint[] waypoints = new Waypoint[_joggingSession.Locations.Count];&lt;br /&gt;   for (int i = 0; i &amp;lt; waypoints.Length; i++)&lt;br /&gt;   {&lt;br /&gt;     Waypoint waypoint = new Waypoint();&lt;br /&gt;     waypoint.Location = new Location(_joggingSession.Locations[i].Latitude, _joggingSession.Locations[i].Longitude);&lt;br /&gt;     waypoints[i] = waypoint;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   routeRequest.Waypoints = waypoints;&lt;br /&gt;   RoutingService.RouteServiceClient routeService = new RouteServiceClient(&amp;quot;BasicHttpBinding_IRouteService&amp;quot;);&lt;br /&gt;   routeService.CalculateRouteCompleted += new EventHandler&lt;calculateroutecompletedeventargs&gt;(routeService_CalculateRouteCompleted);&lt;br /&gt;   routeRequest.Options = new RouteOptions();&lt;br /&gt;   routeRequest.Options.Mode = TravelMode.Walking;&lt;br /&gt;   routeRequest.UserProfile = new UserProfile() { DistanceUnit = DistanceUnit.Mile };&lt;br /&gt;   routeService.CalculateRouteAsync(routeRequest);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; void routeService_CalculateRouteCompleted(object sender, CalculateRouteCompletedEventArgs e)&lt;br /&gt; {&lt;br /&gt;   RouteResponse routeResponse = e.Result;&lt;br /&gt;   _joggingSession.DistanceTravelled = routeResponse.Result.Summary.Distance;&lt;br /&gt;   DistanceTravelled.Text =  _joggingSession.DistanceTravelled.ToString(&amp;quot;000.00&amp;quot;) + &amp;quot; miles&amp;quot;;&lt;br /&gt;   //verfiy distance travelled by overlaying the returned route on top of the real time route.&lt;br /&gt;   foreach (RouteLeg routeLeg in routeResponse.Result.Legs)&lt;br /&gt;   {&lt;br /&gt;     _routePolyLine.Locations.Add(routeLeg.ActualStart);&lt;br /&gt;     _routePolyLine.Locations.Add(routeLeg.ActualEnd);&lt;br /&gt;   }&lt;br /&gt; }&lt;/pre&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7491841004385098831-6034900412833076056?l=andy-teamg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andy-teamg.blogspot.com/feeds/6034900412833076056/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://andy-teamg.blogspot.com/2010/04/windows-phone-7-jogging-application.html#comment-form' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7491841004385098831/posts/default/6034900412833076056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7491841004385098831/posts/default/6034900412833076056'/><link rel='alternate' type='text/html' href='http://andy-teamg.blogspot.com/2010/04/windows-phone-7-jogging-application.html' title='Windows Phone 7 - Jogging Application Part 2'/><author><name>Andy</name><uri>http://www.blogger.com/profile/03011911310665411434</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_uTVaTcwFmrQ/S9lahduO6rI/AAAAAAAAACc/ug2cbEriev4/s72-c/JoggingDistance.jpg' height='72' width='72'/><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7491841004385098831.post-7854626112502958574</id><published>2010-04-20T08:03:00.001-07:00</published><updated>2010-07-27T08:53:38.955-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Pushpin'/><category scheme='http://www.blogger.com/atom/ns#' term='Bing Maps'/><category scheme='http://www.blogger.com/atom/ns#' term='Location Services'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Phone 7'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='GeoCoordinateWatcher'/><title type='text'>Windows Phone 7 With Location Services And Bing Maps</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_uTVaTcwFmrQ/S84nTjJbS5I/AAAAAAAAACU/jhRGYMVjZnw/s1600/RecordJog01.jpg"&gt;&lt;img style="margin: 0px 10px 10px 0px; width: 160px; float: left; height: 320px; cursor: hand" id="BLOGGER_PHOTO_ID_5462346614852766610" border="0" alt="" src="http://2.bp.blogspot.com/_uTVaTcwFmrQ/S84nTjJbS5I/AAAAAAAAACU/jhRGYMVjZnw/s320/RecordJog01.jpg" /&gt;&lt;/a&gt;  &lt;br /&gt;Recently Microsoft released the CTP toolkit for Windows Phone 7, available &lt;a href="http://developer.windowsphone.com/windows-phone-7-series/"&gt;here &lt;/a&gt;, and I decided to produce a small application which uses the location services functionality of the phone, as well as the Silverlight Bing Maps user control.  &lt;br /&gt;  &lt;br /&gt;The application is aimed at joggers/runners, and simply allows users to start and end a running session and view their progress on a map. At the end of their session, the relevant start and end points are displayed on the map as pins, and the total time of the workout session along with total distance travelled is also displayed.  &lt;br /&gt;  &lt;br /&gt;&lt;font size="4"&gt;Location Services&lt;/font&gt;  &lt;br /&gt;  &lt;br /&gt;Location services within Windows Phone 7 provides a location based api, which allows consumers to track their current geocoordinates, as well as the status of their location based device. It is worth noting that location services is not just GPS tracking, as the service can also determine a devices location from wireless networks, assisted gps etc.  &lt;br /&gt;  &lt;br /&gt;One of the challenges of utilising Location Services within the CTP version of the toolkit, is that there is no built in mechanism to emulate a devices current location, or any positional changes of the device. To get around this problem you currently have to create a mock version of the &lt;b&gt;GeoCoordinateWatcher&lt;/b&gt; class, as it is this class that is responsible for raising events in relation to a device's status and position. My mock class, MockGeoCoordinateWatcher is based upon Tim Heur's EventListGeoLocationMock class, and I'd encourage you all to read Tim's excellent &lt;a href="http://timheuer.com/blog/archive/2010/03/22/geo-location-services-in-windows-phone-7-developer-emulator.aspx"&gt;post&lt;/a&gt;.  &lt;br /&gt;  &lt;br /&gt;Before we start receiving positional change events ,we need to create an instance of the MockGeoCoordinateWatcher class and pass it a sample of the geocoordinates that we would like to be raised as our devices position. We then wire up an event handler to the PositionChanged event, which as you can guess by its name is respsonsible for notifying us of changes of position. The _geowatcher instance also needs to be started and stopped in order to start/stop receving events.  &lt;br /&gt;  &lt;br /&gt;When the PositionChanged event is raised it passes a GeoCoordinate class as an event argument, and this class consists of the time that the position changed occurred, along with a location containing the latitidude and longitude coordinates of the position. In this application these geo-coordinates are simply added to a list which is then used at a later stage by the Bing Maps routing service to determine the total distance traveled, as well as being passed to the map to draw the users current progress.  &lt;br /&gt;  &lt;pre class="c#" name="code"&gt;namespace TeamG.Sprinter&lt;br /&gt;{&lt;br /&gt;public partial class MainPage : PhoneApplicationPage&lt;br /&gt;{&lt;br /&gt;   IGeoPositionWatcher&lt;geocoordinate&gt; _geoWatcher;&lt;br /&gt;   List&lt;geoposition&gt;&lt;geocoordinate&gt;&amp;gt; _geoPositions;&lt;br /&gt;   MapPolyline _joggingPolyLine;&lt;br /&gt;&lt;br /&gt;   public MainPage()&lt;br /&gt;   {&lt;br /&gt;       InitializeComponent();&lt;br /&gt;&lt;br /&gt;       SupportedOrientations = SupportedPageOrientation.Portrait | SupportedPageOrientation.Landscape;&lt;br /&gt;&lt;br /&gt;       _geoWatcher = new MockGeoCoordinateWatcher(MockGeoHelper.CreateMockGeoCoordinateEvents());&lt;br /&gt;       _geoWatcher.PositionChanged += new EventHandler&lt;geopositionchangedeventargs&gt;&lt;geocoordinate&gt;&amp;gt;(watcher_PositionChanged);&lt;br /&gt;&lt;br /&gt;       _geoPositions = new List&lt;geoposition&gt;&lt;geocoordinate&gt;&amp;gt;();&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   void watcher_PositionChanged(object sender, GeoPositionChangedEventArgs&lt;geocoordinate&gt; e)&lt;br /&gt;   {&lt;br /&gt;       Deployment.Current.Dispatcher.BeginInvoke(() =&amp;gt; GeoPositionChanged(e));&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   void GeoPositionChanged(GeoPositionChangedEventArgs&lt;geocoordinate&gt; e)&lt;br /&gt;   {&lt;br /&gt;       _geoPositions.Add(e.Position);&lt;br /&gt;       _joggingPolyLine.Locations.Add(new Location(e.Position.Location.Latitude, e.Position.Location.Longitude));&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   private void StartJogging_Click(object sender, RoutedEventArgs e)&lt;br /&gt;   {&lt;br /&gt;       _geoWatcher.Start();&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   private void StopJogging_Click(object sender, RoutedEventArgs e)&lt;br /&gt;   {&lt;br /&gt;       _geoWatcher.Stop();&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/geocoordinate&gt;&lt;/geocoordinate&gt;&lt;/geocoordinate&gt;&lt;/geoposition&gt;&lt;/geocoordinate&gt;&lt;/geopositionchangedeventargs&gt;&lt;/geocoordinate&gt;&lt;/geoposition&gt;&lt;/geocoordinate&gt;&lt;/pre&gt;&lt;br /&gt;It is worth noting that on a production device that the GeoCoordinateWatcher class should be used with care, and not kept in a Started state when not required, as this would potentially be a big drain on the device's battery.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;font size="4"&gt;Bing Maps&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Working with Bing Maps in Silverlight, and thereby Windows Phone 7 is straight forward thanks to the &lt;a href="http://www.microsoft.com/maps/developers/"&gt;Bing Maps Silverlight User Control&lt;/a&gt;. To use the map in our application we first need to reference the relevant assemblies within the project &lt;todo:&gt;&lt;list&gt;, then reference the MapControl namespace in the page's namespace declaration.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;phonenavigation:phoneapplicationpage class="TeamG.Sprinter.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" foreground="{StaticResource PhoneForegroundBrush}" fontsize="{StaticResource PhoneFontSizeNormal}" fontfamily="{StaticResource PhoneFontFamilyNormal}" designheight="800" designwidth="480" ignorable="d" m="clr-namespace:Microsoft.Maps.MapControl;assembly=Microsoft.Maps.MapControl" mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d="http://schemas.microsoft.com/expression/blend/2008" phonenavigation="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Navigation" x="http://schemas.microsoft.com/winfx/2006/xaml"&gt;&lt;font size="2"&gt;x:Class=&amp;quot;TeamG.Sprinter.MainPage&amp;quot;&lt;br /&gt;  &lt;br /&gt;xmlns=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;xmlns:x=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;xmlns:phoneNavigation=&amp;quot;clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Navigation&amp;quot;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;xmlns:d=&amp;quot;http://schemas.microsoft.com/expression/blend/2008&amp;quot;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;xmlns:mc=&amp;quot;http://schemas.openxmlformats.org/markup-compatibility/2006&amp;quot;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;xmlns:m=&amp;quot;clr-namespace:Microsoft.Maps.MapControl;assembly=Microsoft.Maps.MapControl&amp;quot;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;mc:Ignorable=&amp;quot;d&amp;quot; d:DesignWidth=&amp;quot;480&amp;quot; d:DesignHeight=&amp;quot;800&amp;quot;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;FontFamily=&amp;quot;{StaticResource PhoneFontFamilyNormal}&amp;quot;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;FontSize=&amp;quot;{StaticResource PhoneFontSizeNormal}&amp;quot;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;Foreground=&amp;quot;{StaticResource PhoneForegroundBrush}&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;/font&gt;Next, we modify our XAML to simply create a map instance, specifiying a Bing Maps key, the required zoom level, and the mode that we wish to view the Map.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;font size="2"&gt;&lt;m:map&gt;&lt;br /&gt;Name=&amp;quot;JoggingMap&amp;quot;&lt;br /&gt;  &lt;br /&gt;CredentialsProvider=&amp;quot;Youll jave to use your own value&amp;quot;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;Mode=&amp;quot;Road&amp;quot;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;ZoomLevel=&amp;quot;16&amp;quot;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;Center=&amp;quot;53.32058,-2.73706&amp;quot;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;Grid.Row=&amp;quot;0&amp;quot;/&amp;gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Before the lines can be drawn we need to create an instance of the MapPolyLine class, set it's UI properties, then pass it as a UI element to the map.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="c#" name="code"&gt;_joggingPolyLine = new MapPolyline();&lt;br /&gt;_joggingPolyLine.Stroke = new SolidColorBrush(Colors.Blue);&lt;br /&gt;_joggingPolyLine.StrokeThickness = 5;&lt;br /&gt;_joggingPolyLine.Opacity = 0.7;&lt;br /&gt;_joggingPolyLine.Locations = new LocationCollection();&lt;br /&gt;JoggingMap.Children.Add(_joggingPolyLine);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now everytime that the PositionChanged event is fired, we simply add the geo-coordinates as a new location within the MapPolyLine instance, and this has the effect of drawing a line from the previous coordinate to the new coordinate.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="c#" name="code"&gt;void GeoPositionChanged(GeoPositionChangedEventArgs&amp;lt;?XML:NAMESPACE PREFIX = [default] http://schemas.microsoft.com/winfx/2006/xaml/presentation NS = &amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot; /&amp;gt;&lt;geocoordinate&gt; e)&lt;br /&gt;{&lt;br /&gt;_geoPositions.Add(e.Position);&lt;br /&gt;_joggingPolyLine.Locations.Add(new Location(e.Position.Location.Latitude, e.Position.Location.Longitude));&lt;br /&gt;}&lt;br /&gt;&lt;/geocoordinate&gt;&lt;/pre&gt;&lt;br /&gt;Once the user has ended their workout session, the application then adds a push pin for both the start and end position of the workout. This is done by simply querying for the first and last geo-coordinates, out of all which have been raised, then creating a push pin for each one.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="c#" name="code"&gt;private void CreateStartEndPushpins()&lt;br /&gt;{&lt;br /&gt;Pushpin startPin = new Pushpin();&lt;br /&gt;Pushpin endPin = new Pushpin();&lt;br /&gt;startPin.Location = new Location(_geoPositions[0].Location.Latitude, _geoPositions[0].Location.Longitude);&lt;br /&gt;endPin.Location = new Location(_geoPositions.Last().Location.Latitude, _geoPositions.Last().Location.Longitude);&lt;br /&gt;JoggingMap.Children.Add(startPin);&lt;br /&gt;JoggingMap.Children.Add(endPin);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In a nutshell thats the core of the application completed. The images below show the application running, and you'll notice how the user's progress is tracked as they jog around.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_uTVaTcwFmrQ/S84mvQWpw7I/AAAAAAAAAB8/pjoEQ69gx8A/s1600/RecordJog02.jpg"&gt;&lt;img style="width: 161px; height: 320px; cursor: hand" id="BLOGGER_PHOTO_ID_5462345991332676530" border="0" alt="" src="http://3.bp.blogspot.com/_uTVaTcwFmrQ/S84mvQWpw7I/AAAAAAAAAB8/pjoEQ69gx8A/s320/RecordJog02.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_uTVaTcwFmrQ/S84nA0aMCLI/AAAAAAAAACE/mY5luxm3LwE/s1600/RecordJog03.jpg"&gt;&lt;img style="width: 163px; height: 320px; cursor: hand" id="BLOGGER_PHOTO_ID_5462346293068957874" border="0" alt="" src="http://4.bp.blogspot.com/_uTVaTcwFmrQ/S84nA0aMCLI/AAAAAAAAACE/mY5luxm3LwE/s320/RecordJog03.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_uTVaTcwFmrQ/S84nIhwTKQI/AAAAAAAAACM/pNK6B18pws8/s1600/RecordJog04.jpg"&gt;&lt;img style="width: 163px; height: 320px; cursor: hand" id="BLOGGER_PHOTO_ID_5462346425500379394" border="0" alt="" src="http://2.bp.blogspot.com/_uTVaTcwFmrQ/S84nIhwTKQI/AAAAAAAAACM/pNK6B18pws8/s320/RecordJog04.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The next phase of the application will use the Bing Maps Route Service web service in order to determine the distance travelled.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A potential stumbling block with this kind of application could be due to its long running nature. From the documentation that Ive currently read, it is unclear whether the phone framework will attempt to pause the application thereby rendering it useless when the phone goes into a locked/inactive state. Ive raised this question to the Windows Phone 7 development team, but Ive yet to receive a response. As soon as I get a response on this then Ill post an update.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Hope this is of some use to you.  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7491841004385098831-7854626112502958574?l=andy-teamg.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andy-teamg.blogspot.com/feeds/7854626112502958574/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://andy-teamg.blogspot.com/2010/04/windows-phone-7-location-services-and.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7491841004385098831/posts/default/7854626112502958574'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7491841004385098831/posts/default/7854626112502958574'/><link rel='alternate' type='text/html' href='http://andy-teamg.blogspot.com/2010/04/windows-phone-7-location-services-and.html' title='Windows Phone 7 With Location Services And Bing Maps'/><author><name>Andy</name><uri>http://www.blogger.com/profile/03011911310665411434</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_uTVaTcwFmrQ/S84nTjJbS5I/AAAAAAAAACU/jhRGYMVjZnw/s72-c/RecordJog01.jpg' height='72' width='72'/><thr:total>2</thr:total></entry></feed>
