laatzen/Common/Ui/Common.UI/Infrastructure/VM.cs
2025-03-13 13:55:56 +01:00

32 lines
766 B
C#

namespace Common.UI.Infrastructure
{
using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
public class VM : INotifyPropertyChanged
{
private static event Action Dispose;
public VM() => Dispose += ViewModel_Dispose;
public event PropertyChangedEventHandler PropertyChanged;
protected void NotifyPropertyChanged([CallerMemberName] string property = null)
=> this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(property));
protected virtual void ViewModel_Dispose()
{
}
internal virtual void ViewModel_Loaded(object data)
{
}
internal static void ApplicationExit() => Dispose?.Invoke();
}
}