Dela via


ExtendedPropertyValueEditor Class

Container for any and all extended editor logic for properties.

Namespace:  Microsoft.Windows.Design.PropertyEditing
Assembly:  Microsoft.Windows.Design (in Microsoft.Windows.Design.dll)

Syntax

'Declaration
Public Class ExtendedPropertyValueEditor _
    Inherits PropertyValueEditor
'Usage
Dim instance As ExtendedPropertyValueEditor
public class ExtendedPropertyValueEditor : PropertyValueEditor
public ref class ExtendedPropertyValueEditor : public PropertyValueEditor
public class ExtendedPropertyValueEditor extends PropertyValueEditor

Remarks

The ExtendedPropertyValueEditor class can hold two DataTemplate objects, one for an inline editor and one for an extended editor. The inline editor provides a custom interface that appears within the bounds of the Properties window, and the extended editor provides an interface that appears in a new window.

The InlineEditorTemplate property returns the XAML template for the visual interface for the inline editor, and the ExtendedEditorTemplate property returns the XAML template for the extended editor. These are typically provided in a ResourceDictionary elsewhere in the project.

You should use the EditModeSwitchButton to invoke your custom ExtendedPropertyValueEditor, For a demonstration, see Walkthrough: Implementing a Color Editor.

Examples

The following code example shows how to use the ExtendedPropertyValueEditor class. For more information, see Walkthrough: Implementing a Color Editor.

' 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;
    }
}

Inheritance Hierarchy

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

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

ExtendedPropertyValueEditor Members

Microsoft.Windows.Design.PropertyEditing Namespace

Other Resources

Property Editing Architecture

WPF Designer Extensibility

Metadata Store