Device(裝置)之位置服務(GPS 定位), FM 收音機, 麥克風, 震動器
介紹
與眾不同 windows phone 7.5 (sdk 7.1) 之裝置
位置服務(GPS 定位)
FM 收音機
麥克風
震動器
樣本
1、示範如何使用位置服務(GPS 定位)
GpsDemo.xaml
<phone:PhoneApplicationPage x:Class="Demo.Device.GpsDemo" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone" xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="{StaticResource PhoneForegroundBrush}" SupportedOrientations="Portrait" Orientation="Portrait" mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480" shell:SystemTray.IsVisible="True"> <Grid x:Name="LayoutRoot" Background="Transparent"> <StackPanel Orientation="Vertical"> <!--跳轉到隱私權聲明頁(如果使用了 GPS 則必須要有“隱私權聲明”,否則不會通過微軟的審核)--> <HyperlinkButton Content="隱私權聲明" NavigateUri="/Device/PrivacyPolicy.xaml" FontSize="{StaticResource PhoneFontSizeNormal}" Margin="10,6" HorizontalAlignment="Left" /> <TextBlock Name="lblStatus" /> <Button Name="btnLow" Content="低精度定位" Click="btnLow_Click" /> <Button Name="btnHigh" Content="高精度定位" Click="btnHigh_Click" /> <Button Name="btnClose" Content="關閉定位" Click="btnClose_Click" /> <TextBlock Name="lblMsg" /> </StackPanel> </Grid> </phone:PhoneApplicationPage>