PropertyValueEditor 類別
更新:2007 年 11 月
存放屬性的任何和所有內嵌編輯器邏輯的容器。
命名空間: Microsoft.Windows.Design.PropertyEditing
組件: Microsoft.Windows.Design (在 Microsoft.Windows.Design.dll 中)
語法
Public Class PropertyValueEditor
Dim instance As PropertyValueEditor
public class PropertyValueEditor
public ref class PropertyValueEditor
public class PropertyValueEditor
備註
這個類別可以保存內嵌編輯器的單一 DataTemplate。這通常是用來為 [屬性] 視窗中的屬性提供不同或自訂編輯器。內嵌編輯器會出現在 [屬性] 視窗內。若要提供螢幕區域較大且不一定都看得見的自訂編輯器,請參閱 ExtendedPropertyValueEditor。
InlineEditorTemplate 屬性會傳回此編輯器之視覺化介面的 XAML 樣板。這通常是在專案其他地方的 ResourceDictionary 中提供的。
範例
下列程式碼範例會示範如何使用 PropertyValueEditor 類別。如需詳細資訊,請參閱逐步解說:實作內嵌值編輯器。
' Demonstrates creating a class that inherits PropertyValueEditor
' and setting the InlineEditorTemplate properties.
Public Class BrushEditor
Inherits PropertyValueEditor
' The EditorResources class in this example inherits ResourceDictionary
' and contains the template for the inline editor. These would be defined
' in an associated XAML file named EditorResources.xaml
Private res As New EditorResources()
Public Sub New()
Me.InlineEditorTemplate = CType(res("BrushInlineEditorTemplate"), DataTemplate)
End Sub
End Class
// Demonstrates creating a class that inherits PropertyValueEditor
// and setting the InlineEditorTemplate property.
public class BrushEditor : PropertyValueEditor
{
// The EditorResources class in this example inherits ResourceDictionary
// and contains template for the inline editor. This would be
// defined in an associated XAML file named EditorResources.xaml
private EditorResources res = new EditorResources();
public BrushEditor()
{
this.InlineEditorTemplate = res["BrushInlineEditorTemplate"] as DataTemplate;
}
}
繼承階層架構
System.Object
Microsoft.Windows.Design.PropertyEditing.PropertyValueEditor
Microsoft.Windows.Design.PropertyEditing.DialogPropertyValueEditor
Microsoft.Windows.Design.PropertyEditing.ExtendedPropertyValueEditor
執行緒安全
這個型別的任何 Public static (在 Visual Basic 中為 Shared) 成員都具備執行緒安全。並非所有的執行個體成員都是安全執行緒。
請參閱
參考
Microsoft.Windows.Design.PropertyEditing 命名空間