Skip to content

PropertyList.PropertyEditorItem

JaykeBird edited this page Feb 21, 2023 · 6 revisions

Back to home | Back to Reference | View raw text

PropertyEditorItem class

Diagram

  flowchart LR
  classDef interfaceStyle stroke-dasharray: 5 5;
  classDef abstractStyle stroke-width:4px
  subgraph SolidShineUi.PropertyList
  SolidShineUi.PropertyList.PropertyEditorItem[[PropertyEditorItem]]
  end
  subgraph System.Windows.Markup
System.Windows.Markup.IComponentConnector[[IComponentConnector]]
  end
  subgraph System.Windows.Controls
System.Windows.Controls.UserControl[[UserControl]]
  end
System.Windows.Markup.IComponentConnector --> SolidShineUi.PropertyList.PropertyEditorItem
System.Windows.Controls.UserControl --> SolidShineUi.PropertyList.PropertyEditorItem
Loading

Members

Properties

Public properties

Type Name Methods
Type DeclaringType
Get or set the type that actually declared the property shown.
get, set
Brush GridlineBrush
Get or set the brush to use for the gridlines. Use PropertyEditorItem.ShowGridlines to determine if the gridlines will be visible or not.
get, set
bool IsInherited
Get or set if this property is an inherited property (i.e. the PropertyEditorItem.DeclaringType doesn't match the type of the object that is being observed in the parent ExperimentalPropertyList ).
get, set
bool IsReadOnly
Get if this property is read only, meaning it cannot be edited or changed.
get
IPropertyEditor PropertyEditorControl
Get or set the editor control to use to allow editing the value of this property.
get, set
PropertyInfo PropertyInfo
Get or set the PropertyInfo representing the property shown.
get
string PropertyName
Get or set the name of the property being shown.
get, set
Type PropertyType
Get or set the type of the property being shown.
get
string PropertyTypeText
Get or set the type of the property being shown, in a more user-friendly textual format.
get, set
object PropertyValue
Get or set the value of the property shown.
get, set
bool ShowGridlines
Get or set if gridlines should be displayed in the editor entry. Showing the gridlines will make the editor appear more like the WinForms PropertyGrid control.
get, set

Methods

Public methods

Returns Name
void ApplyPropertyValue(object targetObject)
Set the value of this property, in regards to the target object.
void InitializeComponent()
InitializeComponent
void LoadProperty(PropertyInfo property, object value, IPropertyEditor editor)
Load in a property to show in this PropertyEditorItem, with (if possible) a IPropertyEditor control to allow editing the property value.
void UpdateColumnWidths(GridLength namesCol, GridLength typesCol, GridLength valueCol)
Update the widths of the internal columns in this control, to match the widths in some other location.

Details

Inheritance

  • IComponentConnector
  • UserControl

Constructors

PropertyEditorItem

public PropertyEditorItem()
Summary

Create a new PropertyEditorItem

Methods

LoadProperty

public void LoadProperty(PropertyInfo property, object value, IPropertyEditor editor)
Arguments
Type Name Description
PropertyInfo property The information about this property being shown. This is used to fill most data in this control.
object value The value of the property, in regards to the object being observed in the parent ExperimentalPropertyList .
IPropertyEditor editor The IPropertyEditor control, if present, that is useable for editing the value of this property.
Summary

Load in a property to show in this PropertyEditorItem, with (if possible) a IPropertyEditor control to allow editing the property value.

ApplyPropertyValue

public void ApplyPropertyValue(object targetObject)
Arguments
Type Name Description
object targetObject The object to set the value of the property on.
Summary

Set the value of this property, in regards to the target object.

Exceptions
Name Description
ArgumentNullException Thrown if the target object is null.
InvalidOperationException Thrown if the PropertyInfo is null. If this is null, a property cannot be set.

UpdateColumnWidths

public void UpdateColumnWidths(GridLength namesCol, GridLength typesCol, GridLength valueCol)
Arguments
Type Name Description
GridLength namesCol The width for the Name column.
GridLength typesCol The width for the Type column.
GridLength valueCol The width for the Value column.
Summary

Update the widths of the internal columns in this control, to match the widths in some other location.

InitializeComponent

public virtual void InitializeComponent()
Summary

InitializeComponent

Properties

PropertyInfo

public PropertyInfo PropertyInfo { get; }
Summary

Get or set the PropertyInfo representing the property shown.

PropertyValue

public object PropertyValue { get; set; }
Summary

Get or set the value of the property shown.

PropertyEditorControl

public IPropertyEditor PropertyEditorControl { get; set; }
Summary

Get or set the editor control to use to allow editing the value of this property.

IsReadOnly

public bool IsReadOnly { get; }
Summary

Get if this property is read only, meaning it cannot be edited or changed.

DeclaringType

public Type DeclaringType { get; set; }
Summary

Get or set the type that actually declared the property shown.

IsInherited

public bool IsInherited { get; set; }
Summary

Get or set if this property is an inherited property (i.e. the PropertyEditorItem.DeclaringType doesn't match the type of the object that is being observed in the parent ExperimentalPropertyList ).

PropertyName

public string PropertyName { get; set; }
Summary

Get or set the name of the property being shown.

PropertyType

public Type PropertyType { get; }
Summary

Get or set the type of the property being shown.

PropertyTypeText

public string PropertyTypeText { get; set; }
Summary

Get or set the type of the property being shown, in a more user-friendly textual format.

ShowGridlines

public bool ShowGridlines { get; set; }
Summary

Get or set if gridlines should be displayed in the editor entry. Showing the gridlines will make the editor appear more like the WinForms PropertyGrid control.

GridlineBrush

public Brush GridlineBrush { get; set; }
Summary

Get or set the brush to use for the gridlines. Use PropertyEditorItem.ShowGridlines to determine if the gridlines will be visible or not.

Events

PropertyEditorValueChanged

public event PropertyEditorValueChangedEventHandler PropertyEditorValueChanged
Summary

Raised when the value of this property is changed, by use of a PropertyEditorItem.PropertyEditorControl .

Delegates

PropertyEditorValueChangedEventHandler

public delegate void PropertyEditorValueChangedEventHandler(object sender, PropertyEditorValueChangedEventArgs e)
Arguments
Type Name Description
object sender
PropertyEditorValueChangedEventArgs e

Generated with ModularDoc

Clone this wiki locally