public IModalWindow DisplayInfoWindow(string title, string message) { IModalWindow infoWindow = Instantiate(infoWindowPrefab).GetComponent <IModalWindow>(); infoWindow.DisplayAsInfoWindow(title, message); return(infoWindow); }
IWindowsFactory CreateWindowsFactory(IModalWindow window) { var windowsFactory = Substitute.For <IWindowsFactory>(); windowsFactory.CreateModalWindow().Returns(window); return(windowsFactory); }
public void ShowDialog <TDialogViewModel>(IModalWindow view, TDialogViewModel viewModel, Action <TDialogViewModel> onDialogClose) { view.DataContext = viewModel; if (onDialogClose != null) { view.Closed += (sender, e) => onDialogClose(viewModel); } view.Show(); }
public static bool TryClose(this IModalWindow window) { try { window.Close(); return(true); } catch (Exception e) { return(false); } }
public void ShowDialog <TDialogViewModel>(IModalWindow view, TDialogViewModel viewModel, Action <TDialogViewModel> onDialogClose) { try { view.DataContext = viewModel; if (onDialogClose != null) { view.Closed += (sender, e) => onDialogClose(viewModel); } view.ShowDialog(); } catch (Exception exception) { throw; } }
private void ModalDialog(VariableItem item, bool add) { IModalWindow modalDialog = null; try { _dialogPage = new AssignVariable(item, base.Wizard.Host, VariableIsInputVariable); modalDialog = base.Wizard.Host.ShowModalWindow(new IWizardPage[] { _dialogPage }, new System.Drawing.Size((int)_dialogPage.Width, (int)_dialogPage.Height), false); modalDialog.ShowButton(ModalWindowButtonTypes.OK); modalDialog.ShowButton(ModalWindowButtonTypes.Cancel); modalDialog.OKClicked += new EventHandler <ModalWindowButtonClickEventArgs>(modalDialog_OKClicked); if (add) { modalDialog.SetTitle("Add Variable"); } else { modalDialog.SetTitle("Assign Variable"); modalDialog.CancelClicked += new EventHandler <ModalWindowButtonClickEventArgs>(modalDialog_CancelClicked); } modalDialog.Show(); } catch (Exception Ex) { ModalWindow.ShowMessage(base.Wizard.Host.WindowHandle, ModalWindowIconTypes.Error, "K2", Ex.Message.ToString(), new ModalWindowButtonTypes[] { ModalWindowButtonTypes.OK }); } finally { if (_dialogPage != null) { _dialogPage.Dispose(); _dialogPage = null; } if (modalDialog != null) { modalDialog.OKClicked -= modalDialog_OKClicked; if (!add) { modalDialog.CancelClicked -= modalDialog_CancelClicked; } modalDialog.Dispose(); modalDialog = null; } } }
public static void Show(IModalWindow modalWindow, Action<DialogResult> resultCallback) { FrameworkElement element = ISFocusManager.GetFocusedElement() as FrameworkElement; IWindow owner = null; // check if the caller is hosted within a known container // if the dependency container is of IWindow type, use it as the owner of this modal window if (element != null) { DependencyObject logicalContainer = ISFocusManager.GetLogicalContainerScope(element); if (logicalContainer is IWindow) owner = logicalContainer as IWindow; } modalWindow.ShowDialog(owner, resultCallback); }
private void Start() { _signInInfoWindow = _modalWindowManager.DisplayInfoWindow("Connecting...", "Connecting to google play services..."); PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder() .EnableSavedGames() .RequestEmail() .RequestServerAuthCode(false) .RequestIdToken() .Build(); PlayGamesPlatform.InitializeInstance(config); PlayGamesPlatform.DebugLogEnabled = true; PlayGamesPlatform.Activate(); Social.localUser.Authenticate(AuthenticatedCallback); }
internal IModalWindow InitModalWindow(IModalWindow popup, IWorkItem workItem, ModalOptions metadata) { if (metadata == null) { metadata = workItem.Configuration.GetOption <ModalOptions>(); } global::Prism.Regions.RegionManager.SetRegionManager(popup.GetRegionHolder(), global::Prism.Regions.RegionManager.GetRegionManager(Application.Current.MainWindow)); global::Prism.Regions.RegionManager.UpdateRegions(); popup.WindowStartupLocation = metadata.WindowStartupLocation; if (!metadata.Size.IsEmpty) { popup.Width = metadata.Size.Width; popup.Height = metadata.Size.Height; } popup.ResizeMode = metadata.ResizeMode; popup.Title = workItem.WorkItemName; popup.Closing += (o, args) => ModalWindowClosing(workItem, args); return(popup); }
public void ShowDialog <TDialogViewModel>(IModalWindow view, TDialogViewModel viewModel) { this.ShowDialog(view, viewModel, null); }
private void DisposeModalWindow() { if (_modalWindow != null) { _modalWindow.Closed -= ModalWindowClosed; DisposeUtils.DisposeOf(_modalWindow); _modalWindow = null; } }
private OkCancelDialogBoxResult ExecuteCancelDialog(IOkCancelDialogBoxViewModel dialogViewModel, IModalWindow window) { dialogViewModel.ExecuteCancel(); window.Close(); return(OkCancelDialogBoxResult.Cancel); }
public ModalWindowViewModel(IModalWindow window, IContainer container) : base(window, container) { }