An ItemsControl is inconsistent with its items source - WPF Listbox
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里面的逻辑移到外面去,在赋值之前,在外部写处理逻辑。

浙公网安备 33010602011771号