1
0
Fork 0
mirror of https://github.com/hawkeye-stan/msfs-popout-panel-manager.git synced 2024-11-29 01:00:13 +00:00
msfs-popout-panel-manager/Shared/ObservableObject.cs

29 lines
954 B
C#
Raw Normal View History

2022-07-23 19:23:32 +00:00
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;
}
}
}