成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

Windows Phone開發(26):啟動器與選擇器之五

移動開發
Windows Phone是微軟發布的一款手機操作系統,它將微軟旗下的Xbox Live游戲、Xbox Music音樂與獨特的視頻體驗整合至手機中。

啟動器與選擇器簡單的地方在于,它們的使用方法幾乎一模一樣,從前面幾節中,我相信大家基本上都知道如何使用它們了。
這里還是哆嗦一下吧,使用啟動器和選擇器的步驟如下:
1、實例化,new一個;
2、準備各參數,對相關的屬性賦值;
3、Show;
4、對于啟動器,不需要這步,但選擇器有返回數據,所以需要處理完成事件。

本節再舉兩例子,啟動器和選擇器就可以完成了,然后我們下一節開始,探討新的知識點。

例一:媒體播放器。

這是一個啟動器,用起來更方便。
主要屬性有:
Controls——要顯示控制按鈕,如暫集,停止等,它是一個帶了Flags特性標記的枚舉,所以可以多個值合并,如MediaPlaybackControls.Pause | MediaPlaybackControls.Stop

Location——要播放媒體的位置,Data表示文件存放在獨立存儲中,Install表示項目中的媒體文件;

Media——要播放文件的URI;

Orientation——這個更好懂了,媒體播放器的方向, 是水平還是垂直,和頁面方向一個概念。

  1. <phone:PhoneApplicationPage    
  2.     x:Class="sampleApp.MainPage"   
  3.     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"   
  4.     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"   
  5.     xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"   
  6.     xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"   
  7.     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"   
  8.     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"   
  9.     mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"   
  10.     FontFamily="{StaticResource PhoneFontFamilyNormal}"   
  11.     FontSize="{StaticResource PhoneFontSizeNormal}"   
  12.     Foreground="{StaticResource PhoneForegroundBrush}"   
  13.     SupportedOrientations="Portrait" Orientation="Portrait"   
  14.     shell:SystemTray.IsVisible="True">   
  15.     <!--LayoutRoot 是包含所有頁面內容的根網格-->   
  16.     <Grid x:Name="LayoutRoot" Background="Transparent">   
  17.         <Grid.RowDefinitions>   
  18.             <RowDefinition Height="Auto"/>   
  19.             <RowDefinition Height="*"/>   
  20.         </Grid.RowDefinitions>   
  21.         <!--TitlePanel 包含應用程序的名稱和頁標題-->   
  22.         <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">   
  23.             <TextBlock x:Name="ApplicationTitle" Text="我的應用程序" Style="{StaticResource PhoneTextNormalStyle}"/>   
  24.             <TextBlock x:Name="PageTitle" Text="頁面名稱" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>   
  25.         </StackPanel>   
  26.         <!--ContentPanel - 在此處放置其他內容-->   
  27.         <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">   
  28.             <Button Content="啟動媒體播放器" Height="126" HorizontalAlignment="Left" Margin="31,116,0,0" Name="button1" VerticalAlignment="Top" Width="381" Click="button1_Click" />   
  29.         </Grid>   
  30.     </Grid>   
  31. </phone:PhoneApplicationPage>  
  1. using System;   
  2. using System.Collections.Generic;   
  3. using System.Linq;   
  4. using System.Net;   
  5. using System.Windows;   
  6. using System.Windows.Controls;   
  7. using System.Windows.Documents;   
  8. using System.Windows.Input;   
  9. using System.Windows.Media;   
  10. using System.Windows.Media.Animation;   
  11. using System.Windows.Shapes;   
  12. using Microsoft.Phone.Controls;   
  13. using Microsoft.Phone.Tasks;   
  14. namespace sampleApp   
  15. {   
  16.     public partial class MainPage : PhoneApplicationPage   
  17.     {   
  18.         // 構造函數   
  19.         public MainPage()   
  20.         {   
  21.             InitializeComponent();   
  22.         }   
  23.         private void button1_Click(object sender, RoutedEventArgs e)   
  24.         {   
  25.             MediaPlayerLauncher player = new MediaPlayerLauncher();   
  26.             player.Controls = MediaPlaybackControls.All;   
  27.             player.Location = MediaLocationType.Install;   
  28.             player.Media = new Uri("分飛燕.mp3", UriKind.Relative);   
  29.             player.Orientation = MediaPlayerOrientation.Portrait;   
  30.             player.Show();   
  31.         }   
  32.     }   
  33. }   

例二:搜索任務。

SearchTask類也是一個啟動器,這個家伙更簡單了,它只有一個屬性要設置——SearchQuery,就是我們要搜索的關鍵字。

  1. <phone:PhoneApplicationPage    
  2.     x:Class="sampleApp.Page1"   
  3.     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"   
  4.     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"   
  5.     xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"   
  6.     xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"   
  7.     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"   
  8.     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"   
  9.     FontFamily="{StaticResource PhoneFontFamilyNormal}"   
  10.     FontSize="{StaticResource PhoneFontSizeNormal}"   
  11.     Foreground="{StaticResource PhoneForegroundBrush}"   
  12.     SupportedOrientations="Landscape" Orientation="Landscape"   
  13.     mc:Ignorable="d" d:DesignHeight="480" d:DesignWidth="728"   
  14.     shell:SystemTray.IsVisible="True">   
  15.     <!--LayoutRoot 是包含所有頁面內容的根網格-->   
  16.     <Grid x:Name="LayoutRoot" Background="Transparent">   
  17.         <Grid.RowDefinitions>   
  18.             <RowDefinition Height="Auto"/>   
  19.             <RowDefinition Height="*"/>   
  20.         </Grid.RowDefinitions>   
  21.         <!--TitlePanel 包含應用程序的名稱和頁標題-->   
  22.         <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">   
  23.             <TextBlock x:Name="ApplicationTitle" Text="我的應用程序" Style="{StaticResource PhoneTextNormalStyle}"/>   
  24.             <TextBlock x:Name="PageTitle" Text="搜索" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>   
  25.         </StackPanel>   
  26.         <!--ContentPanel - 在此處放置其他內容-->   
  27.         <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">   
  28.             <TextBox Height="72" HorizontalAlignment="Left" Margin="12,86,0,0" Name="txtKey" VerticalAlignment="Top" Width="460" />   
  29.             <Button Content="搜索" Height="72" HorizontalAlignment="Left" Margin="480,86,0,0" Name="button1" VerticalAlignment="Top" Width="160" Click="button1_Click" />   
  30.         </Grid>   
  31.     </Grid>   
  32. </phone:PhoneApplicationPage> 
  1. using System;   
  2. using System.Collections.Generic;   
  3. using System.Linq;   
  4. using System.Net;   
  5. using System.Windows;   
  6. using System.Windows.Controls;   
  7. using System.Windows.Documents;   
  8. using System.Windows.Input;   
  9. using System.Windows.Media;   
  10. using System.Windows.Media.Animation;   
  11. using System.Windows.Shapes;   
  12. using Microsoft.Phone.Controls;   
  13. using Microsoft.Phone.Tasks;   
  14. namespace sampleApp   
  15. {   
  16.     public partial class Page1 : PhoneApplicationPage   
  17.     {   
  18.         public Page1()   
  19.         {   
  20.             InitializeComponent();   
  21.         }   
  22.         private void button1_Click(object sender, RoutedEventArgs e)   
  23.         {   
  24.             SearchTask searcher = new SearchTask();   
  25.             searcher.SearchQuery = txtKey.Text;   
  26.             searcher.Show();   
  27.         }   
  28.     }   
  29. }  

下一節開始,我們討論獨立存儲。

還有就是提一下建議,博客編輯器有問題,每次都這樣,***次自動保存草稿后,后面就不會保存了,編輯器內的文本無法選定。而點擊發表時沒有反應,非得刷新頁面。

責任編輯:閆佳明 來源: oschina
相關推薦

2013-04-18 13:56:09

Windows Pho啟動器與選擇器

2013-04-18 13:47:43

Windows Pho啟動器與選擇器發送短信

2013-04-18 11:13:04

Windows Pho啟動器與選擇器BingMapsDir

2013-04-18 13:28:19

Windows Pho啟動器與選擇器

2012-06-20 10:21:50

Windows Pho

2012-06-21 10:59:31

Windows Pho

2025-03-28 02:44:00

2010-08-06 15:44:28

Windows PhoWindows PhoSilverlight

2010-04-12 17:32:59

Windows Pho

2011-10-19 09:56:58

Gnome Pie程序啟動器

2010-09-02 11:26:33

CSS選擇器偽類

2012-04-16 14:32:31

iOS選擇器代碼

2013-07-31 13:13:50

Windows PhoMVVM模式

2011-11-28 13:42:55

Sencha Touc組件選擇器

2012-12-27 14:08:39

Android開發顏色選擇器

2017-03-20 14:46:07

Android日期時間選擇器

2009-06-30 13:58:00

Java啟動器

2013-04-24 13:31:59

Windows Pho動畫之ColorAni

2013-04-24 13:19:06

Windows Pho動畫DoubleAni

2013-04-19 17:11:02

Windows PhoWindows Pho
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 日韩在线一区二区 | 四虎影视1304t | 欧美性大战久久久久久久蜜臀 | av毛片在线免费观看 | 亚洲电影专区 | 国产福利在线播放麻豆 | 日本一卡精品视频免费 | 日本不卡免费新一二三区 | 日韩免费视频一区二区 | 成人精品一区二区 | 成人av鲁丝片一区二区小说 | 99精品一级欧美片免费播放 | 中文字幕乱码视频32 | a黄视频 | 一本综合久久 | 黄色一级大片视频 | 久久精品亚洲精品 | 久久男人| 欧美成视频 | 欧美日韩精品综合 | 国产精品美女在线观看 | 精品国产乱码久久久久久丨区2区 | 免费一区二区 | 欧美一级二级视频 | 91亚洲国产成人久久精品网站 | 日日操av| 狠狠干天天干 | 国产中文视频 | 亚洲乱码国产乱码精品精98午夜 | 亚州成人 | 日本激情视频中文字幕 | 亚洲一区二区三区四区视频 | 成人影视网址 | 亚洲精品99 | av手机免费在线观看 | 麻豆视频国产在线观看 | 久久久久国产 | 日韩在线观看精品 | 日韩不卡在线观看 | 99热在这里只有精品 | 国产日韩欧美一区二区 |