zoukankan      html  css  js  c++  java
  • XF 列表视图绑定集合

    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;
      }
     }
    }
  • 相关阅读:
    c# 读取数据库得到dateset
    c# 读数据库二进制流到图片
    c# 读取数据库得到字符串
    c#打开颜色对话框
    WinForm-GridView
    arcengine 常用方法
    arcgis engine 调用arcgis server服务
    ae
    ae保存图层
    ae 打开地图文档
  • 原文地址:https://www.cnblogs.com/dxmfans/p/9439223.html
Copyright © 2011-2022 走看看