/// <summary> /// Initializes a new instance of the <see cref="SpadeToolWindow" /> class. /// </summary> public SpadeToolWindow() : base(null) { // Set the tool window caption. Caption = "CodeMaid Spade"; // Set the tool window image from resources. BitmapResourceID = 508; BitmapIndex = 0; // Create the toolbar for the tool window. ToolBar = new CommandID(PackageGuids.GuidCodeMaidToolbarSpadeBaseGroup, PackageIds.ToolbarIDCodeMaidToolbarSpade); // Setup the associated classes. _viewModel = new SpadeViewModel { SortOrder = (CodeSortOrder)Settings.Default.Digging_PrimarySortOrder }; // Register for view model requests to be refreshed. _viewModel.RequestingRefresh += (sender, args) => Refresh(); // Create and set the view. Content = new SpadeView { DataContext = _viewModel }; // Register for changes to settings. Settings.Default.SettingsLoaded += (sender, args) => OnSettingsChange(); Settings.Default.SettingsSaving += (sender, args) => OnSettingsChange(); }
/// <summary> /// Initializes a new instance of the <see cref="SpadeToolWindow" /> class. /// </summary> public SpadeToolWindow() : base(null) { // Set the tool window caption. Caption = Resources.CodeMaidSpade; // Set the tool window image from moniker. BitmapImageMoniker = new ImageMoniker { Guid = PackageGuids.GuidCodeMaidImageMoniker, Id = 2, }; // Create the toolbar for the tool window. ToolBar = new CommandID(PackageGuids.GuidCodeMaidMenuSet, PackageIds.ToolbarIDCodeMaidToolbarSpade); // Setup the associated classes. _viewModel = new SpadeViewModel { SortOrder = (CodeSortOrder)Settings.Default.Digging_PrimarySortOrder }; // Register for view model requests to be refreshed. _viewModel.RequestingRefresh += (sender, args) => Refresh(); // Create and set the view. Content = new SpadeView { DataContext = _viewModel }; }