26 lines
685 B
C#
26 lines
685 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace WPF
|
|
{
|
|
public abstract class ViewModelBase : INotifyPropertyChanged
|
|
{
|
|
public event PropertyChangedEventHandler PropertyChanged;
|
|
protected void OnPropertyChanged(string propertyName)
|
|
{
|
|
this.OnPropertyChanged(new PropertyChangedEventArgs(propertyName));
|
|
}
|
|
|
|
protected virtual void OnPropertyChanged(PropertyChangedEventArgs e)
|
|
{
|
|
var handler = this.PropertyChanged;
|
|
if (handler != null)
|
|
handler(this, e);
|
|
}
|
|
}
|
|
}
|