Skip to content

单元格分组与排序

默认情况下,单元格的分组是其他

1669965840395-7983837c-2378-4dc4-9e2f-82d2cc687bf2.png

可以通过标注CategoryAttribute来自定义分组

csharp
    [Category("我的分组")]
    public class MyPluginCellType : CellType
    {
    }

效果如下
1669965949676-1ce1c722-c738-4aec-8117-64ea65209faf.png

如果分组名与既有的分组名一致,会加到已有的组里

csharp
    [Category("导航")]
    public class MyPluginCellType : CellType
    {
    }

效果如下

1669966046636-b22ca6f5-5c0e-4841-ba5f-bab7f1b309c4.png

如果有多个插件,在同一分组,可以通过OrderWeightAttribute标注排序权重

csharp
    [OrderWeight(1)]
    [Category("我的分组")]
    public class MyPluginCellType1 : CellType
    {
    }
    [OrderWeight(2)]
    [Category("我的分组")]
    public class MyPluginCellType2 : CellType
    {
    }
    [OrderWeight(3)]
    [Category("我的分组")]
    public class MyPluginCellType3 : CellType
    {
    }

设计器效果
1669989636240-d8e074cb-b12c-49eb-b157-d00e7897f3fb.png

更新: 2022-12-02 22:01:31
原文: https://www.yuque.com/robert-bh51n/ea8l6c/uefq1sac8ic2beme