zoukankan      html  css  js  c++  java
  • XF 列表视图事件

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:local="clr-namespace:App30"
                 x:Class="App30.MainPage">
        <StackLayout>
        <ListView x:Name="myListView" ItemSelected="myListView_ItemSelected" ItemTapped="myListView_ItemTapped"
                  Refreshing="myListView_Refreshing"></ListView>
            <Button Text="Refresh" Clicked="Button_Clicked"></Button>
        </StackLayout>
    </ContentPage>

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using Xamarin.Forms;
    namespace App30
    {
     public partial class MainPage : ContentPage
     {
      public MainPage()
      {
       InitializeComponent();
                myListView.ItemsSource = new string[]
                {
                    "zhangsan","lisi","wangwu","zhaoliu"
                };
                myListView.IsPullToRefreshEnabled = true;
      }
            private void myListView_ItemSelected(object sender, SelectedItemChangedEventArgs e)
            {
                //DisplayAlert("你选择了", e.SelectedItem.ToString(), "Ok");
            }
            private void myListView_ItemTapped(object sender, ItemTappedEventArgs e)
            {
                DisplayAlert("你选择了", e.Item.ToString(), "Ok");
            }
            private void myListView_Refreshing(object sender, EventArgs e)
            {
                myListView.ItemsSource = new string[]
               {
                    "abc","123","hij","888"
               };
                myListView.EndRefresh();
            }
            private void Button_Clicked(object sender, EventArgs e)
            {
                myListView.BeginRefresh();
            }
        }
    }
  • 相关阅读:
    python第四篇:linux命令行总结 + 自动备份Python程序
    mount挂载相关指令
    TiDB配置HAProxy负载均衡
    NewSQL 介绍
    mysql 主从搭建
    MySQL 双主问题集
    MySQL 测试工具(基准测试、压力测试)
    分布式 NewSQL 对比
    (转载)MySQL数据库的几种常见高可用方案
    MySQL 大表备份、改表
  • 原文地址:https://www.cnblogs.com/dxmfans/p/9439495.html
Copyright © 2011-2022 走看看