Skip to content

PropertyList.IPropertyEditor

JaykeBird edited this page Feb 21, 2023 · 6 revisions

Back to home | Back to Reference | View raw text

IPropertyEditor interface

Description

Represents the common interface that all property editor controls inherit from, to provide methods in regards to loading, editing, and setting properties. Classes that implement this interface should inherit from Control or UserControl .

Diagram

  flowchart LR
  classDef interfaceStyle stroke-dasharray: 5 5;
  classDef abstractStyle stroke-width:4px
  subgraph SolidShineUi.PropertyList
  SolidShineUi.PropertyList.IPropertyEditor[[IPropertyEditor]]
  class SolidShineUi.PropertyList.IPropertyEditor interfaceStyle;
  end
  subgraph System.Windows
System.Windows.IInputElement[[IInputElement]]
System.Windows.IFrameworkInputElement[[IFrameworkInputElement]]
  end
System.Windows.IInputElement --> SolidShineUi.PropertyList.IPropertyEditor
System.Windows.IFrameworkInputElement --> SolidShineUi.PropertyList.IPropertyEditor
Loading

Members

Properties

Public properties

Type Name Methods
ColorScheme ColorScheme
Set the ColorScheme, to set the visual appearance of the control.
set
bool EditorAllowsModifying
Get whether this editor control actually has the capability to edit the value of a property, not just viewing it.
get
bool IsPropertyWritable
Get or set if the property being loaded can actually be edited (writeable).
get, set
ExperimentalPropertyList ParentPropertyList
Set the parent PropertyList control for this IPropertyEditor. This allows the IPropertyEditor to connect to the PropertyList directly, to get info or set certain values.
set
List<Type> ValidTypes
Get a list of all valid types that this editor supports editing.
get

Methods

Public methods

Returns Name
FrameworkElement GetFrameworkElement()
Get the FrameworkElement for this IPropertyEditor control.
object GetValue()
Get the value of the property, as set in this editor control.
void LoadValue(object value, Type type)
Load in the value of a property.

Details

Summary

Represents the common interface that all property editor controls inherit from, to provide methods in regards to loading, editing, and setting properties. Classes that implement this interface should inherit from Control or UserControl .

Inheritance

  • IInputElement
  • IFrameworkInputElement

Methods

GetFrameworkElement

public FrameworkElement GetFrameworkElement()
Summary

Get the FrameworkElement for this IPropertyEditor control.

Remarks

This is present due to how the WPF architecture was designed, and limitations with C# itself. Please simply return this in your code when implementing this interface.

LoadValue

public void LoadValue(object value, Type type)
Arguments
Type Name Description
object value The value to load.
Type type The type of the property; this may not exactly match the type of the value itself, but the value's type will always implement this type.
Summary

Load in the value of a property.

GetValue

public object GetValue()
Summary

Get the value of the property, as set in this editor control.

Properties

ValidTypes

public List<Type> ValidTypes { get; }
Summary

Get a list of all valid types that this editor supports editing.

EditorAllowsModifying

public bool EditorAllowsModifying { get; }
Summary

Get whether this editor control actually has the capability to edit the value of a property, not just viewing it.

IsPropertyWritable

public bool IsPropertyWritable { get; set; }
Summary

Get or set if the property being loaded can actually be edited (writeable).

ColorScheme

public ColorScheme ColorScheme { set; }
Summary

Set the ColorScheme, to set the visual appearance of the control.

Remarks

This is a setter-only property in the interface as a getter is never needed. Implementers can add a getter for this property if needed.

ParentPropertyList

public ExperimentalPropertyList ParentPropertyList { set; }
Summary

Set the parent PropertyList control for this IPropertyEditor. This allows the IPropertyEditor to connect to the PropertyList directly, to get info or set certain values.

Events

ValueChanged

public event EventHandler ValueChanged
Summary

Raised when the value is changed, by changing the data in this editor control. Handlers should then call IPropertyEditor.GetValue to then get the value to set the underlying property to.

Generated with ModularDoc

Clone this wiki locally