首页 > 其他分享 >An ItemsControl is inconsistent with its items source - WPF Listbox

An ItemsControl is inconsistent with its items source - WPF Listbox

时间:2022-10-08 14:24:09浏览次数:72  
标签:items ItemsControl filterList source inconsistent WPF its

An ItemsControl is inconsistent with its items source - WPF Listbox

 

原来代码这么写的

private ICollection<string> filterList = new List<string>();
        public ICollection<string> FilterList
        {
            get => filterList;
            set
            {
                filterList.Clear();
                filterList.Add(string.Empty);
                filterList.AddRange(value);
                RaisePropertyChanged();
            }
        }

需要把set里面的逻辑移到外面去,在赋值之前,在外部写处理逻辑。

 

标签:items,ItemsControl,filterList,source,inconsistent,WPF,its
From: https://www.cnblogs.com/chucklu/p/16768783.html

相关文章

  • 扫描jar包中的resource文件
    /***扫描包,过滤出所有包含指定注解的类,然后将类中所有指定注解属性替换。**@param*/publicList<Class>getClassesForAnnotation(Stri......
  • Mybatis的数据源DataSource讲解
    在Mybatis的主配置文件里面有个datasource相关的配置。dataSourcetype的值有三个:POOLD,UNPOOLD,JNDI.POOLD:使用mybatis的数据库连接池来管理connection对象UNPOOLD:......
  • source insight(3.5和4.0)安装及配置
    sourceinsight(3.5和4.0)安装及配置文章目录​​sourceinsight(3.5和4.0)安装及配置​​​​一、下载(包含3.5和4.0)​​​​二、配置​​​​1、mycomment.em​​​​(1)、使......
  • Source Map入门教程
    部署前端之前,开发者通常会对代码进行打包压缩,这样可以减少代码大小,从而有效提高访问速度。然而,压缩代码的报错信息是很难Debug的,因为它的行号和列号已经失真。这时就需要Sou......
  • 【Azure 环境】Azure Resource Graph Explorer 中实现动态数组数据转换成多行记录模式
    问题描述想对Azure中全部VM的NSG资源进行收集,如果只是查看一个VM的NSG设定,可以在门户页面中查看表格模式,但是如果想把导出成表格,可以在AzureResourceGraphExplorer中查找......
  • ubuntu 使用sudo vim /etc/apt/sources.list命令修改文件后该如何退出?
    ubuntu使用sudovim/etc/apt/sources.list命令修改文件后该如何退出? ubuntu使用sudovim/etc/apt/sources.list命令修改文件后该如何退出? Esc输入冒号(即shif......
  • Java的try-resource
    原来是这个,这个是之前的trycatch,包括最后进行关流等操作。privateStringgetBodyString(finalServletRequestrequest)throwsIOException{StringBuildersb=......
  • 使用IDEA进行javaDoc时报错:javadoc: 错误 - 无效的标记: --source-path
    可能是因为idea版本太高其javadoc生成工具不能使用java8版本了,亦或是需要做一些设置 idea生成javadoc文件使用java8版本时报错  在这里修改一下java版本 我......
  • SSRS页面配置Postgresql data source的方法
    Alwayskeepemptypartitionsatbothendsofthepartitionrange.Keepthepartitionsatbothendstoguaranteethatthepartitionsplitandthepartitionmerge......
  • source insight 阅读STM32
    快捷键Alt+Shift+S可以同步文件,同步文件后就可以自动找到源代码之间的依赖关系了(如:可以自动找到调用某个函数或变量的位置)。快速更名ctrl+',选中某个函数名,然后按ctrl+',弹......