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;
      }
     }
    }
  • 相关阅读:
    使用HSQLDB 客户端(jvm自带数据库使用技巧)
    PageHelper分页
    使用exe4j打包Java程序
    有图形界面的聊天程序
    同时收发消息
    服务端和客户端互聊
    使用Scanner
    收发字符串
    收发数字
    建立连接
  • 原文地址:https://www.cnblogs.com/dxmfans/p/9439223.html
Copyright © 2011-2022 走看看