I have a Border
with Label
inside a Window
,
Another solution is to use Trigger Style:
In the model class:
public class ModelClass: INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
private void NotifyPropertyChanged(string name)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
}
private bool _vis;
public bool vis
{
get => _vis;
set
{
_vis = value;
NotifyPropertyChanged("vis");
}
}
}
Don't forget to bind DataContext with your model !
DataContext = new ModelClass();