12345678910111213141516171819202122232425262728293031323334 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.ComponentModel;
- namespace Aitex.UI.Charting.ViewModel
- {
- public class BaseViewModel : INotifyPropertyChanged
- {
- public event PropertyChangedEventHandler PropertyChanged;
- public void InvokePropertyChanged(string propertyName)
- {
- PropertyChangedEventArgs eventArgs = new PropertyChangedEventArgs(propertyName);
- PropertyChangedEventHandler changed = PropertyChanged;
- if (changed != null)
- {
- changed(this, eventArgs);
- }
- }
- public void InvokePropertyChanged()
- {
- Type t = this.GetType();
- var ps = t.GetProperties();
- foreach (var p in ps)
- {
- InvokePropertyChanged(p.Name);
- }
- }
- }
- }
|