0

I have ObservableCollection < Result > results that is ItemSource of ListBox control. Result class contains bool variable that represents visibilty of one element in ListBox item through BooleanToVisibiltyConverter. When i set ItemSource it's all ok and works fine: elements that have false are not visible, and one that have true is visible. But when i change variable from true to false, the element is not changing his visibility. What is problem?

Now i need to do this magic:

ResultsListBox.ItemsSource = null;
ResultsListBox.ItemsSource = results;
4

1 回答 1

0

您需要INotifyPropertyChanged在您的类上实现接口Result以更新您的情况下的目标元素上的绑定ListBoxItem

教程 -如何实现属性更改通知。

于 2013-08-20T18:51:46.260 回答