Exemple #1
0
 private void EditingElement_LosingFocus(UIElement sender, LosingFocusEventArgs args)
 {
     if (args.NewFocusedElement is Popup || args.NewFocusedElement is AppBarButton)
     {
         args.Cancel = true;
         args.TryCancel();
     }
 }
Exemple #2
0
 private void EditingElement_LosingFocus(UIElement sender, LosingFocusEventArgs args)
 {
     if (args.NewFocusedElement is Popup)
     {
         args.Cancel = true;
         args.TryCancel();
         args.TrySetNewFocusedElement(args.OldFocusedElement);
     }
 }
Exemple #3
0
        private void GraphingControl_LosingFocus(UIElement sender, LosingFocusEventArgs args)
        {
            var newFocusElement = args.NewFocusedElement as FrameworkElement;

            if (newFocusElement == null || newFocusElement.Name == null)
            {
                // Because clicking on the swap chain panel will try to move focus to a control that can't actually take focus
                // we will get a null destination.  So we are going to try and cancel that request.
                // If the destination is not in our application we will also get a null destination but the cancel will fail so it doesn't hurt to try.
                args.TryCancel();
            }
        }
Exemple #4
0
 bool ILosingFocusEventArgsResolver.TryCancel(LosingFocusEventArgs e) => e.TryCancel();
 private void Field_LosingFocus(UIElement sender, LosingFocusEventArgs args)
 {
     args.TryCancel();
 }