示例#1
0
        private void EnterOpenState()
        {
            _state = State.Open;

            _hadKeyboardFocus = HasKeyboardFocus;

            FocusObserver.KeyboardFocusedElementChanged += OnKeyboardFocusedElementChanged;
            AttachGlobalMouseEvents();

#if !SILVERLIGHT
            _foregroundSession = _foregroundSession.DisposeExchange(ForegroundSession.Enter(_popup, QueryCloseCoreImmediate));
            HwndMouseObserver.AddListener(this);
#endif
        }
示例#2
0
        private void ExitOpenState()
        {
            FocusObserver.KeyboardFocusedElementChanged -= OnKeyboardFocusedElementChanged;
            DetachGlobalMouseEvents();

#if !SILVERLIGHT
            _foregroundSession = _foregroundSession.DisposeExchange();
            HwndMouseObserver.RemoveListener(this);
#endif

            _leftButtonDownInfo  = MouseButtonEventInfo.Empty;
            _rightButtonDownInfo = MouseButtonEventInfo.Empty;

            _state = State.Closed;
        }