Beispiel #1
0
        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);
            }
        }
Beispiel #2
0
 public GetEarthquakeDataCommandHandler(StationViewModel stationViewModel)
 {
     this.parent = stationViewModel;
 }
Beispiel #3
0
 public SaveCommandHandler(StationViewModel stationViewModel)
 {
     this.parent = stationViewModel;
 }