共用方式為


ExtendedPropertyValueEditor 類別

更新:2007 年 11 月

存放屬性的任何和所有擴充編輯器邏輯的容器。

命名空間:  Microsoft.Windows.Design.PropertyEditing
組件:  Microsoft.Windows.Design (在 Microsoft.Windows.Design.dll 中)

語法

Public Class ExtendedPropertyValueEditor _
    Inherits PropertyValueEditor

Dim instance As ExtendedPropertyValueEditor
public class ExtendedPropertyValueEditor : PropertyValueEditor
public ref class ExtendedPropertyValueEditor : public PropertyValueEditor
public class ExtendedPropertyValueEditor extends PropertyValueEditor

備註

ExtendedPropertyValueEditor 類別可以保留兩個 DataTemplate 物件,一個用於內嵌編輯器,另一用於擴充編輯器。內嵌編輯器提供出現在 [屬性] 視窗界限內的自訂介面,而擴充編輯器則提供出現在新視窗中的介面。

InlineEditorTemplate 屬性會傳回內嵌編輯器視覺化介面的 XAML 樣板,而 ExtendedEditorTemplate 屬性會傳回擴充編輯器的 XAML 樣板。這些通常是在專案其他地方的 ResourceDictionary 中提供的。

您應使用 EditModeSwitchButton 來叫用自訂 ExtendedPropertyValueEditor。如需示範,請參閱逐步解說:實作色彩編輯器

範例

下列程式碼範例會示範如何使用 ExtendedPropertyValueEditor 類別。如需詳細資訊,請參閱逐步解說:實作色彩編輯器

' Demonstrates creating a class that inherits ExtendedPropertyValueEditor
' and setting the ExtendedEditorTemplate and InlineEditorTemplate properties.
Public Class BrushExtendedEditor
    Inherits ExtendedPropertyValueEditor
    ' The EditorResources class in this example inherits ResourceDirectory and
    ' contains the template for the extended editor and the inline editor. This would be defined in 
    ' an associated XAML file named EditorResources.xaml
    Private res As New EditorResources()
    Public Sub New()
        Me.ExtendedEditorTemplate = CType(res("BrushExtendedEditorTemplate"), DataTemplate)
        Me.InlineEditorTemplate = CType(res("BrushInlineEditorTemplate"), DataTemplate)
    End Sub
End Class
// Demonstrates creating a class that inherits ExtendedPropertyValueEditor
// and setting the ExtendedEditorTemplate and InlineEditorTemplate properties.
public class BrushExtendedEditor : ExtendedPropertyValueEditor
{
    // The EditorResources class in this example inherits ResourceDictionary 
    // class contains template for the inline editor and the extended editor. These would be 
    // defined in an associated XAML file named EditorResources.xaml
    private EditorResources res = new EditorResources();

    public BrushExtendedEditor()
    {
        this.ExtendedEditorTemplate = res["BrushExtendedEditorTemplate"] as DataTemplate;
        this.InlineEditorTemplate = res["BrushInlineEditorTemplate"] as DataTemplate;
    }
}

繼承階層架構

System.Object
  Microsoft.Windows.Design.PropertyEditing.PropertyValueEditor
    Microsoft.Windows.Design.PropertyEditing.ExtendedPropertyValueEditor

執行緒安全

這個型別的任何 Public static (在 Visual Basic 中為 Shared) 成員都具備執行緒安全。並非所有的執行個體成員都是安全執行緒。

請參閱

參考

ExtendedPropertyValueEditor 成員

Microsoft.Windows.Design.PropertyEditing 命名空間

其他資源

屬性編輯架構

WPF 設計工具擴充性

中繼資料存放區