These styles were provided with the starter solution and are located in the DefaultStyle.xaml resource file. XAML <Button x:Name="ButtonZoomIn" Style="{StaticResource ButtonZoomInStyle}" HorizontalAlignment="Left" VerticalAlignment="Top" Height="56" Width="56" Margin="8,180,0,0" Click="ButtonZoomIn_Click" /> <Button x:Name="ButtonZoomOut" Style="{StaticResource ButtonZoomOutStyle}" HorizontalAlignment="Left" VerticalAlignment="Top" Height="56" Width="56" Margin="8,260,0,0" Click="ButtonZoomOut_Click" /> To test the results, press F5 and click the zoom-in and zoom-out buttons. Figure 8 Zoom out Figure 9 Zoom in In the next step you’ll center the map to your geographic location. Since this lab works with the emulator, you don’t have a real GPS device. So you’ll have to pre-define your geographic location using latitude and longitude coordinates. You can determine your geographic location by browsing to , set your location, and then Note: copy the Latitude and Longitude coordinates from the address bar. In the MainPage.xaml.cs, add a new static, read-only field of type System.Device.Location.GeoCoordinate, called DefaultLocation, and set it with a new instance using your latitude and longitude coordinates. This will be your current location. C# private static readonly GeoCoordinate DefaultLocation = new GeoCoordinate(47.639631, -122.127713);
These styles were provided with the starter solution and are located in the DefaultStyle.xaml resource file. XAML <Button x:Name="ButtonZoomIn" Style="{StaticResource ButtonZoomInStyle}" HorizontalAlignment="Left" VerticalAlignment="Top" Height="56" Width="56" Margin="8,180,0,0" Click="ButtonZoomIn_Click" /> <Button x:Name="ButtonZoomOut" Style="{StaticResource ButtonZoomOutStyle}" HorizontalAlignment="Left" VerticalAlignment="Top" Height="56" Width="56" Margin="8,260,0,0" Click="ButtonZoomOut_Click" /> To test the results, press F5 and click the zoom-in and zoom-out buttons. Figure 8 Zoom out Figure 9 Zoom in In the next step you’ll center the map to your geographic location. Since this lab works with the emulator, you don’t have a real GPS device. So you’ll have to pre-define your geographic location using latitude and longitude coordinates. Note: You can determine your geographic location by browsing to , set your location, and then copy the Latitude and Longitude coordinates from the address bar. In the MainPage.xaml.cs, add a new static, read-only field of type System.Device.Location.GeoCoordinate, called DefaultLocation, and set it with a new instance using your latitude and longitude coordinates. This will be your current location. C# private static readonly GeoCoordinate DefaultLocation = new GeoCoordinate(47.639631, -122.127713);
UsingBingMaps.docx