【问题标题】:Xceed WPF PropertyGrid : decorating property with Category : compiler errorXceed WPF PropertyGrid:使用类别装饰属性:编译器错误
【发布时间】:2013-05-16 19:17:32
【问题描述】:

我和here 的问题基本相同。添加 using Xceed.Wpf.Toolkit.PropertyGrid.Attributes 指令解决了这个问题。

这一次,编译器不喜欢[Category("Shipping")] 修饰。

        [Category("Shipping")]
        public string ShipAddress { get; set; }

当我遇到这样的障碍时,如何推断或确定需要包含哪些命名空间?

这是我已经包含的 using 指令:

using Xceed.Wpf.Toolkit.PropertyGrid;
using Xceed.Wpf.Toolkit.PropertyGrid.Editors;
using Xceed.Wpf.Toolkit.PropertyGrid.Commands;
using Xceed.Wpf.Toolkit.PropertyGrid.Converters;
using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;

xaml 是这样的:

 <xctk:PropertyGrid  AutoGenerateProperties="True" Name="XPG1" IsCategorized="True" />

【问题讨论】:

    标签: wpf-controls propertygrid xceed


    【解决方案1】:

    我知道这是一个较老的问题,但由于没有答案,我认为无论如何提供一个问题都会有所帮助。在这种情况下,您需要以下 using 语句:

    using System.ComponentModel;
    

    一般来说,找出您需要的命名空间或 using 语句的最佳方法是在 Xceed 命名空间下的对象浏览器中查找属性的名称,如果在那里找不到,请在 Google 上找到。

    要记住的一件事 - 虽然它在代码中显示为 [Category],但该类的实际名称将是 CategoryAttribute

    【讨论】:

    • 在 2017 年仍然适用
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-12-24
    • 1970-01-01
    • 1970-01-01
    • 2013-06-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多