/// <summary> /// Called on UI bus message. /// </summary> /// <param name="message">The message.</param> public void OnMessage(ApplicationMessage <UIBusMessageTypes> message) { try { switch (message.MessageType) { case UIBusMessageTypes.InformationRequest: { InformationRequest irqt = message.Payload as InformationRequest; if (irqt != null) { WorkspaceViewModel vm = irqt.Tag as WorkspaceViewModel; if (vm != null) { PopupView pw = new PopupView(vm); pw.Owner = this.MainWindow; pw.WindowStartupLocation = WindowStartupLocation.CenterOwner; if (pw.ShowDialog() == true) { irqt.CompleteMethod(irqt); } } else if (irqt.ResultType == typeof(System.IO.File)) { SelectFileName(irqt); } } } break; } } catch (Exception x) { AppContext.Current.LogTechError(string.Format("Technical error {0}: {1}", x.GetType().Name, x.Message), x); System.Diagnostics.Debug.WriteLine(x.GetDetails()); } }
private void OpenPopupExecute() { var homeview = new HomeView(); Window popup = new PopupView(homeview, ResGeneral.Home); popup.ShowDialog(); }
public bool TryAskText(string title, string label, string initVal, Action <string> newVal) { TextRqtVModel vm = new TextRqtVModel(title, label, initVal, newVal); PopupView pw = new PopupView(vm); var rz = pw.ShowDialog(); return(rz == true); }