/// <summary> /// 打开轴线管理面板 /// </summary> /// <param name="parameter"></param> public void OpenAxisMgnt(Object parameter) { var proItem = parameter as ProjectItem; if (proItem == null) { return; } //判断是否已经存在面板 if (_axisPaneVmsDic.ContainsKey(proItem.Key)) { var existVm = _axisPaneVmsDic[proItem.Key]; if (!existVm.IsActive) { existVm.IsActive = true; } return; } var paneVm = new DockingPaneViewModel(new AxisSpaceMgntViewModel(proItem)) { Header = proItem.Name + ":轴线管理示例", IsDocument = true }; _axisPaneVmsDic.Add(proItem.Key, paneVm); M.DockingManager.InsertPane(paneVm); }
public void Uninstall() { //关闭面板 if (_dockingVm != null) { M.DockingManager.RemovePane(_dockingVm); } _dockingVm = null; //移除设置界面 M.SettingManager.RemovePluginSettingItem("MyPluginSetting"); }
public void Install(IPluginInfo pluginInfo) { if (GlobalConfig.Ins.AlwaysShow) { _firstVm = new FirstViewModel(); _dockingVm = new DockingPaneViewModel(_firstVm) { Header = "面板的标题", }; M.DockingManager.InsertPane(_dockingVm); } //系统设置中插件的设置界面 M.SettingManager.AddPluginSettingItem("MyPluginSetting", new SettingItem("我的插件", new SettingView())); }
public void Install(IPluginInfo pluginInfo) { ExampleViewModel examleViewModel = new ExampleViewModel(); _panel = new DockingPaneViewModel(examleViewModel) { Header = "右键菜单测试示例", IsActive = true, IsHidden = false, InitialPosition = DockPosition.FloatingDockable, IsDocument = true }; M.DockingManager.InsertPane(_panel); }
public void Uninstall() { //移除相关菜单按钮 if (_groupVm != null) { _groupVm.Items.Remove(_viewBtn); } //关闭面板 if (_dockingVm != null) { M.DockingManager.RemovePane(_dockingVm); } _dockingVm = null; }
public void Install(IPluginInfo pluginInfo) { AuthorityAndModeViewModel authorityAndModeViewModel = new AuthorityAndModeViewModel(); paneViewModel = new DockingPaneViewModel(authorityAndModeViewModel) { Header = "权限及模块测试示", IsActive = true, InitialPosition = DockPosition.FloatingDockable, IsHidden = false, IsDocument = true }; M.DockingManager.InsertPane(paneViewModel); }
private void ShowPane() { if (_dockingVm != null) { _dockingVm.IsActive = true; _dockingVm.IsHidden = false; } else { _firstVm = new FirstViewModel(); _dockingVm = new DockingPaneViewModel(_firstVm) { Header = "面板的标题", }; M.DockingManager.InsertPane(_dockingVm); } }
public void Install(IPluginInfo pluginInfo) { CommandExampleViewModel commandExamleViewModel = new CommandExampleViewModel(); _panel = new DockingPaneViewModel(commandExamleViewModel) { Header = "Command测试示例", IsActive = true, IsHidden = false, InitialPosition = DockPosition.FloatingDockable, IsDocument = true }; M.DockingManager.InsertPane(_panel); //注册全局命令 alertMessage = new RelayCommand(OnAlertMessage); alertMessageAsync = new AsyncCommand(OnAlertMessage, CanAlertMessageAsync); M.CommandManager.Register(new CommandInfo("AlertMessage", alertMessage)); //全局命令可以任何地方使用 M.CommandManager.Register(new CommandInfo("AlertMessageAsync", alertMessageAsync.Command)); //AsyncCommand在注册全局命令是需要用其属性Command }