protected virtual void UpdateRotaryInteraction(bool enable) { if (NativeView is IRotaryInteraction ri) { if (Specific.GetUseBezelInteraction(Application.Current)) { if (enable) { ri.RotaryWidget?.Activate(); Forms.RotaryFocusObject = Element; Specific.SetActiveBezelInteractionElement(Application.Current, Element); } else { ri.RotaryWidget?.Deactivate(); if (Forms.RotaryFocusObject == Element) { Forms.RotaryFocusObject = null; } if (Specific.GetActiveBezelInteractionElement(Application.Current) == Element) { Specific.SetActiveBezelInteractionElement(Application.Current, null); } } } } }
public async void LoadApplication(Application application) { if (RequestingUserConsentFunc != null) { await RequestingUserConsentFunc(); } if (null == MainWindow) { throw new InvalidOperationException("MainWindow is not prepared. This method should be called in OnCreated()."); } if (null == application) { throw new ArgumentNullException(nameof(application)); } _application = application; Application.Current = application; application.SendStart(); application.PropertyChanged += new PropertyChangedEventHandler(this.AppOnPropertyChanged); SetPage(_application.MainPage); if (Device.Idiom == TargetIdiom.Watch) { _useBezelInteration = Specific.GetUseBezelInteraction(_application); UpdateOverlayContent(); } }
void UpdateOverlayContent() { var renderer = Platform.GetOrCreateRenderer(Specific.GetOverlayContent(_application)); (renderer as LayoutRenderer)?.RegisterOnLayoutUpdated(); Forms.BaseLayout.SetPartContent("elm.swallow.overlay", renderer?.NativeView); }
protected virtual void OnPickerOpened(object sender, EventArgs args) { if (Specific.GetUseBezelInteraction(Application.Current)) { // picker included in WatchDatePickedDialog has been activated, whenever the dialog is opend. Forms.RotaryFocusObject = Element; Specific.SetActiveBezelInteractionElement(Application.Current, Element); } }
void UpdateOverlayContent() { EvasObject nativeView = null; var content = Specific.GetOverlayContent(_application); if (content != null) { var renderer = Platform.GetOrCreateRenderer(content); (renderer as LayoutRenderer)?.RegisterOnLayoutUpdated(); nativeView = renderer?.NativeView; } Forms.BaseLayout.SetPartContent("elm.swallow.overlay", nativeView); }
void AppOnPropertyChanged(object sender, PropertyChangedEventArgs args) { if ("MainPage" == args.PropertyName) { SetPage(_application.MainPage); } else if (Device.Idiom == TargetIdiom.Watch) { if (Specific.UseBezelInteractionProperty.PropertyName == args.PropertyName) { _useBezelInteration = Specific.GetUseBezelInteraction(_application); } } }
protected virtual void OnPickerClosed(object sender, EventArgs args) { if (Specific.GetUseBezelInteraction(Application.Current)) { if (Forms.RotaryFocusObject == Element) { Forms.RotaryFocusObject = null; } if (Specific.GetActiveBezelInteractionElement(Application.Current) == Element) { Specific.SetActiveBezelInteractionElement(Application.Current, null); } } }
void DeactivateRotaryWidget() { if (_currentRotaryFocusObject is IRotaryEventReceiver) { ERotaryEventManager.Rotated -= OnRotaryEventChanged; } else if (_currentRotaryFocusObject is IRotaryFocusable) { GetRotaryWidget(_currentRotaryFocusObject)?.Deactivate(); } if (AppSpecific.GetActiveBezelInteractionElement(Application.Current) == base.Element) { AppSpecific.SetActiveBezelInteractionElement(Application.Current, null); } }
void ActivateRotaryWidget() { if (!Element.Appeared) { return; } if (_currentRotaryFocusObject is IRotaryEventReceiver) { ERotaryEventManager.Rotated += OnRotaryEventChanged; } else { GetRotaryWidget(_currentRotaryFocusObject)?.Activate(); } AppSpecific.SetActiveBezelInteractionElement(Application.Current, base.Element); }
protected virtual void UpdateRotaryInteraction(bool enable) { if (NativeView is IRotaryInteraction ri) { if (Specific.GetUseBezelInteraction(Application.Current)) { if (enable) { ri.RotaryWidget?.Activate(); } else { ri.RotaryWidget?.Deactivate(); } } } }