I have a property
public sealed partial class Computer
{
private bool _online;
public bool Online
{
get { return _online; }
set
{
_online = value;
RaiseProperty("Online");
}
}
}
Which raises an event of type INotifyPropertyChanged
public sealed partial class Computer : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
private void RaiseProperty(string propertyName)
{
if (this.PropertyChanged != null)
{
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}
My question is, how can I add an additional event telling in this case an TabControl to run a specific method each time the Online Property changes?
You need to register a method to the
PropertyChangedevent