private void OnLoaded(object sender, RoutedEventArgs e) { _ide = Utilities.GetDTE(DataContext); var viewModel = new ProjectGroupsViewModel(IdeAccess); DataContext = viewModel; if (!viewModel.Setup(SettingsProvider)) { var result = MessageBox.Show( "Could not load existing project groups from settings. Do you want to reset the invalid settings?", "Group Loading failed", MessageBoxButton.YesNo, MessageBoxImage.Error, MessageBoxResult.Yes); if (result == MessageBoxResult.Yes) { SettingsProvider.Reset(); } } }
private ProjectGroupsMenu(Package package) { _package = package; _viewModel = Ioc.Instance.Resolve <ProjectGroupsViewModel>(); var commandService = ServiceProvider.GetService(typeof(IMenuCommandService)) as OleMenuCommandService; if (commandService != null) { var menuCommandId = new CommandID(CommandSet, BetterStartPageMenuOpenFavouritePlaceholderCommand); var menuItem = new ProjectGroupsMenuCommand(menuCommandId, IsValidDynamicItem, OnInvokedDynamicItem, OnBeforeQueryStatusDynamicItem); commandService.AddCommand(menuItem); } }
private void OnLoaded(object sender, RoutedEventArgs e) { _ide = Utilities.GetDTE(DataContext); var viewModel = new ProjectGroupsViewModel(IdeAccess); DataContext = viewModel; if (!viewModel.Setup(SettingsProvider)) { var result = MessageBox.Show( "Could not load existing project groups from settings. Do you want to reset the invalid settings?", "Group Loading failed", MessageBoxButton.YesNo, MessageBoxImage.Error, MessageBoxResult.Yes); if (result == MessageBoxResult.Yes) { SettingsProvider.Reset(); } } }