mvvm sample
This commit is contained in:
34
PacticeSolution/MVVMSample/Model/NotifierMain.cs
Normal file
34
PacticeSolution/MVVMSample/Model/NotifierMain.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MVVMSample.Model
|
||||
{
|
||||
internal class NotifierMain : INotifyPropertyChanged
|
||||
{
|
||||
public event PropertyChangedEventHandler? PropertyChanged;
|
||||
|
||||
public virtual void NotifyChanged(params string[] propertyNames)
|
||||
{
|
||||
foreach (string name in propertyNames)
|
||||
{
|
||||
OnPropertyChanged(new PropertyChangedEventArgs(name));
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnPropertyChanged(PropertyChangedEventArgs e)
|
||||
{
|
||||
if (PropertyChanged != null)
|
||||
PropertyChanged(this, e);
|
||||
}
|
||||
|
||||
protected virtual void OnPropertyChanged(string propertyName)
|
||||
{
|
||||
if (PropertyChanged != null)
|
||||
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user