Ejemplo n.º 1
0
        // Token: 0x06004433 RID: 17459 RVA: 0x00136D34 File Offset: 0x00134F34
        private static void OnIsOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ContextMenu contextMenu = (ContextMenu)d;

            if ((bool)e.NewValue)
            {
                if (contextMenu._parentPopup == null)
                {
                    contextMenu.HookupParentPopup();
                }
                contextMenu._parentPopup.Unloaded += contextMenu.OnPopupUnloaded;
                contextMenu.SetValue(KeyboardNavigation.ShowKeyboardCuesProperty, KeyboardNavigation.IsKeyboardMostRecentInputDevice());
                return;
            }
            contextMenu.ClosingMenu();
        }
Ejemplo n.º 2
0
        private static void OnIsOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ContextMenu ctrl = (ContextMenu)d;

            if ((bool)e.NewValue)
            {
                if (ctrl._parentPopup == null)
                {
                    ctrl.HookupParentPopup();
                }

                ctrl._parentPopup.Unloaded += new RoutedEventHandler(ctrl.OnPopupUnloaded);

                // Turn on keyboard cues in case ContextMenu was opened with the keyboard
                ctrl.SetValue(KeyboardNavigation.ShowKeyboardCuesProperty, KeyboardNavigation.IsKeyboardMostRecentInputDevice());
            }
            else
            {
                ctrl.ClosingMenu();
            }
        }