private void OnFetchClimateButtonClick(object sender, RibbonControlEventArgs e) { try { var dialog = new FetchClimateView(); System.Windows.Interop.WindowInteropHelper helper = new System.Windows.Interop.WindowInteropHelper(dialog); helper.Owner = (IntPtr)ThisAddIn.ExcelApplication.Hwnd; var viewModel = new FetchClimateViewModel(); 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); } }
/// <summary> /// Initializes a new instance of the FetchClimateHandler class. /// </summary> /// <param name="fetchClimateViewModel">Parent view model.</param> public FetchClimateHandler(FetchClimateViewModel fetchClimateViewModel) { this.parent = fetchClimateViewModel; }
/// <summary> /// Initializes a new instance of the CancelEventHandler class. /// </summary> /// <param name="fetchClimateViewModel">Parent view model.</param> public CancelEventHandler(FetchClimateViewModel fetchClimateViewModel) { this.parent = fetchClimateViewModel; }
/// <summary> /// Initializes a new instance of the FetchClimateHandler class. /// </summary> /// <param name="fetchClimateViewModel">Parent view model.</param> public FetchClimateHandler(FetchClimateViewModel fetchClimateViewModel) { this.parent = fetchClimateViewModel; }
/// <summary> /// Initializes a new instance of the CancelEventHandler class. /// </summary> /// <param name="fetchClimateViewModel">Parent view model.</param> public CancelEventHandler(FetchClimateViewModel fetchClimateViewModel) { this.parent = fetchClimateViewModel; }
private void OnFetchClimateButtonClick(object sender, RibbonControlEventArgs e) { try { var dialog = new FetchClimateView(); System.Windows.Interop.WindowInteropHelper helper = new System.Windows.Interop.WindowInteropHelper(dialog); helper.Owner = (IntPtr)ThisAddIn.ExcelApplication.Hwnd; var viewModel = new FetchClimateViewModel(); 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); } }