Advertisement
jkmaster9918

CommandBase and ModelBase

Jul 2nd, 2011
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.92 KB | None | 0 0
  1. namespace SpaceTakeover
  2. {
  3.     public abstract class CommandBase : ICommand
  4.     {
  5.  
  6.         public abstract bool CanExecute(object parameter);
  7.  
  8.         public event EventHandler CanExecuteChanged;
  9.  
  10.         public abstract void Execute(object parameter);
  11.  
  12.         public string Text { get; internal set; }
  13.     }
  14.     public abstract class ModelBase : INotifyPropertyChanged, IDataErrorInfo
  15.     {
  16.  
  17.         public event PropertyChangedEventHandler PropertyChanged;
  18.  
  19.         public virtual string Error
  20.         {
  21.             get { return null; }
  22.         }
  23.  
  24.         public abstract string this[string columnName] { get; }
  25.  
  26.         internal void NotifyOnPropertyChanged(string propertyName)
  27.         {
  28.             PropertyChangedEventHandler temp = PropertyChanged;
  29.             if (temp != null)
  30.             {
  31.                 temp(this, new PropertyChangedEventArgs(propertyName));
  32.             }
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement