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 }
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; }