[英]Xceed WPF PropertyGrid : decorating property with Category : compiler error
我和我在這里提出的問題基本相同。 添加using Xceed.Wpf.Toolkit.PropertyGrid.Attributes
指令解決了這個問題。
這次,編譯器不喜歡[Category("Shipping")]
裝飾。
[Category("Shipping")]
public string ShipAddress { get; set; }
當我遇到這樣的障礙時,如何推斷或確定需要包含哪些命名空間?
以下是我已經包含的使用指令:
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" />
我知道這是一個較老的問題,但由於它沒有答案,我認為無論如何提供一個都會有所幫助。 在這種情況下,您需要以下using語句:
using System.ComponentModel;
通常,找出所需命名空間或使用語句的最佳方法是在Xceed命名空間下的對象瀏覽器中查找屬性的名稱,如果在那里找不到,則在Google上查找。
要記住的一件事 - 雖然它在代碼中只顯示[Category]
,但類的實際名稱將是CategoryAttribute
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.