示例#1
0
        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);
        }
示例#2
0
        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"
            };
        }
示例#3
0
        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"
            };
        }