How to propagate changes done outside my View in a WPF app
I have a property called IsVisible
:
public new bool IsVisible
{
get { return base.IsVisible; }
set
{
base.IsVisible = value;
this.RaisePropertyChanged ( "IsVisible" );
}
}
So this property is set to true
when left mouse button is down for the selected item in theTreeView
. It works fine, but I also have a CheckBox
I am trying to bind to the same property, two way. So whenever I change this property via left mouse button down, the CheckBox
shows the IsVisible state if it's true. So this works partially.
But the problem is, each time when I set this property to true for an ins开发者_StackOverflow社区tance, all other layers' IsVisible
property is set to false, but the CheckBox
es don't show the changes. They still look checked.
So whenever I say:
layer.IsVisible = true;
all the other layers are set to false by the base class which I don't have access to the source code (shown above).
How can I make my app recognize this change?
So you are hiding the IsVisible property of the base class, which doesn't implement INotifyPropertyChanged? All checkboxes are binding to your class (not the base)?
Can you mimic the behavior of the base class by iterating through the necessary layers and making the same changes to your own properties (which obviously DO notify)?
精彩评论