博客
关于我
Windows 8实用窍门系列:9.Windows 8中使用FlipView
阅读量:730 次
发布时间:2019-03-22

本文共 2515 字,大约阅读时间需要 8 分钟。

  FlipView控件类似于翻页控件,并且是现成的翻页按钮,你只需要为其增加数据项即可。本文讲述两种方式的FlipView项目和展示。

  一:直接前台FlipViewItem

  效果如下:

  二:前台设置DataTemplate,后台实体集方式添加数据项。

///     /// 可用于自身或导航至 Frame 内部的空白页。    ///     public sealed partial class MainPage : Page    {        public MainPage()        {            this.InitializeComponent();            this.fvShow.ItemsSource = ImgModel.GetImgData();        }        ///         /// 在此页将要在 Frame 中显示时进行调用。        ///         /// 描述如何访问此页的事件数据。Parameter        /// 属性通常用于配置页。        protected override void OnNavigatedTo(NavigationEventArgs e)        {        }    }    ///     /// 图片实体    ///     public class ImgModel    {        ///         /// 图片名字        ///         public string ImgName { get; set; }        ///         /// 图片地址        ///         public string ImgAddr { get; set; }        ///         /// 图片URL        ///         public string ImgUrl { get; set; }        public static List
GetImgData() { List
list = new List
(); 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; } }

  看此方式的效果如下:

  最后如需源码请点击  下载。

转载地址:http://ytkwk.baihongyu.com/

你可能感兴趣的文章
M×N 形状 numpy.ndarray 的滑动窗口
查看>>
m个苹果放入n个盘子问题
查看>>
n = 3 , while n , continue
查看>>
n 叉树后序遍历转换为链表问题的深入探讨
查看>>
N!
查看>>
N-Gram的基本原理
查看>>
n1 c语言程序,全国青少年软件编程等级考试C语言经典程序题10道七
查看>>
Nacos Client常用配置
查看>>
nacos config
查看>>
Nacos Config--服务配置
查看>>
Nacos Derby 远程命令执行漏洞(QVD-2024-26473)
查看>>
Nacos 与 Eureka、Zookeeper 和 Consul 等其他注册中心的区别
查看>>
Nacos 单机集群搭建及常用生产环境配置 | Spring Cloud 3
查看>>
Nacos 启动报错[db-load-error]load jdbc.properties error
查看>>
Nacos 报Statement cancelled due to timeout or client request
查看>>
Nacos 注册服务源码分析
查看>>
Nacos 融合 Spring Cloud,成为注册配置中心
查看>>
Nacos-注册中心
查看>>
Nacos-配置中心
查看>>
Nacos2.X 源码分析:为订阅方推送、服务健康检查、集群数据同步、grpc客户端服务端初始化
查看>>