Skip to content

修改属性显示名

默认情况下,在设计器中的属性面板中,显示的是属性名。但是属性名一般是英文名,直接显示英文名对用户不友好。

通过标注 DisplayNameAttribute 可以修改属性面板中属性的显示标签

csharp
    public class MyPluginCellType : CellType
    {
        [DisplayName("我的属性")]
        public string MyProperty { get; set; }
    }

设计器效果

1669996796969-94bf3f02-de09-46b3-bcda-90fafdc771eb.png

更新: 2022-12-03 00:00:00
原文: https://www.yuque.com/robert-bh51n/ea8l6c/nym22450m9xqnu2g