private async void asyncContentDialogBtnClick(object sender, RoutedEventArgs e) { var dialog = new Epxoxy.Controls.ContentDialog() { Content = "Messagebox test" }; var result = await dialog.ShowAsync(); }
private async void onExecutableContentMsg(ExecutableContent <CellMonitor> content) { if (null != content.Value) { CellMonitor modify = (CellMonitor)content.Value.Clone(); CellMonitor[] parameters = new CellMonitor[] { content.Value, modify }; ICommand command = content.Command; var dialog = new Epxoxy.Controls.ContentDialog() { PrimaryButtonText = "Save changes", PrimaryButtonCommand = command, PrimaryButtonCommandParameter = parameters, SecondaryButtonText = "Cancel", Title = "Edit CellMonitor", Content = new CellMonitorView() { CellMonitor = modify } }; await dialog.ShowAsync(contentRoot); } }
private async void onEditMonitorClick(object sender, RoutedEventArgs e) { var menuItem = sender as System.Windows.Controls.MenuItem; if (menuItem != null) { CellMonitor monitor = menuItem.CommandParameter as CellMonitor; if (monitor != null) { CellMonitor editItem = (CellMonitor)monitor.Clone(); CellMonitor[] parameters = new CellMonitor[] { monitor, editItem }; ICommand saveCommand = menuItem.Tag as ICommand; var dialog = new Epxoxy.Controls.ContentDialog() { PrimaryButtonText = "Save changes", PrimaryButtonCommand = saveCommand, PrimaryButtonCommandParameter = parameters, SecondaryButtonText = "Cancel", Title = "Edit CellMonitor", Content = new CellMonitorView() { CellMonitor = editItem } }; await dialog.ShowAsync(this.Content as FrameworkElement); } else { System.Diagnostics.Debug.WriteLine("CellMonitor null"); } } else { System.Diagnostics.Debug.WriteLine("ICommandSource null"); } }