In This Article

PropertyGridItemAdapter Class

Provides an abstract base class for a TreeListBoxItemAdapter that can be used in a PropertyGrid.

public class PropertyGridItemAdapter : TreeListBoxItemAdapter
Inheritance:
object TreeListBoxItemAdapter object

Constructors

PropertyGridItemAdapter()

Initializes an instance of the class.

public PropertyGridItemAdapter()

Methods

GetChildren(TreeListBox, object)

Returns an IEnumerable that will be used to provide child items for the specified parent item.

public override IEnumerable? GetChildren(TreeListBox ownerControl, object item)
Parameter Type Description
ownerControl TreeListBox

The owner control.

item object

The item to examine.

Returns

IEnumerable

Remarks

The ChildrenBinding property can be set for a pure XAML-based implementation of this method. Please note that bindings aren't as performant as code, so for large trees or if you see performance issues, it is recommended to override this method instead with custom logic to retrieve the appropriate value.

GetIndentAmount(TreeListBox, object, int)

Returns the indent amount of the specified item.

public override double GetIndentAmount(TreeListBox ownerControl, object item, int depth)
Parameter Type Description
ownerControl TreeListBox

The owner control.

item object

The item to examine.

depth int

The item depth.

Returns

double

GetIsExpanded(TreeListBox, object)

Returns whether the specified item is expanded.

public override bool GetIsExpanded(TreeListBox ownerControl, object item)
Parameter Type Description
ownerControl TreeListBox

The owner control.

item object

The item to examine.

Returns

bool:

true if the specified item is expanded; otherwise, false.

Remarks

The IsExpandedBinding binding property can be set for a pure XAML-based implementation of this method. Please note that bindings aren't as performant as code, so for large trees or if you see performance issues, it is recommended to override this method instead with custom logic to retrieve the appropriate value. The IsExpandedDefault property can also be set (if IsExpandedBinding is not used) to designate the default return value of this method, and that can be set in XAML.

GetIsSelected(TreeListBox, object)

Returns whether the specified item is selected.

public override bool GetIsSelected(TreeListBox ownerControl, object item)
Parameter Type Description
ownerControl TreeListBox

The owner control.

item object

The item to examine.

Returns

bool:

true if the specified item is selected; otherwise, false.

Remarks

The IsSelectedBinding binding property can be set for a pure XAML-based implementation of this method. Please note that bindings aren't as performant as code, so for large trees or if you see performance issues, it is recommended to override this method instead with custom logic to retrieve the appropriate value.

GetPath(TreeListBox, object)

Returns the item's string path, relative to its parent.

public override string? GetPath(TreeListBox ownerControl, object item)
Parameter Type Description
ownerControl TreeListBox

The owner control.

item object

The item to examine.

Returns

string:

The item's string path, relative to its parent.

Remarks

The PathBinding property can be set for a pure XAML-based implementation of this method. Please note that bindings aren't as performant as code, so for large trees or if you see performance issues, it is recommended to override this method instead with custom logic to retrieve the appropriate value.

InitializeDataObjectWithDisplayName(PropertyGrid, IDataObject, IDataModel)

Initializes an IDataObject with the display name of the specified IDataModel.

public virtual bool InitializeDataObjectWithDisplayName(PropertyGrid sourceControl, IDataObject dataObject, IDataModel model)
Parameter Type Description
sourceControl PropertyGrid

The source control that contains the IDataModel.

dataObject IDataObject

The IDataObject to initialize.

model IDataModel

The IDataModel to examine.

Returns

bool:

true if the IDataObject was initialized; otherwise, false.

InitializeDataObjectWithPropertyValue(PropertyGrid, IDataObject, IPropertyModel)

Initializes a IDataObject with the value of the specified IPropertyModel.

public virtual bool InitializeDataObjectWithPropertyValue(PropertyGrid sourceControl, IDataObject dataObject, IPropertyModel propertyModel)
Parameter Type Description
sourceControl PropertyGrid

The source control that contains the IPropertyModel.

dataObject IDataObject

The IDataObject to initialize.

propertyModel IPropertyModel

The IPropertyModel to examine.

Returns

bool:

true if the IDataObject was initialized; otherwise, false.

SetIsExpanded(TreeListBox, object, bool)

Sets whether the specified item is expanded.

public override void SetIsExpanded(TreeListBox ownerControl, object item, bool value)
Parameter Type Description
ownerControl TreeListBox

The owner control.

item object

The item to update.

value bool

The new value.

Remarks

The IsExpandedBinding binding property can be set to a two-way binding for a pure XAML-based implementation of this method. Please note that bindings aren't as performant as code, so for large trees or if you see performance issues, it is recommended to override this method instead with custom logic to set the appropriate value.

SetIsSelected(TreeListBox, object, bool)

Sets whether the specified item is selected.

public override void SetIsSelected(TreeListBox ownerControl, object item, bool value)
Parameter Type Description
ownerControl TreeListBox

The owner control.

item object

The item to update.

value bool

The new value.

Remarks

The IsSelectedBinding binding property can be set to a two-way binding for a pure XAML-based implementation of this method. Please note that bindings aren't as performant as code, so for large trees or if you see performance issues, it is recommended to override this method instead with custom logic to set the appropriate value.

SetPropertyValueFromDataObject(PropertyGrid, IDataObject, IPropertyModel)

Sets the value of the specified IPropertyModel from data in a IDataObject.

public virtual bool SetPropertyValueFromDataObject(PropertyGrid sourceControl, IDataObject dataObject, IPropertyModel propertyModel)
Parameter Type Description
sourceControl PropertyGrid

The source control that contains the IPropertyModel.

dataObject IDataObject

The IDataObject to examine.

propertyModel IPropertyModel

The IPropertyModel whose value will be set.

Returns

bool:

true if the IPropertyModel value was updated; otherwise, false.

Inherited Members

Extension Methods