32 lines
766 B
C#
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();
|
|
}
|
|
}
|