• 逻辑代码实现拼音首字母检索


    private void WTNR_GRID_jbzl_AutoCompleteBox_Loaded(object sender, System.Windows.RoutedEventArgs e)

            {

                List<JBJS> cs = new List<JBJS>();

                cs.Add(new JBJS { Name = "广州", ShortName = "GZ" });

                cs.Add(new JBJS { Name = "南京", ShortName = "NJ" });

                cs.Add(new JBJS { Name = "上海", ShortName = "SH" });

                cs.Add(new JBJS { Name = "北京", ShortName = "BJ" });

                cs.Add(new JBJS { Name = "扬州", ShortName = "YZ" });

                cs.Add(new JBJS { Name = "杭州", ShortName = "HZ" });

                WTNR_GRID_jbzl_AutoCompleteBox.ItemFilter = (search, item) =>

                {

                    JBJS city = item as JBJS;               

                    if (city != null)              

                    {                  

                        string filter = search.ToLower();                   

                         return city.Name.Contains(filter) |city.ShortName.ToLower().Contains(filter);

                    }              

                    return false;      

                };

               WTNR_GRID_jbzl_AutoCompleteBox.ItemsSource = cs;

            }

  • 相关阅读:
    数学基础之梯度
    背包九问心得
    如何判断机器是大端机还是小端机
    Matlab学习 2021年2月10日
    数字信号处理(超浓缩版)第一天
    matlab里的数据类型
    如何学习Matlab的帮助文档?& 如何去编写帮助文档
    fprintf 和 dlmwrite 在写数据时的区别
    lateinit 延迟初始化
    data class 在 Kotlin中的定义
  • 原文地址:https://www.cnblogs.com/chuhaida/p/3193663.html
Copyright © 2020-2023  润新知