public MotionUpdater(ClockViewModel model) { if (!Gyroscope.IsSupported) { return; } _model = model; _gyroscope = new Gyroscope(); _gyroscope.DataUpdated += DataUpdated; }
protected override void OnCreate() { base.OnCreate(); var watchfaceApp = new PhotoWatchApp(); var model = new ClockViewModel(); model.LoadFromPreference(); model.UpdateBackgroundImage(); _viewModel = model; watchfaceApp.BindingContext = _viewModel; LoadWatchface(watchfaceApp); }
protected override void OnCreate() { base.OnCreate(); var watchfaceApp = new PhotoWatchApp(); var model = new ClockViewModel(); model.LoadFromPreference(); model.UpdateBackgroundImage(); _viewModel = model; watchfaceApp.BindingContext = _viewModel; if (Tizen.Sensor.Gyroscope.IsSupported) { _motion = new MotionUpdater(model); } LoadWatchface(watchfaceApp); }