Ejemplo n.º 1
0
        /// <summary>
        /// Closes the popup.
        /// </summary>
        public void Close()
        {
            if (_popupRoot != null)
            {
                if (_topLevel != null)
                {
                    _topLevel.RemoveHandler(PointerPressedEvent, PointerPressedOutside);
                    var window = _topLevel as Window;
                    if (window != null)
                    {
                        window.Deactivated -= WindowDeactivated;
                    }
                    else
                    {
                        var parentPopuproot = _topLevel as PopupRoot;
                        if (parentPopuproot != null && parentPopuproot.Parent != null)
                        {
                            ((Popup)parentPopuproot.Parent).Closed -= ParentClosed;
                        }
                    }
                    _nonClientListener?.Dispose();
                    _nonClientListener = null;
                }

                _popupRoot.Hide();
            }

            IsOpen = false;
            Closed?.Invoke(this, EventArgs.Empty);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Closes the popup.
        /// </summary>
        public void Close()
        {
            if (_popupRoot != null)
            {
                if (_topLevel != null)
                {
                    _topLevel.RemoveHandler(PointerPressedEvent, PointerPressedOutside);
                    _topLevel.Deactivated -= TopLevelDeactivated;
                    _nonClientListener?.Dispose();
                    _nonClientListener = null;
                }

                _popupRoot.Hide();
            }

            IsOpen = false;
            Closed?.Invoke(this, EventArgs.Empty);
        }