Classe PropertyValueEditor
Aggiornamento: novembre 2007
Contenitore per tutta logica di editor inline per le proprietà.
Spazio dei nomi: Microsoft.Windows.Design.PropertyEditing
Assembly: Microsoft.Windows.Design (in Microsoft.Windows.Design.dll)
Sintassi
Public Class PropertyValueEditor
Dim instance As PropertyValueEditor
public class PropertyValueEditor
public ref class PropertyValueEditor
public class PropertyValueEditor
Note
Questa classe può contenere un unico oggetto DataTemplate per un editor in linea. In genere, viene utilizzato per fornire un editor diverso o personalizzato per una proprietà della finestra Proprietà. L'editor in linea viene visualizzato all'interno della finestra Proprietà. Per fornire un editor personalizzato che disponga di un'area dello schermo più ampia e che non sia sempre visibile, vedere ExtendedPropertyValueEditor.
La proprietà InlineEditorTemplate restituisce il modello XAML per l'interfaccia visiva di questo editor. Tale modello, in genere viene fornito in un oggetto ResourceDictionary in un altro punto del progetto.
Esempi
Nell'esempio di codice seguente viene illustrato come utilizzare la classe PropertyValueEditor. Per ulteriori informazioni, vedere Procedura dettagliata: implementazione di un editor di valori inline.
' 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;
}
}
Gerarchia di ereditarietà
System.Object
Microsoft.Windows.Design.PropertyEditing.PropertyValueEditor
Microsoft.Windows.Design.PropertyEditing.DialogPropertyValueEditor
Microsoft.Windows.Design.PropertyEditing.ExtendedPropertyValueEditor
Codice thread safe
Qualsiasi membro static (Shared in Visual Basic) pubblico di questo tipo è thread-safe. I membri di istanza non sono garantiti come thread-safe.
Vedere anche
Riferimenti
Spazio dei nomi Microsoft.Windows.Design.PropertyEditing
Altre risorse
Architettura di modifica delle proprietà