This repository has been archived on 2020-12-20. You can view files and clone it, but cannot push or open issues or pull requests.
aurora-sharp-desktop/Aurora/Frontend/Views/BaseViewModel.cs
watsonb8 a4276a0d5d Hooked up view with play button
Set up data structures for holding and playing music
2019-05-22 10:30:41 -04:00

35 lines
940 B
C#

using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace Aurora.Frontend.Views
{
public class BaseViewModel : INotifyPropertyChanged
{
public BaseViewModel()
{
}
#region INotifyPropertyChanged Implementation
public bool SetProperty<T>(ref T storage, T value, [CallerMemberName] string propertyName = null)
{
if (Object.Equals(storage, value))
return false;
storage = value;
OnPropertyChanged(propertyName);
return true;
}
public event PropertyChangedEventHandler PropertyChanged;
public void OnPropertyChanged([CallerMemberName] string propertyName = "")
{
if (PropertyChanged == null)
return;
PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
#endregion
}
}