通过委托实现点击选项卡后禁用选项卡功能,关闭功能后启用选项卡功能

在A项目中定义一个RightMenuFunctions类

public class RightMenuFunctions
{
    public static Func<string> EnabledTrue;
}

在TheCommand,execute中

public Result Execute(
     ExternalCommandData commandData,
     ref string message,
     ElementSet elements)
{
     InFunCtions();
}

定义InFunCtions方法

public static void InFunCtions()
{ A.RightMenuFunctions.EnabledTrue = EnabledTrue; }

定义禁用选项卡方法

public static string EnabledTrue()
{
    List<RibbonPanel> list = uiapp.GetRibbonPanels("RibbonPanelName");
    RibbonPanel rp = list[0];
    rp.Enabled = true;
    return "";
}

在A项目MainWindow中添加Closing事件

RightMenuFunctions.EnabledTrue();

 

相关文章:

  • 2021-05-20
  • 2021-09-17
  • 2022-12-23
  • 2021-05-17
  • 2021-10-20
  • 2021-10-30
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-02
  • 2021-09-05
  • 2021-12-18
  • 2021-04-02
  • 2022-12-23
  • 2021-06-16
相关资源
相似解决方案