日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > windows >内容正文

windows

Windows 8实用窍门系列:9.Windows 8中使用FlipView

發布時間:2025/3/8 windows 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Windows 8实用窍门系列:9.Windows 8中使用FlipView 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

  FlipView控件類似于翻頁控件,并且是現成的翻頁按鈕,你只需要為其增加數據項即可。本文講述兩種方式的FlipView項目和展示。

  一:直接前臺FlipViewItem

<FlipView><FlipViewItem><Image Stretch="Uniform" Source="http://imgcache.qq.com/club/item/wallpic/items/2/3802/760_300_3802.jpg"/></FlipViewItem><FlipViewItem><Image Stretch="Uniform" Source="http://imgcache.qq.com/club/item/wallpic/items/3/4023/c_760_300_4023.jpg"/></FlipViewItem><FlipViewItem><Image Stretch="Uniform" Source="http://imgcache.qq.com/club/item/wallpic/items/3/3673/c_760_300_3673.jpg"/></FlipViewItem><FlipViewItem><Image Stretch="Uniform" Source="http://imgcache.qq.com/club/item/wallpic/items/7/4017/c_760_300_4017.jpg"/></FlipViewItem><FlipViewItem><Image Stretch="Uniform" Source="http://imgcache.qq.com/club/item/wallpic/items/2/3972/c_760_300_3972.jpg"/></FlipViewItem></FlipView>

  效果如下:

  二:前臺設置DataTemplate,后臺實體集方式添加數據項。

<FlipView Name="fvShow" Margin="100"><FlipView.ItemTemplate><DataTemplate><Grid><Grid.Background><ImageBrush Stretch="Uniform" ImageSource="{Binding ImgUrl}"/></Grid.Background><TextBlock Height="30" VerticalAlignment="Top" HorizontalAlignment="Left"Margin="180 300 0 0" FontSize="20" Foreground="Blue" Text="{Binding ImgName}"/><TextBlock Height="30" VerticalAlignment="Top" HorizontalAlignment="Left"Margin="180 350 0 0" FontSize="20" Foreground="Blue" Text="{Binding ImgAddr}"/></Grid></DataTemplate></FlipView.ItemTemplate></FlipView> /// <summary>/// 可用于自身或導航至 Frame 內部的空白頁。/// </summary>public sealed partial class MainPage : Page{public MainPage(){this.InitializeComponent();this.fvShow.ItemsSource = ImgModel.GetImgData();}/// <summary>/// 在此頁將要在 Frame 中顯示時進行調用。/// </summary>/// <param name="e">描述如何訪問此頁的事件數據。Parameter/// 屬性通常用于配置頁。</param>protected override void OnNavigatedTo(NavigationEventArgs e){}}/// <summary>/// 圖片實體/// </summary>public class ImgModel{/// <summary>/// 圖片名字/// </summary>public string ImgName { get; set; }/// <summary>/// 圖片地址/// </summary>public string ImgAddr { get; set; }/// <summary>/// 圖片URL/// </summary>public string ImgUrl { get; set; }public static List<ImgModel> GetImgData(){List<ImgModel> list = new List<ImgModel>();list.Add(new ImgModel() { ImgName = "名字:北京冬景", ImgAddr = "地址:北京市", ImgUrl = "http://imgcache.qq.com/club/item/wallpic/items/2/3922/760_300_3922.jpg" });list.Add(new ImgModel() { ImgName = "名字:上海春景", ImgAddr = "地址:上海市", ImgUrl = "http://imgcache.qq.com/club/item/wallpic/items/7/3147/760_300_3147.jpg" });list.Add(new ImgModel() { ImgName = "名字:天津秋景", ImgAddr = "地址:天津市", ImgUrl = "http://imgcache.qq.com/club/item/wallpic/items/6/3966/c_760_300_3966.jpg" });list.Add(new ImgModel() { ImgName = "名字:海南夏景", ImgAddr = "地址:海南市", ImgUrl = "http://imgcache.qq.com/club/item/wallpic/items/5/3695/760_300_3695.jpg" });list.Add(new ImgModel() { ImgName = "名字:成都風景", ImgAddr = "地址:成都市", ImgUrl = "http://imgcache.qq.com/club/item/wallpic/items/8/2518/760_300_2518.jpg" });return list;}}

  看此方式的效果如下:

  最后如需源碼請點擊?Win8FlipView.rar 下載。

總結

以上是生活随笔為你收集整理的Windows 8实用窍门系列:9.Windows 8中使用FlipView的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。