Exemplo n.º 1
0
        public BaseWindow ShowWindow(Type windowType)
        {
            var window = GetWindowByType(windowType);

            if (window.IsShown)
            {
                DebugWrapper.LogError(
                    $"This window is already shown: {windowType}\n{StackTraceUtility.ExtractStackTrace()}");
            }

            _shownWindows.Add(window);


            OnSomeWindowVisible?.Invoke(window);

            window.OnShow();

            UpdateZOrder(window);

            return(window);
        }
Exemplo n.º 2
0
        public void HideWindow(BaseWindow window)
        {
            bool isCannotHide = window == null || !window.IsShown || !window.IsCanHideWindow;

            if (isCannotHide)
            {
                return;
            }

            _shownWindows.Remove(window);

            window.OnHide();

            UpdateZOrder(window);

            OnSomeWindowHide?.Invoke(window);

            if (IsHaveTopWindow)
            {
                OnSomeWindowVisible?.Invoke(TopWindow);
            }
        }