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;
      }
     }
    }
  • 相关阅读:
    HTTP 常见状态码
    SpringMVC 入门
    Maven 整合SSH框架
    SSH 框架整合总结
    Maven 整合SSH框架之pom.xml
    Maven 入门
    WebService 综合案例
    CXF 框架
    jQuery高级
    JavaScript补充:BOM(浏览器对象模型)
  • 原文地址:https://www.cnblogs.com/dxmfans/p/9439223.html
Copyright © 2011-2022 走看看