Exemplo n.º 1
0
        /// <summary>
        /// Tries to save <see cref="IPopupWindow"/> refernce to ViewModel of this popup.
        /// Reference used to call <see cref="IPopupWindow.Close()"/> in advance.
        /// </summary>
        private void AssignPopupWindowToVM(IPopupWindow popupWindow)
        {
            var viewModel = (popupWindow as IViewModelContainer)?.ModelView;

            if (viewModel == null)
            {
                return;
            }

            viewModel.CurrentPopupWindow = popupWindow;
        }
Exemplo n.º 2
0
        private void Update()
        {
            if (_popupStack.Count <= 0 || _isOpened)
            {
                return;
            }

            IPopupWindow data = _popupStack.Peek();

            _isOpened = data.Show();
            DarkCurtainActive(_isOpened);
        }
Exemplo n.º 3
0
        public void Close()
        {
            if (!_isOpened)
            {
                return;
            }

            IPopupWindow popup = _popupStack.Pop();

            DarkCurtainActive(false);
            _isOpened = false;
            popup.Close();
        }
Exemplo n.º 4
0
        public void WhenICreateThePopupWindowFromTheViewModel()
        {
            popupWindow = new PopupWindow(viewModel);

            //var winThread = new Thread(() =>
            //{
            //	popupWindow = new PopupWindow(viewModel);
            //	popupWindow.OnPopupWindowClosed += (s, e) => popupWindow.Dispatcher.InvokeShutdown();

            //	System.Windows.Threading.Dispatcher.Run();
            //});

            //winThread.SetApartmentState(ApartmentState.STA);
            //winThread.Start();
        }
Exemplo n.º 5
0
 public void Hide()
 {
     popupWindow = null;
     gameObject.SetActive(false);
 }
Exemplo n.º 6
0
 public void Show(IPopupWindow popupWindow)
 {
     this.popupWindow = popupWindow;
     gameObject.SetActive(true);
     transform.SetAsLastSibling();
 }
Exemplo n.º 7
0
 public void Push(IPopupWindow popup)
 {
     _popupStack.Push(popup);
 }