I have a dependency property of type collection, when its callback fires based on the count I need to set the visibility of some of the controls on the screen.
But t
You need to notify the change:
public event PropertyChangedEventHandler PropertyChanged;
private bool _countLabelVisible = false;
private void RaisePropertyChanged(string propertyName)
{
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
public bool CountLabelVisible
{
get
{
return _countLabelVisible;
}
set
{
_countLabelVisible = value;
RaisePropertyChanged("CountLabelVisible");
}
}
The binding "framework" needs to be informed that the binding needs refreshing, which is what the Raise... is about. This is pretty quick and dirty (and untested) but should demonstrate what you need to do.