ShellTreeListBox Class
Represents a single-column tree view control that enumerates shell objects.
public class ShellTreeListBox : TreeListBox
- Inheritance:
- object Visual UIElement FrameworkElement Control ItemsControl TreeListBox object
Constructors
ShellTreeListBox()
Initializes an instance of the class.
public ShellTreeListBox()
Properties
AssemblyInfo
The UIAssemblyInfoBase to use.
[Browsable(false)]
protected override sealed UIAssemblyInfoBase AssemblyInfo { get; }
Property Value
CanExpandAll
Indicates whether any expand all operations can occur.
protected override bool CanExpandAll { get; }
Property Value
- bool:
trueif any expand all operations can occur; otherwise,false. The default value istrue.
CanIncludeFiles
Whether files should be displayed.
public bool CanIncludeFiles { get; set; }
Property Value
- bool:
trueif files should be displayed; otherwise,false. The default value isfalse.
CanIncludeLinks
Whether links should be displayed.
public bool CanIncludeLinks { get; set; }
Property Value
- bool:
trueif links should be displayed; otherwise,false. The default value isfalse.
DefaultShellService
The default IShellService that should be used when RootShellFolderParsingName or RootSpecialFolderKind are set.
public IShellService? DefaultShellService { get; set; }
Property Value
- IShellService:
The default value is an instance of WindowsShellService.
Remarks
This property is not used if the RootShellFolder property is set directly.
IsDefaultItemContextMenuEnabled
Whether the default context menu is enabled for shell objects.
public bool IsDefaultItemContextMenuEnabled { get; set; }
Property Value
- bool:
trueif the default context menu is enabled for shell objects; otherwisefalse. The default value istrue.
IsNewFolderContextMenuItemAllowed
Whether a "New / Folder" menu item can be injected into the context menu for file system folders.
public bool IsNewFolderContextMenuItemAllowed { get; set; }
Property Value
- bool:
trueif a "New / Folder" menu item can be injected into the context menu for file system folders; otherwise,false. The default value isfalse.
IsRenamingEnabled
Whether objects can be renamed.
public bool IsRenamingEnabled { get; set; }
Property Value
- bool:
trueif objects can be renamed; otherwise,false. The default value istrue.
Remarks
The shell objects themselves must also support renaming via CanRename.
MoveUpCommand
The ICommand used to move the SelectedShellObject up a level.
RootShellFolder
The root IShellObject to display.
RootShellFolderParsingName
The root folder's full parsing name (commonly the same as the file system path), if known.
public string? RootShellFolderParsingName { get; set; }
Property Value
Remarks
Setting this property will update the RootShellFolder property.
RootSpecialFolderKind
The SpecialFolderKind that indicates the root special folder to display.
public SpecialFolderKind RootSpecialFolderKind { get; set; }
Property Value
Remarks
Setting this property will update the RootShellFolder property.
SelectedShellObject
The primary IShellObject that is selected in this control.
public IShellObject? SelectedShellObject { get; set; }
Property Value
Remarks
This property is the same as taking the ShellObjectViewModel value of the SelectedItem property,
and getting its Model property.
SelectedShellObjectEditingName
The SelectedShellObject's full user-friendly editing name (commonly the same as the file system path), if known.
public string? SelectedShellObjectEditingName { get; set; }
Property Value
Remarks
Setting this property will update the SelectedShellObject property.
Methods
DisposeShellInstances()
Disposes any unmanaged resources held by the RootShellFolder and DefaultShellService instances,
and also sets both property values to null.
public void DisposeShellInstances()
Remarks
This method should be called when the control will no longer be used since it ensures any unmanaged resources held by the shell object hierarchy and shell service are disposed.
NotifyDpiChanged()
Notifies that the DPI has changed.
[Obsolete("This method to manually notify of a DPI change was only necessary for .NET Framework targets prior to .NET 4.6.2 and is no longer necessary since DPI changes are now processed automatically.")]
public void NotifyDpiChanged()
Remarks
This method is only included for backwards compatibility and is no longer necessary.
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate().
public override void OnApplyTemplate()
OnContextMenuOpening(ContextMenuEventArgs)
Invoked whenever an unhandled ContextMenuOpening routed event reaches this class in its route. Implement this method to add class handling for this event.
protected override void OnContextMenuOpening(ContextMenuEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | ContextMenuEventArgs | The RoutedEventArgs that contains the event data. |
OnDpiChanged(DpiScale, DpiScale)
Called when the DPI at which this View is rendered changes.
protected override void OnDpiChanged(DpiScale oldDpi, DpiScale newDpi)
| Parameter | Type | Description |
|---|---|---|
| oldDpi | DpiScale | The previous DPI scale setting. |
| newDpi | DpiScale | The new DPI scale setting. |
OnIsRootItemVisibleChanged(RoutedEventArgs)
Occurs after the IsRootItemVisible property is changed.
protected override void OnIsRootItemVisibleChanged(RoutedEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | RoutedEventArgs | The event data. |
Remarks
This method has no default implementation. Because an intermediate class in the inheritance might implement this method, we recommend that you call the base implementation in your implementation.
OnItemMenuRequested(TreeListBoxItemMenuEventArgs)
Occurs when an item requests a context menu.
protected override void OnItemMenuRequested(TreeListBoxItemMenuEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | TreeListBoxItemMenuEventArgs | The event data. |
Remarks
This method has no default implementation. Because an intermediate class in the inheritance might implement this method, we recommend that you call the base implementation in your implementation.
OnSelectionChanged(SelectionChangedEventArgs)
Occurs when the selection is changed.
protected override void OnSelectionChanged(SelectionChangedEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | SelectionChangedEventArgs | The event data. |
Remarks
This method has no default implementation. Because an intermediate class in the inheritance might implement this method, we recommend that you call the base implementation in your implementation.
SelectItemByFullPath(string)
Sets the SelectedItem to the node with the specified full path.
public override bool SelectItemByFullPath(string fullPath)
| Parameter | Type | Description |
|---|---|---|
| fullPath | string | The full path to the node whose container should be selected. |
Returns
- bool:
trueif a node was selected; otherwise,false.
Remarks
This method requires that the ItemAdapter supplies a path for each item.
Fields
CanIncludeFilesProperty
Defines the CanIncludeFiles property.
public static readonly DependencyProperty CanIncludeFilesProperty
CanIncludeLinksProperty
Defines the CanIncludeLinks property.
public static readonly DependencyProperty CanIncludeLinksProperty
DefaultShellServiceProperty
Defines the DefaultShellService property.
public static readonly DependencyProperty DefaultShellServiceProperty
IsDefaultItemContextMenuEnabledProperty
Defines the IsDefaultItemContextMenuEnabled property.
public static readonly DependencyProperty IsDefaultItemContextMenuEnabledProperty
IsNewFolderContextMenuItemAllowedProperty
Defines the IsNewFolderContextMenuItemAllowed property.
public static readonly DependencyProperty IsNewFolderContextMenuItemAllowedProperty
IsRenamingEnabledProperty
Defines the IsRenamingEnabled property.
public static readonly DependencyProperty IsRenamingEnabledProperty
RootShellFolderParsingNameProperty
Defines the RootShellFolderParsingName property.
public static readonly DependencyProperty RootShellFolderParsingNameProperty
RootShellFolderProperty
Defines the RootShellFolder property.
public static readonly DependencyProperty RootShellFolderProperty
RootSpecialFolderKindProperty
Defines the RootSpecialFolderKind property.
public static readonly DependencyProperty RootSpecialFolderKindProperty
SelectedShellObjectEditingNameProperty
Defines the SelectedShellObjectEditingName property.
public static readonly DependencyProperty SelectedShellObjectEditingNameProperty
SelectedShellObjectProperty
Defines the SelectedShellObject property.
public static readonly DependencyProperty SelectedShellObjectProperty
Inherited Members
- TreeListBox.AutoExpandItemsOnFilterProperty
- TreeListBox.CanDragItemsProperty
- TreeListBox.DataFilterProperty
- TreeListBox.EmptyContentProperty
- TreeListBox.EmptyContentTemplateProperty
- TreeListBox.HasTreeLinesProperty
- TreeListBox.IndentIncrementProperty
- TreeListBox.IsDataVirtualizationEnabledProperty
- TreeListBox.IsEmptyProperty
- TreeListBox.IsFilterActiveProperty
- TreeListBox.IsRootItemVisibleProperty
- TreeListBox.IsSelectionActiveProperty
- TreeListBox.ItemAdapterProperty
- TreeListBox.MultiDragKindProperty
- TreeListBox.PathSeparatorProperty
- TreeListBox.RootItemProperty
- TreeListBox.TopLevelIndentProperty
- TreeListBox.ItemDataFormat
- TreeListBox.FilterAppliedEvent
- TreeListBox.IsRootItemVisibleChangedEvent
- TreeListBox.ItemCollapsedEvent
- TreeListBox.ItemCollapsingEvent
- TreeListBox.ItemDefaultActionExecutingEvent
- TreeListBox.ItemExpandedEvent
- TreeListBox.ItemExpandingEvent
- TreeListBox.ItemMenuRequestedEvent
- TreeListBox.ItemSelectingEvent
- TreeListBox.RootItemChangedEvent
- TreeListBox.SelectionChangedEvent
- TreeListBox.CanSelectItemOnFocusProperty
- TreeListBox.MultiSelectionKindProperty
- TreeListBox.SelectionModeProperty
- TreeListBox.SelectedItemProperty
- TreeListBox.ArrangeOverride(Size)
- TreeListBox.BringItemIntoView(object)
- TreeListBox.BringItemIntoViewByFullPath(string)
- TreeListBox.ClearContainerForItemOverride(DependencyObject, object)
- TreeListBox.CollapseAll()
- TreeListBox.ExpandAll()
- TreeListBox.GetContainerForItemOverride()
- TreeListBox.GetFullPath(object)
- TreeListBox.GetItemByFullPath(string)
- TreeListBox.GetItemNavigator(object)
- TreeListBox.InvalidateChildren(object)
- TreeListBox.IsItemItsOwnContainerOverride(object)
- TreeListBox.GetIsSelectionActive(TreeListBox)
- TreeListBox.OnCreateAutomationPeer()
- TreeListBox.OnDragEnter(DragEventArgs)
- TreeListBox.OnDragLeave(DragEventArgs)
- TreeListBox.OnDragOver(DragEventArgs)
- TreeListBox.OnDrop(DragEventArgs)
- TreeListBox.OnGotKeyboardFocus(KeyboardFocusChangedEventArgs)
- TreeListBox.OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs)
- TreeListBox.OnItemsSourceChanged(IEnumerable, IEnumerable)
- TreeListBox.OnKeyDown(KeyEventArgs)
- TreeListBox.OnScrollViewerScrollChanged(ScrollChangedEventArgs)
- TreeListBox.PrepareContainerForItemOverride(DependencyObject, object)
- TreeListBox.ProcessKeyDown(KeyEventArgs)
- TreeListBox.OnFilterApplied(RoutedEventArgs)
- TreeListBox.OnItemCollapsed(TreeListBoxItemExpansionEventArgs)
- TreeListBox.OnItemCollapsing(TreeListBoxItemExpansionEventArgs)
- TreeListBox.OnItemDefaultActionExecuting(TreeListBoxItemEventArgs)
- TreeListBox.OnItemExpanded(TreeListBoxItemExpansionEventArgs)
- TreeListBox.OnItemExpanding(TreeListBoxItemExpansionEventArgs)
- TreeListBox.OnItemSelecting(TreeListBoxItemEventArgs)
- TreeListBox.OnRootItemChanged(RoutedEventArgs)
- TreeListBox.FocusItem(object)
- TreeListBox.FocusItemByFullPath(string)
- TreeListBox.CreateSelectionBatch()
- TreeListBox.AutoExpandItemsOnFilter
- TreeListBox.CanDragItems
- TreeListBox.DataFilter
- TreeListBox.EmptyContent
- TreeListBox.EmptyContentTemplate
- TreeListBox.HasTreeLines
- TreeListBox.IndentIncrement
- TreeListBox.IsDataVirtualizationEnabled
- TreeListBox.IsEmpty
- TreeListBox.IsFilterActive
- TreeListBox.IsKeyboardFocusWithinContent
- TreeListBox.IsRootItemVisible
- TreeListBox.ItemAdapter
- TreeListBox.MultiDragKind
- TreeListBox.PathSeparator
- TreeListBox.RootItem
- TreeListBox.TopLevelIndent
- TreeListBox.CanSelectItemOnFocus
- TreeListBox.MultiSelectionKind
- TreeListBox.SelectionMode
- TreeListBox.SelectedItem
- TreeListBox.SelectedItems
- TreeListBox.FilterApplied
- TreeListBox.IsRootItemVisibleChanged
- TreeListBox.ItemCollapsed
- TreeListBox.ItemCollapsing
- TreeListBox.ItemDefaultActionExecuting
- TreeListBox.ItemExpanded
- TreeListBox.ItemExpanding
- TreeListBox.ItemMenuRequested
- TreeListBox.ItemSelecting
- TreeListBox.RootItemChanged
- TreeListBox.SelectionChanged