Exemple #1
0
 public static IPlaneModel GetModel()
 {
     if (myPlaneModel == null)
     {
         myPlaneModel = new MyPlaneModel();
     }
     return(myPlaneModel);
 }
 public PlaneViewModel(IPlaneModel model)
 {
     this.model             = model;
     model.PropertyChanged +=
         delegate(object sendr, PropertyChangedEventArgs e)
     {
         NotifyPropertyChanged(e.PropertyName);
     };
 }
 /*
  * Ctor.
  * Get model and set it a delegate to PropertyChangedEventArgs event.
  */
 public PlaneViewModel(IPlaneModel model)
 {
     _model = model;
     _model.PropertyChanged +=
         delegate(object sender, PropertyChangedEventArgs e)
     {
         // Add "VM_" only to properties.
         NotifyPropertyChanged("VM_" + e.PropertyName);
     };
 }