/// <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; }
private void Update() { if (_popupStack.Count <= 0 || _isOpened) { return; } IPopupWindow data = _popupStack.Peek(); _isOpened = data.Show(); DarkCurtainActive(_isOpened); }
public void Close() { if (!_isOpened) { return; } IPopupWindow popup = _popupStack.Pop(); DarkCurtainActive(false); _isOpened = false; popup.Close(); }
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(); }
public void Hide() { popupWindow = null; gameObject.SetActive(false); }
public void Show(IPopupWindow popupWindow) { this.popupWindow = popupWindow; gameObject.SetActive(true); transform.SetAsLastSibling(); }
public void Push(IPopupWindow popup) { _popupStack.Push(popup); }