Exemplo n.º 1
0
 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);
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
        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();
            }
        }
Exemplo n.º 3
0
        void UpdateOverlayContent()
        {
            var renderer = Platform.GetOrCreateRenderer(Specific.GetOverlayContent(_application));

            (renderer as LayoutRenderer)?.RegisterOnLayoutUpdated();
            Forms.BaseLayout.SetPartContent("elm.swallow.overlay", renderer?.NativeView);
        }
Exemplo n.º 4
0
 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);
     }
 }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
 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);
         }
     }
 }
Exemplo n.º 7
0
 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);
         }
     }
 }
Exemplo n.º 8
0
 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);
     }
 }
Exemplo n.º 9
0
        void ActivateRotaryWidget()
        {
            if (!Element.Appeared)
            {
                return;
            }

            if (_currentRotaryFocusObject is IRotaryEventReceiver)
            {
                ERotaryEventManager.Rotated += OnRotaryEventChanged;
            }
            else
            {
                GetRotaryWidget(_currentRotaryFocusObject)?.Activate();
            }
            AppSpecific.SetActiveBezelInteractionElement(Application.Current, base.Element);
        }
Exemplo n.º 10
0
 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();
             }
         }
     }
 }