private void btnIRISDemo_Click(object sender, RibbonControlEventArgs e) { try { var dialog = new Stations(); System.Windows.Interop.WindowInteropHelper helper = new System.Windows.Interop.WindowInteropHelper(dialog); helper.Owner = (IntPtr)ThisAddIn.ExcelApplication.Hwnd; StationViewModel viewModel = new StationViewModel(); viewModel.RequestClose += new EventHandler(dialog.OnRequestClose); dialog.DataContext = viewModel; dialog.ShowDialog(); viewModel.RequestClose -= new EventHandler(dialog.OnRequestClose); dialog.Close(); } catch (CustomException ex) { Ribbon.ShowError(ex.HasCustomMessage ? ex.Message : Resources.LayerOperationError); } catch (Exception exception) { Logger.LogException(exception); Ribbon.ShowError(Resources.DefaultErrorMessage); } }
public GetEarthquakeDataCommandHandler(StationViewModel stationViewModel) { this.parent = stationViewModel; }
public SaveCommandHandler(StationViewModel stationViewModel) { this.parent = stationViewModel; }