public BaseViewModel() { _handler = App.Container.GetInstance <IEventHandler>(); DbProvider = App.Container.GetInstance <IDatabaseProvider>(); _smSvc = App.Container.GetInstance <ISmartMirrorService>(); SettingsChanged = _handler.CaptureEvent; }
public DevicesViewModel() { DiscoveredDevices = new ObservableCollection <SmartMirrorModel>(); LoadItemsCommand = new Command(async() => await ExecuteLoadItemsCommand()); _smService = App.Container.GetInstance <ISmartMirrorService>(); MessagingCenter.Subscribe <DeviceListPage, SmartMirror>(this, "MirrorSelected", (page, mirror) => { _smService.SetInstance(new SmartMirrorModel(mirror)); Device.BeginInvokeOnMainThread(async() => { await Application.Current.MainPage.DisplayAlert("Smart Mirror Selected", "Smart Mirror has been selected.", "OK"); }); }); LoadItemsCommand.Execute(null); }
public EventHandler() { _msgService = App.Container.GetInstance <IMessagingService>(); _smService = App.Container.GetInstance <ISmartMirrorService>(); _dbService = App.Container.GetInstance <IDatabaseProvider>(); }