private async void Instance_Pressed(UINavigationManager sender, UINavigationButtons button)
        {
            await _UIDispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                if (FocusManager.GetFocusedElement() != AssociatedObject)
                {
                    return;
                }

                if (button.HasFlag(UINavigationButtons.Up))
                {
                    FocusManager.TryMoveFocus(FocusNavigationDirection.Up);
                }
                else if (button.HasFlag(UINavigationButtons.Down))
                {
                    FocusManager.TryMoveFocus(FocusNavigationDirection.Down);
                }
                else if (button.HasFlag(UINavigationButtons.Right))
                {
                    FocusManager.TryMoveFocus(FocusNavigationDirection.Right);
                }
                else if (button.HasFlag(UINavigationButtons.Left))
                {
                    FocusManager.TryMoveFocus(FocusNavigationDirection.Left);
                }
            });
        }
Пример #2
0
        private void Instance_Pressed(UINavigationManager sender, UINavigationButtons button)
        {
            if (!IsEnabled)
            {
                return;
            }

            if (Windows.UI.ViewManagement.InputPane.GetForCurrentView().Visible)
            {
                return;
            }

            if (IsRequireFocus && !_NowFocusingElement)
            {
                return;
            }

            if (!button.HasFlag(Kind))
            {
                return;
            }

            if (Hold && !_Holding)
            {
                return;
            }

            _Holding = false;

            foreach (var action in Actions.Cast <IAction>())
            {
                action.Execute(this.AssociatedObject, null);
            }
        }
Пример #3
0
 private void Instance_Holding(UINavigationManager sender, UINavigationButtons button)
 {
     if (Hold && button.HasFlag(Kind))
     {
         _Holding = true;
     }
 }
Пример #4
0
 private async void Instance_Holding(UINavigationManager sender, UINavigationButtons button)
 {
     await _UIDispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
     {
         if (Hold && button.HasFlag(Kind))
         {
             _Holding = true;
         }
     });
 }
Пример #5
0
        private void Instance_Pressed(UINavigationManager sender, UINavigationButtons button)
        {
            if (FocusManager.GetFocusedElement() != AssociatedObject)
            {
                return;
            }

            if (button.HasFlag(UINavigationButtons.Up))
            {
                FocusManager.TryMoveFocus(FocusNavigationDirection.Up);
            }
            else if (button.HasFlag(UINavigationButtons.Down))
            {
                FocusManager.TryMoveFocus(FocusNavigationDirection.Down);
            }
            else if (button.HasFlag(UINavigationButtons.Right))
            {
                FocusManager.TryMoveFocus(FocusNavigationDirection.Right);
            }
            else if (button.HasFlag(UINavigationButtons.Left))
            {
                FocusManager.TryMoveFocus(FocusNavigationDirection.Left);
            }
        }