コード例 #1
0
 internal override DomElement ApplyToElement(DomElement newElement)
 {
     // Change the element's render mode
     OwnerElement.AddAnnotation(new RenderAnnotation(Template));
     OwnerElement.Retain();
     return(newElement);
 }
コード例 #2
0
 private void OnCancelClick(int player, GamePadState state)
 {
     _focusElement?.Dispatcher.Invoke(() => {
         OwnerElement?.RaiseEvent(new RoutedEventArgs(BlockNavigatorProperty.CancelClickEvent, OwnerElement));
         _focusElement?.RaiseEvent(new RoutedEventArgs(BlockNavigatorProperty.CancelClickEvent, _focusElement));
         NavigateBack();
     });
 }
コード例 #3
0
        public void ActivateNestedNavigator(FrameworkElement focusElm)
        {
            IsEnabled = false;
            var nav = BlockNavigatorProperty.GetBlockNavigator(focusElm);

            nav.ParentNavigator = this;
            nav.IsEnabled       = true;

            OwnerElement.RaiseEvent(new RoutedEventArgs(BlockNavigatorProperty.NavigationExitEvent, OwnerElement));
            nav.OwnerElement.RaiseEvent(new RoutedEventArgs(BlockNavigatorProperty.NavigationEnterEvent, nav.OwnerElement));
        }
コード例 #4
0
        public void NavigateBack()
        {
            if (ParentNavigator == null)
            {
                return;
            }

            IsEnabled = false;
            var nav = ParentNavigator;

            nav.IsEnabled = true;
            nav.SetFocus(OwnerElement, false);

            OwnerElement.RaiseEvent(new RoutedEventArgs(BlockNavigatorProperty.NavigationExitEvent, OwnerElement));
            nav.OwnerElement.RaiseEvent(new RoutedEventArgs(BlockNavigatorProperty.NavigationEnterEvent, nav.OwnerElement));
        }
コード例 #5
0
        private void OnConfirmClick(int player, GamePadState state)
        {
            _focusElement?.Dispatcher.Invoke(() => {
                OwnerElement?.RaiseEvent(new RoutedEventArgs(BlockNavigatorProperty.ConfirmClickEvent, OwnerElement));
                _focusElement?.RaiseEvent(new RoutedEventArgs(BlockNavigatorProperty.ConfirmClickEvent, _focusElement));
                if (BlockNavigatorProperty.GetSimulateMouse(_focusElement))
                {
                    SimulateMouse(_focusElement);
                }

                if (BlockNavigatorProperty.GetIsNestedNavigation(_focusElement))
                {
                    ActivateNestedNavigator(_focusElement);
                }
            });
        }
コード例 #6
0
 private void OnCancelClick(int player, GamePadState state)
 {
     _focusElement?.Dispatcher.Invoke(() => {
         RoutedEventArgs args = null;
         if (OwnerElement != null)
         {
             args = new RoutedEventArgs(BlockNavigatorProperty.CancelClickEvent, OwnerElement);
             OwnerElement?.RaiseEvent(args);
         }
         if (OwnerElement != _focusElement)
         {
             _focusElement?.RaiseEvent(new RoutedEventArgs(BlockNavigatorProperty.CancelClickEvent, _focusElement));
         }
         if (args == null || args.Handled == false)
         {
             NavigateBack();
         }
     });
 }