Exemple #1
0
 private void AddMeterOfPole()
 {
     if (SelectType.Equals("Pole"))
     {
         MetersOfPole.Add(new MeterOfPoleViewModel {
             MeterId = ""
         });
     }
     else
     {
         MetersOfPole = new ObservableCollection <MeterOfPoleViewModel>();
     }
 }
Exemple #2
0
 public MeterViewModel(EnergyMeter item, EnergyMetersService Service, MainViewModel MainView)
 {
     mainView    = MainView;
     service     = Service;
     Type        = item.Type;
     SerialId    = item.SerialId;
     Count       = item.Count;
     UserId      = item.UserId;
     SwitchState = item.SwitchState;
     foreach (var i in item.Meters)
     {
         MetersOfPole.Add(new MeterOfPoleViewModel {
             MeterId = i.MeterId
         });
     }
     DeleteCommand   = new Command(async() => await Delete(), () => true);
     SwitchCommand   = new Command(async() => await Switch(), () => true);
     GetCountCommand = new Command(async() => await GetCount(), () => true);
     UpdateCommand   = new Command(async() => await Update(), () => true);
 }