The representation of how to use MVVM architecture the right way!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
721 B

using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace SignalsMVVM.HelperClasses
{
[Serializable]
public class PropertyChangedClass : INotifyPropertyChanged
{
[field: NonSerialized]
public virtual event PropertyChangedEventHandler PropertyChanged;
public virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
public virtual void OnPropertyChanged(params string[] propertyNames)
{
foreach (var property in propertyNames)
OnPropertyChanged(property);
}
}
}