Skip to content

PropertyList.ExperimentalPropertyList

JaykeBird edited this page Feb 21, 2023 · 11 revisions

Back to home | Back to Reference | View raw text

ExperimentalPropertyList class

Diagram

  flowchart LR
  classDef interfaceStyle stroke-dasharray: 5 5;
  classDef abstractStyle stroke-width:4px
  subgraph SolidShineUi.PropertyList
  SolidShineUi.PropertyList.ExperimentalPropertyList[[ExperimentalPropertyList]]
  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.ExperimentalPropertyList
System.Windows.Controls.UserControl --> SolidShineUi.PropertyList.ExperimentalPropertyList
Loading

Members

Properties

Public properties

Type Name Methods
Brush ButtonClickBrush
Get or set the brush for the buttons on the toolbar when they are being clicked.
get, set
Brush ButtonHighlightBorderBrush
Get or set the brush for the borders of the buttons on the toolbar, when the buttons are being highlighted or clicked. (The buttons display no border when not focused.)
get, set
Brush ButtonHighlightBrush
Get or set the brush for the buttons on the toolbar when they are highlighted (i.e. mouse over or keyboard focus).
get, set
ColorScheme ColorScheme
Get or set the color scheme to apply to the control. The color scheme can quickly apply a whole visual style to your control.
get, set
object Content
Get the internal contents of this PropertyList control.
get, set
PropertyListDisplayFlags DisplayOptions
Get or set the settings for what properties should be displayed in the PropertyList.
get, set
string FilterBoxToolTip
Get or set the label to display in a tool-tip when the Filter text box has focus or mouse over.
get, set
Brush GridlineBrush
Get or set the brush of the gridlines in the control. Use ExperimentalPropertyList.ShowGridlines to actually display the gridlines.
get, set
Brush HeaderBackground
Get or set the brush for the background of the column headers.
get, set
Brush HeaderDividerBrush
Get or set the brush for the dividers between the column headers.
get, set
Brush HeaderForeground
Get or set the brush for the foreground of the column headers.
get, set
string NameHeaderLabel
Get or set the label to display in the column header for the Name column.
get, set
string ObjectDisplayName
Get or set the string used to name the object being observed. The PropertyList will try to set this automatically via looking at the Name property,
or otherwise you can set a custom name to display.
get, set
ReadOnlyDictionary<Type, Type> RegisteredPropertyEditors
Get a list of editors currently registered for each property type.
get
bool ShowFilterBox
Get or set if the Filter textbox should be visible at the top of the PropertyList control.
get, set
bool ShowGridlines
Get or set if gridlines are visible between the properties in the control.
get, set
bool ShowInheritedProperties
Get or set if inherited properties (properties not defined directly in the observed object's type) are visible in the PropertyList.
get, set
bool ShowNameDisplay
Get or set if the name display text is displayed at the top of the PropertyList control.
get, set
bool ShowReadOnlyProperties
Get or set if inherited properties (properties not defined directly in the observed object's type) are visible in the PropertyList.
get, set
bool ShowReloadButton
Get or set if the Reload button should be visible at the top of the PropertyList control.
get, set
bool ShowTypeDisplay
Get or set if the type display text should be visible at the top of the PropertyList control.
get, set
bool ShowViewMenu
Get or set if the View and Sort menu button should be visible at the top of the PropertyList control.
get, set
PropertySortOption SortOption
Get or set how the list of properties are sorted in the PropertyList.
get, set
Brush ToolbarBackground
Get or set the brush for the background of the toolbar near the top of the control.
get, set
Brush TopPanelBackground
Get or set the brush for the background of the top panel of the control (where the name and type are displayed).
get, set
Brush TopPanelForeground
Get or set the brush for the foreground of the top panel of the control (where the name and type are displayed).
get, set
string TypeHeaderLabel
Get or set the label to display in the column header for the Type column.
get, set
string TypeLabel
Get or set the label to display next to the object's type at the top of the control.
get, set
string ValueHeaderLabel
Get or set the label to display in the column header for the Value column.
get, set
string ViewMenuLabel
Get or set the label to display in the View menu in the toolbar.
get, set

Methods

Public methods

Returns Name
void ApplyColorScheme(ColorScheme cs)
Apply a color scheme to this control. The color scheme can quickly apply a whole visual style to the control.
void Clear()
Unload the currently observed object, so that nothing is observed.
IPropertyEditor CreateEditorForType(Type propType)
Create a new IPropertyEditor object appropriate for the passed-in type. This is based upon what types are registered in this PropertyList control.
void FilterProperties(string filter)
Change the text used to filter the list of properties. Applying a filter text will hide any properties that don't contain this text (or its type doesn't contain this text).
object GetCurrentlyLoadedObject()
Get the object that is currently being observed in this PropertyList.
void InitializeComponent()
InitializeComponent
void LoadObject(object o)
Set the object to observe. All properties of the observed object will be displayed in the ExperimentalPropertyList, alongside the values of these properties.
void RegisterEditor(Type type, Type editor)
Register an editor for a certain property type. When the control loads an object with a property of this type, the registered editor will be used to view and edit it.
void ReloadObject(...)
Reload the properties and values from the currently observed object.
bool UnregisterEditor(Type type)
Unregister the editor for a certain type.

Internal methods

Returns Name
Delegate _CreateDelegate(Type delegateType, string handler)

Public Static methods

Returns Name
string PrettifyPropertyType(Type type, bool fullName)
Get a slightly cleaned up and more human-readable name of a type.

Details

Inheritance

  • IComponentConnector
  • UserControl

Constructors

ExperimentalPropertyList

public ExperimentalPropertyList()
Summary

Create a PropertyList.

Methods

ApplyColorScheme

public void ApplyColorScheme(ColorScheme cs)
Arguments
Type Name Description
ColorScheme cs The color scheme to apply.
Summary

Apply a color scheme to this control. The color scheme can quickly apply a whole visual style to the control.

GetCurrentlyLoadedObject

public object GetCurrentlyLoadedObject()
Summary

Get the object that is currently being observed in this PropertyList.

ReloadObject [1/2]

public void ReloadObject()
Summary

Reload the properties and values from the currently observed object.

ReloadObject [2/2]

public void ReloadObject(bool resetViewSettings)
Arguments
Type Name Description
bool resetViewSettings Set if the filter and view settings should be reset when the object is reloaded.
Summary

Reload the properties and values from the currently observed object, with the option to reset filter and view settings if desired.

Clear

public void Clear()
Summary

Unload the currently observed object, so that nothing is observed.

Remarks

This clears out the UI and resets internal properties; however, this does not need to be run before loading in another object.

LoadObject

public void LoadObject(object o)
Arguments
Type Name Description
object o The object to load and observe.
Summary

Set the object to observe. All properties of the observed object will be displayed in the ExperimentalPropertyList, alongside the values of these properties.

Remarks

Note that if the object has a property called "Name", that name will be displayed at the top of the ExperimentalPropertyList control. If this object doesn't have a Name property, or you want to set a different name, please use the ExperimentalPropertyList.ObjectDisplayName property.

FilterProperties

public void FilterProperties(string filter)
Arguments
Type Name Description
string filter The filter text to apply. Use null or an empty string to not apply a filter. Start the string with "@" to only filter by property name only (not name or type).
Summary

Change the text used to filter the list of properties. Applying a filter text will hide any properties that don't contain this text (or its type doesn't contain this text).

RegisterEditor

public void RegisterEditor(Type type, Type editor)
Arguments
Type Name Description
Type type The type to register the editor for.
Type editor The type of the IPropertyEditor control that will handle viewing and editing type .
Summary

Register an editor for a certain property type. When the control loads an object with a property of this type, the registered editor will be used to view and edit it.

Remarks

If a different editor is already registered for a certain type, this will replace that registration and the control will use this editor instead.

Exceptions
Name Description
ArgumentException Thrown if the editor type does not inherit the IPropertyEditor interface.

UnregisterEditor

public bool UnregisterEditor(Type type)
Arguments
Type Name Description
Type type The property type to unregister the editor of. (For example, enter in typeof(string) , not typeof(StringEditor) ).
Summary

Unregister the editor for a certain type.

Returns

Returns true on success. Returns false if the editor couldn't be unregistered, or there was no editor registered to begin with.

CreateEditorForType

public IPropertyEditor CreateEditorForType(Type propType)
Arguments
Type Name Description
Type propType The type for which to get a IPropertyEditor for.
Summary

Create a new IPropertyEditor object appropriate for the passed-in type. This is based upon what types are registered in this PropertyList control.

Returns

PrettifyPropertyType

public static string PrettifyPropertyType(Type type, bool fullName)
Arguments
Type Name Description
Type type The type to get the name of.
bool fullName Determine if the full name (including namespaces) should be returned or just the type's own name
Summary

Get a slightly cleaned up and more human-readable name of a type.

Returns

InitializeComponent

public virtual void InitializeComponent()
Summary

InitializeComponent

_CreateDelegate

internal Delegate _CreateDelegate(Type delegateType, string handler)
Arguments
Type Name Description
Type delegateType
string handler

Properties

Content

public object Content { get; set; }
Summary

Get the internal contents of this PropertyList control.

Remarks

To load in an object into the PropertyList, please use the ExperimentalPropertyList.LoadObject(System.Object) function instead. It is highly unrecommended to access and modify the internal contents of the PropertyList control in this way, but it is possible.

ColorScheme

public ColorScheme ColorScheme { get; set; }
Summary

Get or set the color scheme to apply to the control. The color scheme can quickly apply a whole visual style to your control.

ObjectDisplayName

public string ObjectDisplayName { get; set; }
Summary

Get or set the string used to name the object being observed. The PropertyList will try to set this automatically via looking at the Name property, or otherwise you can set a custom name to display.

TypeLabel

public string TypeLabel { get; set; }
Summary

Get or set the label to display next to the object's type at the top of the control.

Remarks

You can hide the entire type label and display by setting ExperimentalPropertyList.ShowTypeDisplay to false.

ViewMenuLabel

public string ViewMenuLabel { get; set; }
Summary

Get or set the label to display in the View menu in the toolbar.

NameHeaderLabel

public string NameHeaderLabel { get; set; }
Summary

Get or set the label to display in the column header for the Name column.

TypeHeaderLabel

public string TypeHeaderLabel { get; set; }
Summary

Get or set the label to display in the column header for the Type column.

ValueHeaderLabel

public string ValueHeaderLabel { get; set; }
Summary

Get or set the label to display in the column header for the Value column.

FilterBoxToolTip

public string FilterBoxToolTip { get; set; }
Summary

Get or set the label to display in a tool-tip when the Filter text box has focus or mouse over.

SortOption

public PropertySortOption SortOption { get; set; }
Summary

Get or set how the list of properties are sorted in the PropertyList.

Remarks

If this setting is changed, you will need to reload the object ( ExperimentalPropertyList.ReloadObject ) or load a new object to apply that change.

DisplayOptions

public PropertyListDisplayFlags DisplayOptions { get; set; }
Summary

Get or set the settings for what properties should be displayed in the PropertyList.

Remarks

When loading in an object, the attributes for each property in that object are looked at. If a property has an attribute that matches what a flag disallows, that property is not loaded. If this setting is changed, you will need to reload the object ( ExperimentalPropertyList.ReloadObject ) or load a new object to apply that change.

ShowInheritedProperties

public bool ShowInheritedProperties { get; set; }
Summary

Get or set if inherited properties (properties not defined directly in the observed object's type) are visible in the PropertyList.

ShowReadOnlyProperties

public bool ShowReadOnlyProperties { get; set; }
Summary

Get or set if inherited properties (properties not defined directly in the observed object's type) are visible in the PropertyList.

RegisteredPropertyEditors

public ReadOnlyDictionary<Type, Type> RegisteredPropertyEditors { get; }
Summary

Get a list of editors currently registered for each property type.

Remarks

The key of the dictionary is a property type. The corresponding value is the type of the editor that will handle viewing and editing that type.

ShowNameDisplay

public bool ShowNameDisplay { get; set; }
Summary

Get or set if the name display text is displayed at the top of the PropertyList control.

Remarks

PropertyList tries to load the name of a control by looking at its Name property; otherwise, you can also custom set a name via the ExperimentalPropertyList.ObjectDisplayName property.

ShowTypeDisplay

public bool ShowTypeDisplay { get; set; }
Summary

Get or set if the type display text should be visible at the top of the PropertyList control.

ShowFilterBox

public bool ShowFilterBox { get; set; }
Summary

Get or set if the Filter textbox should be visible at the top of the PropertyList control.

ShowReloadButton

public bool ShowReloadButton { get; set; }
Summary

Get or set if the Reload button should be visible at the top of the PropertyList control.

ShowViewMenu

public bool ShowViewMenu { get; set; }
Summary

Get or set if the View and Sort menu button should be visible at the top of the PropertyList control.

ShowGridlines

public bool ShowGridlines { get; set; }
Summary

Get or set if gridlines are visible between the properties in the control.

GridlineBrush

public Brush GridlineBrush { get; set; }
Summary

Get or set the brush of the gridlines in the control. Use ExperimentalPropertyList.ShowGridlines to actually display the gridlines.

HeaderBackground

public Brush HeaderBackground { get; set; }
Summary

Get or set the brush for the background of the column headers.

HeaderForeground

public Brush HeaderForeground { get; set; }
Summary

Get or set the brush for the foreground of the column headers.

ToolbarBackground

public Brush ToolbarBackground { get; set; }
Summary

Get or set the brush for the background of the toolbar near the top of the control.

ButtonHighlightBrush

public Brush ButtonHighlightBrush { get; set; }
Summary

Get or set the brush for the buttons on the toolbar when they are highlighted (i.e. mouse over or keyboard focus).

ButtonClickBrush

public Brush ButtonClickBrush { get; set; }
Summary

Get or set the brush for the buttons on the toolbar when they are being clicked.

ButtonHighlightBorderBrush

public Brush ButtonHighlightBorderBrush { get; set; }
Summary

Get or set the brush for the borders of the buttons on the toolbar, when the buttons are being highlighted or clicked. (The buttons display no border when not focused.)

TopPanelBackground

public Brush TopPanelBackground { get; set; }
Summary

Get or set the brush for the background of the top panel of the control (where the name and type are displayed).

TopPanelForeground

public Brush TopPanelForeground { get; set; }
Summary

Get or set the brush for the foreground of the top panel of the control (where the name and type are displayed).

HeaderDividerBrush

public Brush HeaderDividerBrush { get; set; }
Summary

Get or set the brush for the dividers between the column headers.

Events

PropertyValueChanged

public event PropertyValueChangedEventHandler PropertyValueChanged
Summary

Raised when the value of a property has changed via a property editor. This refers to the properties of the object currently being observed by the PropertyList control.

LoadedObjectChanged

public event PropertyListObjectEventHandler LoadedObjectChanged
Summary

Raised when the currently loaded/observed object in the PropertyList control changes.

Remarks

This is also raised when the ReloadObject

ColorSchemeChanged

public event DependencyPropertyChangedEventHandler ColorSchemeChanged
Summary

Raised when the ColorScheme property is changed.

GridlinePropertyChanged

internal event EventHandler GridlinePropertyChanged

Delegates

PropertyValueChangedEventHandler

public delegate void PropertyValueChangedEventHandler(object sender, PropertyValueChangedEventArgs e)
Arguments
Type Name Description
object sender
PropertyValueChangedEventArgs e

PropertyListObjectEventHandler

public delegate void PropertyListObjectEventHandler(object sender, PropertyListObjectEventArgs e)
Arguments
Type Name Description
object sender
PropertyListObjectEventArgs e

Generated with ModularDoc

Clone this wiki locally