ShellObjectItemAdapter Class
Provides an abstract base class for a TreeListBoxItemAdapter that can be used in a ShellTreeListBox or ShellListView.
public class ShellObjectItemAdapter : TreeListBoxItemAdapter
- Inheritance:
- object TreeListBoxItemAdapter object
Constructors
ShellObjectItemAdapter()
Initializes an instance of the class.
public ShellObjectItemAdapter()
Methods
CanHaveChildren(TreeListBox, object)
Returns whether the specified item is capable of having child items.
public override bool CanHaveChildren(TreeListBox ownerControl, object item)
| Parameter | Type | Description |
|---|---|---|
| ownerControl | TreeListBox | The owner control. |
| item | object | The item to examine. |
Returns
- bool:
trueif the specified item is capable of having child items; otherwise,false.
Remarks
The default implementation of this method returns true.
This method should only return false if an item is not capable of having child items and is always a 'leaf' node in the tree.
It should not return false if the item can have child items, but doesn't at the current time.
Optimizations are in place to not call GetChildren(TreeListBox, object) when this method returns true.
This method should be overridden if OnExpansion is used and certain items are known to be 'leaf' nodes.
CreateShellObjectViewModel(TreeListBox, IShellObject)
Creates a new ShellObjectViewModel that wraps the specified IShellObject.
protected virtual ShellObjectViewModel? CreateShellObjectViewModel(TreeListBox ownerControl, IShellObject shellObject)
| Parameter | Type | Description |
|---|---|---|
| ownerControl | TreeListBox | The owner control. |
| shellObject | IShellObject | The IShellObject to wrap. |
Returns
- ShellObjectViewModel:
The ShellObjectViewModel that was created.
Remarks
Override this method to customize the IShellObject before it is added to the user interface.
Return null to prevent the IShellObject from being added.
GetAbsolutePath(TreeListBox, object)
Returns the item's absolute (rooted) string path, if known from the item itself.
public override string? GetAbsolutePath(TreeListBox ownerControl, object item)
| Parameter | Type | Description |
|---|---|---|
| ownerControl | TreeListBox | The owner control. |
| item | object | The item to examine. |
Returns
Remarks
The absolute path can be used to improve performance when searching for an item in a large tree since it allows for a path-based search instead of an exhaustive breadth-first search through the tree. A null string should be returned for items that don't know their absolute path.
GetBackgroundContextMenu(TreeListBox, ShellObjectViewModel?)
Returns the ContextMenu for the background of a control with the specified root view-model.
public virtual ContextMenu? GetBackgroundContextMenu(TreeListBox ownerControl, ShellObjectViewModel? rootViewModel)
| Parameter | Type | Description |
|---|---|---|
| ownerControl | TreeListBox | The owner control. |
| rootViewModel | ShellObjectViewModel | The root view-model. |
Returns
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
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.
GetIsEditable(TreeListBox, object)
Returns whether the specified item is editable.
public override bool GetIsEditable(TreeListBox ownerControl, object item)
| Parameter | Type | Description |
|---|---|---|
| ownerControl | TreeListBox | The owner control. |
| item | object | The item to examine. |
Returns
- bool:
trueif the specified item is editable; otherwise,false.
Remarks
The IsEditableBinding 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 IsEditableDefault property can also be set (if IsEditableBinding is not used) to designate the default return value of this method, and that can be set in XAML.
GetIsEditing(TreeListBox, object)
Returns whether the specified item is currently being edited.
public override bool GetIsEditing(TreeListBox ownerControl, object item)
| Parameter | Type | Description |
|---|---|---|
| ownerControl | TreeListBox | The owner control. |
| item | object | The item to examine. |
Returns
- bool:
trueif the specified item is currently being edited; otherwise,false.
Remarks
The IsEditingBinding 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.
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:
trueif 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:
trueif 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.
GetItemContextMenu(TreeListBox, IList<ShellObjectViewModel>)
Returns the ContextMenu for the specified collection of view-models.
public virtual ContextMenu? GetItemContextMenu(TreeListBox ownerControl, IList<ShellObjectViewModel> viewModels)
| Parameter | Type | Description |
|---|---|---|
| ownerControl | TreeListBox | The owner control. |
| viewModels | IList<ShellObjectViewModel> | The view-models to examine. |
Returns
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.
SetIsEditing(TreeListBox, object, bool)
Sets whether the specified item is currently being edited.
public override void SetIsEditing(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 IsEditingBinding 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.
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.
Inherited Members
- TreeListBoxItemAdapter.CreateVirtualPlaceholder(TreeListBox, object, int)
- TreeListBoxItemAdapter.Filter(TreeListBox, object)
- TreeListBoxItemAdapter.GetChildrenQueryMode(TreeListBox, object)
- TreeListBoxItemAdapter.GetDefaultActionCommand(TreeListBox, object)
- TreeListBoxItemAdapter.GetExpandability(TreeListBox, object, int)
- TreeListBoxItemAdapter.GetIndentAmount(TreeListBox, object, int)
- TreeListBoxItemAdapter.GetIsDraggable(TreeListBox, object)
- TreeListBoxItemAdapter.GetIsLoading(TreeListBox, object)
- TreeListBoxItemAdapter.GetIsSelectable(TreeListBox, object)
- TreeListBoxItemAdapter.GetSearchText(TreeListBox, object)
- TreeListBoxItemAdapter.InitializeDataObject(TreeListBox, IDataObject, IEnumerable<object>)
- TreeListBoxItemAdapter.OnDragComplete(InputPointerEventArgs, TreeListBox, DataObject, DragDropEffects)
- TreeListBoxItemAdapter.OnDragHover(DragEventArgs, TreeListBox, object)
- TreeListBoxItemAdapter.OnDragOver(DragEventArgs, TreeListBox, object, TreeItemDropArea)
- TreeListBoxItemAdapter.OnDragStart(InputPointerEventArgs, TreeListBox, DataObject, DragDropEffects)
- TreeListBoxItemAdapter.OnDrop(DragEventArgs, TreeListBox, object, TreeItemDropArea)
- TreeListBoxItemAdapter.ChildrenBinding
- TreeListBoxItemAdapter.ChildrenPath
- TreeListBoxItemAdapter.ChildrenQueryModeDefault
- TreeListBoxItemAdapter.DefaultActionCommandBinding
- TreeListBoxItemAdapter.ExpandabilityDefault
- TreeListBoxItemAdapter.IsDraggableBinding
- TreeListBoxItemAdapter.IsEditableBinding
- TreeListBoxItemAdapter.IsEditableDefault
- TreeListBoxItemAdapter.IsEditingBinding
- TreeListBoxItemAdapter.IsEditingPath
- TreeListBoxItemAdapter.IsExpandedBinding
- TreeListBoxItemAdapter.IsExpandedDefault
- TreeListBoxItemAdapter.IsExpandedPath
- TreeListBoxItemAdapter.IsLoadingBinding
- TreeListBoxItemAdapter.IsLoadingPath
- TreeListBoxItemAdapter.IsSelectableBinding
- TreeListBoxItemAdapter.IsSelectablePath
- TreeListBoxItemAdapter.IsSelectedBinding
- TreeListBoxItemAdapter.IsSelectedPath
- TreeListBoxItemAdapter.PathBinding
- TreeListBoxItemAdapter.SearchTextBinding
- TreeListBoxItemAdapter.TopLevelExpandabilityDefault
- object.GetType()
- object.MemberwiseClone()
- object.ToString()
- object.Equals(object)
- object.Equals(object, object)
- object.ReferenceEquals(object, object)
- object.GetHashCode()