RGBController/RGBController2/ViewModels/BaseViewModel.cs

31 lines
977 B
C#
Raw Normal View History

2020-10-25 19:52:14 +00:00
using System;
using System.Collections.Generic;
2020-10-26 17:20:01 +00:00
using System.ComponentModel;
2020-10-25 19:52:14 +00:00
using System.Text;
namespace RGBController2.ViewModels
{
2020-11-08 13:08:52 +00:00
/// <summary>
/// The BaeViewModel from which all view models should inherit.
/// </summary>
2020-10-26 17:20:01 +00:00
public class BaseViewModel : INotifyPropertyChanged
2020-10-25 19:52:14 +00:00
{
2020-11-08 13:08:52 +00:00
/// <summary>
/// An event used for when a property used by the UI is change by the view model.
/// </summary>
2020-10-26 17:20:01 +00:00
public event PropertyChangedEventHandler PropertyChanged;
2020-11-08 13:08:52 +00:00
/// <summary>
/// Function to update the GUI View when a given property has been changed by the view model.
/// </summary>
/// <param name="propertyName">The name of the changed property.</param>
2020-10-26 17:20:01 +00:00
protected void OnPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
2020-10-25 19:52:14 +00:00
}
}