internal static MenuItem ToMenuItem(this IMenuExtension menuExtension) { MenuItem result = null; if (menuExtension != null) { result = new MenuItem(); result.Command = menuExtension.Command; result.Header = menuExtension.Name; } return(result); }
public void Initialize(IServiceLocator serviceFactory) { this.serviceFactory = serviceFactory; launch = new MenuExtension() { Command = new RelayCommand((obj) => { var workBench = serviceFactory.Resolve<IWorkbenchService>(); var tabItem = new WorkbenchTab("Test Addin Title"); tabItem.Content = new TestUserControl(serviceFactory); workBench.Add(tabItem); }), Name = "Test Addin" }; }
public void Initialize(IServiceLocator serviceFactory) { this.serviceFactory = serviceFactory; launch = new MenuExtension() { Command = new RelayCommand((obj) => { var workBench = serviceFactory.Resolve <IWorkbenchService>(); var tabItem = new WorkbenchTab("Test Addin Title"); tabItem.Content = new TestUserControl(serviceFactory); workBench.Add(tabItem); }), Name = "Test Addin" }; }