using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace App29
{
 public partial class MainPage : ContentPage
 {
  public MainPage()
  {
   InitializeComponent();
            var cities = new List<City>()
            {
                new City{ Name="beijing", State="bj"},
                new City{ Name="shanghai",State="sh"},
                new City{ Name="guangzhou",State="gz"},
                new City{ Name="shenzhen",State="sz"},
            };
            var dataTemplate = new DataTemplate(typeof(TextCell));
            dataTemplate.SetBinding(TextCell.TextProperty, "Name");
            dataTemplate.SetBinding(TextCell.DetailProperty, "State");
            myListView.ItemTemplate = dataTemplate;
            myListView.ItemsSource = cities;
  }
 }
}

XF 列表视图绑定集合的更多相关文章

  1. XF 列表视图事件

    <?xml version="1.0" encoding="utf-8" ?><ContentPage xmlns="http:// ...

  2. XF 列表视图分组列表填充

    using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threa ...

  3. WorldWind源码剖析系列:插件列表视图类PluginListView和插件列表视图项类PluginListItem

    WorldWind中的插件类是个庞大的类,可以说从软件设计层面上统筹可扩展的插件体系的设计思想是WorldWind中的精华,值得学习和借鉴.插件体系中的所用到的类可以分为两大类,一类是插件类Plugi ...

  4. 背水一战 Windows 10 (22) - 绑定: 通过 Binding 绑定对象, 通过 x:Bind 绑定对象, 通过 Binding 绑定集合, 通过 x:Bind 绑定集合

    [源码下载] 背水一战 Windows 10 (22) - 绑定: 通过 Binding 绑定对象, 通过 x:Bind 绑定对象, 通过 Binding 绑定集合, 通过 x:Bind 绑定集合 作 ...

  5. 绑定: 通过 Binding 绑定对象, 通过 x:Bind 绑定对象, 通过 Binding 绑定集合, 通过 x:Bind 绑定集合

    背水一战 Windows 10 之 绑定 通过 Binding 绑定对象 通过 x:Bind 绑定对象 通过 Binding 绑定集合 通过 x:Bind 绑定集合 示例1.演示如何通过 Bindin ...

  6. Office365学习笔记—Xslt自定义列表视图

    1,在Office365中需要添加自定义的视图!用Spd添加视图,这儿我添加一个testView! (1)打开testView.aspx将</ZoneTemplate>节点中的内容全部删除 ...

  7. abp(net core)+easyui+efcore实现仓储管理系统——展现层实现增删改查之列表视图(七)

    abp(net core)+easyui+efcore实现仓储管理系统目录 abp(net core)+easyui+efcore实现仓储管理系统——ABP总体介绍(一) abp(net core)+ ...

  8. 滚动视图、列表视图[ListView、SimpleAdapter类]

    滚动视图 <ScrollView android: layout_width="fill_parent" android: layout_height="fill_ ...

  9. (七)对话框,单选框(radiobox),复选框(checkbox),列表框(ListBox),组合框(CComboBox),水平滚动条(Horizontal scroll bar),微调(旋转)spincontrol,列表视图控件CListCtrl,静态控件static

    1,模态对话框和非模态对话框 // 模态对话框 void CMainFrame::OnDialogExec() { // TODO: 在此添加命令处理程序代码 // 创建对话框对象 CDialog d ...

随机推荐

  1. VMware Workstation 12 安装mac os x 10.11

    本人近期在学习iOS开发,由于初学,购买设备有点太昂贵了点.和我有意向想法的朋友能够看看在这篇文章.在虚拟机里装MAC os系统. 第一步:准备 VMware Workstation 12版本号 ma ...

  2. php模拟post提交文件图片等

    <?php /** * Email net.webjoy@gmail.com * author jackluo * 2014.11.21 * */ //* function curl_post( ...

  3. php对浮点数小数取整,php除法取整数

    如果我们使用" / "操作符进行除法运算时,如果遇到无法除尽的情况,会得到小数值.如果我只希望得到整数部分,怎么办呢? 1.round — 对浮点数进行四舍五入 float rou ...

  4. windows 空闲超时 非管理员如何破解

    windows 空闲超时 非管理员如何破解

  5. 三天打渔,俩天晒网(C++实现)

    #include <iostream> using namespace std; int leap (int a) {     if (a%4==0%a%100!=0||a%400==0) ...

  6. [NPM] Pipe data from one npm script to another

    In an effort to bypass saving temporary build files you can leverage piping and output redirection t ...

  7. 正則表達式基础及java使用

    正則表達式基础 正則表達式语法(1)     普通字符:字母,数字.汉子,下划线以及没有特殊定义的标点符号都是"普通字符".表达式中的普通字符.在匹配一个字符串的时候,匹配与之同样 ...

  8. [iOS]iOS开发人员账号申请与注冊流程

    郝萌主倾心贡献,尊重作者的劳动成果,请勿转载. 假设文章对您有所帮助,欢迎给作者捐赠,支持郝萌主,捐赠数额任意.重在心意^_^ 我要捐赠: 点击捐赠 Cocos2d-X源代码下载:点我传送 游戏官方下 ...

  9. iOS 取消多余tableView的横线的写法

    - (void)setExtraCellLineHidden: (UITableView *)tableView{ UIView *view =[ [UIView alloc]init]; view. ...

  10. BZOJ 1855 股票交易 - 单调队列优化dp

    传送门 题目分析: \(f[i][j]\)表示第i天,手中拥有j份股票的最优利润. 如果不买也不卖,那么\[f[i][j] = f[i-1][j]\] 如果买入,那么\[f[i][j] = max\{ ...