private static RoutedEventHandler GetClickHandler(IMainWindowButton mainWindowButton) { var clickHandler = new RoutedEventHandler(delegate { try { if (mainWindowButton != null && mainWindowButton.IsEnabled(MainWindow.Instance, SelectedInstance)) { mainWindowButton.OnClick(MainWindow.Instance, SelectedInstance); } } catch (Exception ex) { WindowHelper.HandleError("Failed to get click handler", true, ex); } }); return(clickHandler); }
private static RoutedEventHandler GetClickHandler(IMainWindowButton mainWindowButton) { var clickHandler = new RoutedEventHandler(delegate { try { if (mainWindowButton != null && mainWindowButton.IsEnabled(MainWindow.Instance, SelectedInstance)) { mainWindowButton.OnClick(MainWindow.Instance, SelectedInstance); MainWindowHelper.RefreshInstances(); } } catch (Exception ex) { WindowHelper.HandleError(ex.Message, true); } }); return(clickHandler); }