public ScheduleViewModel(AlarmSchedule model = null) { this.scheduleService = IocSetup.Container.Resolve <IScheduleService>(); this.popUpService = IocSetup.Container.Resolve <IPopUpService>(); isNewSchedule = model == null ? true : false; Model = model ?? new AlarmSchedule(); EnableCommand = new RelayCommandAsync <object>(async(x) => { IsEnabled = bool.Parse(x.ToString()); await SaveAsync(); }); }
/// <summary> /// Constructor ScanningPopUpViewModel initializes the attributes and properties /// </summary> public ScanningPopUpViewModel() { DevicesList = new ObservableCollection <IDevice>(); _earablesConnectionService = (IEarablesConnection)ServiceManager.ServiceProvider.GetService(typeof(IEarablesConnection)); _earablesConnectionService.NewDeviceFound += (sender, args) => { if (args.Device.Name != null && !DevicesList.Contains(args.Device)) { if (args.Device.Name.StartsWith("eSense")) { DevicesList.Insert(0, args.Device); } else { DevicesList.Add(args.Device); } OnPropertyChanged(nameof(DevicesList)); } }; _popUpService = (IPopUpService)ServiceManager.ServiceProvider.GetService(typeof(IPopUpService)); _exceptionHandler = (IExceptionHandler)ServiceManager.ServiceProvider.GetService(typeof(IExceptionHandler)); }
public PopUpController(IPopUpService popUpService) { _popUpService = popUpService; }