コード例 #1
0
 /// <summary>
 /// constructor
 /// </summary>
 public FlightBoardViewModel()
 {
     //connect to model layer
     model = FlightBoardModel.Instance;
     //sign to event
     model.changedParamsEvent += ChangedParams;
 }
コード例 #2
0
 /// <summary>
 /// ctor for the view model
 /// </summary>
 /// <param name="model">a required model</param>
 public FlightBoardViewModel(FlightBoardModel model)
 {
     myModel = model;
     myModel.PropertyChanged += delegate(object o, PropertyChangedEventArgs e)
     {
         this.PropertyChanged?.Invoke(o, e);
     };
 }
コード例 #3
0
 public FlightBoardViewModel(FlightBoardModel model)
 {
     this.model             = model;
     model.PropertyChanged += delegate(object sender, System.ComponentModel.PropertyChangedEventArgs e)
     {
         NotifyPropertyChanged(e.PropertyName);
     };
 }
コード例 #4
0
 public FlightBoardViewModel()
 {
     model = new FlightBoardModel();
     model.PropertyChanged += delegate(object sender, PropertyChangedEventArgs e)
     {
         NotifyPropertyChanged(e.PropertyName);
     };
 }
コード例 #5
0
 public FlightBoardViewModel(FlightBoardModel model)
 {
     this.flightBoardModel  = model;
     model.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e)
     {
         /* let the observers of the vie model the model) know that a property changed */
         NotifyPropertyChanged(e.PropertyName);
     };
 }
コード例 #6
0
 /* the ViewModel responsible of the Flight Board.
  * receiving a displayer as a parameter.
  * also, creates new FlightBoard model and registers itself to be
  * notified when properties change. */
 public FlightBoardViewModel(IWindowDisplayer windowDisplayer)
 {
     this.displayer         = windowDisplayer;
     model                  = new FlightBoardModel();
     model.PropertyChanged += delegate(object sender, PropertyChangedEventArgs e)
     {
         this.NotifyPropertyChanged("VM_" + e.PropertyName);
     };
 }
コード例 #7
0
        public FlightBoardViewModel()
        {
            _flightBoardModel = new FlightBoardModel();

            //Tie and chain the Notify of the viewModel with the model Notify - when the model notify, the viewModel notify As well.
            _flightBoardModel.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e) {
                NotifyPropertyChanged(e.PropertyName);
            };
        }
コード例 #8
0
 public FlightBoardViewModel()
 {
     flightBoardModel = new FlightBoardModel(InfoServer.Instance);
     flightBoardModel.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e)
     {
         if (e.PropertyName == "Lat")
         {
             Lat = flightBoardModel.Lat;
         }
         else if (e.PropertyName == "Lon")
         {
             Lon = flightBoardModel.Lon;
         }
         NotifyPropertyChanged(e.PropertyName);
     };
 }
コード例 #9
0
 public FlightBoardViewModel()
 {
     model = new FlightBoardModel(new Info());
     model.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e)
     {
         if (e.PropertyName == "Lat")
         {
             Lat = model.Lat;
         }
         else if (e.PropertyName == "Lon")
         {
             Lon = model.Lon;
         }
         NotifyPropertyChanged(e.PropertyName);
     };
 }
コード例 #10
0
 // The constructor.
 public FlightBoardViewModel()
 {
     // Create the model and connect it to the information server.
     model = new FlightBoardModel(new InformationServer());
     model.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e) {
         // Update the lat.
         if (e.PropertyName == "Lat")
         {
             Lat = model.Lat;
         }
         // Update the lon.
         else if (e.PropertyName == "Lon")
         {
             Lon = model.Lon;
         }
         // Notify everyone of changes.
         PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(e.PropertyName));
     };
 }
 public FlightBoardViewModel()
 {
     this.myModel  = new FlightBoardModel();
     this.myClient = Client.InstanceClass;
 }
コード例 #12
0
 public FlightBoardViewModel()
 {
     model = new FlightBoardModel();
     model.FlightBoardData += updateFlightBoardData;
 }
コード例 #13
0
 /// <summary>
 /// Constructor
 /// </summary>
 public FlightBoardViewModel()
 {
     this.model = new FlightBoardModel();
     this.model.PropertyChanged += Model_PropertyChanged;
 }
コード例 #14
0
 public FlightBoardViewModel(FlightBoardModel model)
 {
     this.model = model;
 }
コード例 #15
0
 public FlightBoardVM()
 {
     info = new FlightBoardModel();
     info.PropertyChanged += FlightBoardViewModel_PropertyChanged;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="model"> A model object, used to receive updated values from and connect to the simulator </param>
 public FlightBoardViewModel(FlightBoardModel model)
 {
     this.model = model;
     this.model.PropertyChanged += (sender, args) => NotifyPropertyChanged("VM_" + args.PropertyName);
 }
コード例 #17
0
 public FlightBoardViewModel(FlightBoardModel m)
 {
     model = m;
 }
コード例 #18
0
 public FlightBoardViewModel()
 {
     model = FlightBoardModel.Instance;
     model.updateChangedParamsEvent += NotifyChangedParams;
 }
コード例 #19
0
 public FlightBoardViewModel()
 {
     this.isConnected            = false;
     this.model                  = new FlightBoardModel();
     this.model.PropertyChanged += M_PropertyChanged;
 }