1
0
Fork 0
mirror of https://github.com/hawkeye-stan/msfs-popout-panel-manager.git synced 2024-11-22 13:50:14 +00:00
msfs-popout-panel-manager/Shared/ObservableObject.cs
2022-07-23 15:23:32 -04:00

28 lines
954 B
C#

using System.ComponentModel;
namespace MSFSPopoutPanelManager.Shared
{
public class ObservableObject : INotifyPropertyChanged
{
// Implements Fody.Changed
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged(string propertyName, object oldvalue, object newvalue)
{
if (oldvalue != newvalue)
PropertyChanged?.Invoke(this, new PropertyChangedExtendedEventArgs(propertyName, oldvalue, newvalue));
}
}
public class PropertyChangedExtendedEventArgs : PropertyChangedEventArgs
{
public virtual object OldValue { get; private set; }
public virtual object NewValue { get; private set; }
public PropertyChangedExtendedEventArgs(string propertyName, object oldValue, object newValue) : base(propertyName)
{
OldValue = oldValue;
NewValue = newValue;
}
}
}