protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress) { await base.InitializeAsync(cancellationToken, progress); await VsixToolWindowCommand.InitializeCommandAsync(this);//IT IS CRITICAL TO HAVE THIS HERE InitializeDelegates(); }
public static async Task InitializeCommandAsync(AsyncPackage asyncPackage) { if (asyncPackage == null) { throw new ArgumentNullException(nameof(asyncPackage)); } _asyncPackage = asyncPackage; OleMenuCommandService commandService = await asyncPackage.GetServiceAsync(typeof(IMenuCommandService)) as OleMenuCommandService; Instance = new VsixToolWindowCommand(commandService); }