In This Article

ShellListView Class

Represents a list view control that enumerates shell objects.

public class ShellListView : TreeListView
Inheritance:
object Visual UIElement FrameworkElement Control ItemsControl TreeListBox TreeListView object

Constructors

ShellListView()

Initializes an instance of the ShellListView class.

public ShellListView()

Properties

AssemblyInfo

Gets the ActiproSoftware.Products.AssemblyInfo to use.

[Browsable(false)]
protected override sealed AssemblyInfo AssemblyInfo { get; }

Property Value

AssemblyInfo:

The ActiproSoftware.Products.AssemblyInfo to use.

CanExpandAll

Gets whether any expand all operations can occur.

protected override bool CanExpandAll { get; }

Property Value

bool:

true if any expand all operations can occur; otherwise, false. The default value is false.

CanIncludeFiles

Gets or sets whether files should be displayed.

public bool CanIncludeFiles { get; set; }

Property Value

bool:

true if files should be displayed; otherwise, false. The default value is true.

CanIncludeFolders

Gets or sets whether folders should be displayed.

public bool CanIncludeFolders { get; set; }

Property Value

bool:

true if folders should be displayed; otherwise, false. The default value is true.

Gets or sets whether links should be displayed.

public bool CanIncludeLinks { get; set; }

Property Value

bool:

true if links should be displayed; otherwise, false. The default value is true.

CanNavigateIntoChildFolders

Gets or sets whether the default action for folders should be to navigate into the child folder.

public bool CanNavigateIntoChildFolders { get; set; }

Property Value

bool:

true if the default action for folders should be to navigate into the child folder; otherwise, false. The default value is true.

CanResetSortOnRootShellFolderChange

Gets or sets whether the list's sort should be reset when changing the RootShellFolder.

public bool CanResetSortOnRootShellFolderChange { get; set; }

Property Value

bool:

true if the list's sort should be reset when changing the RootShellFolder; otherwise, false. The default value is true.

CanUseThumbnails

Gets or sets whether thumbnail images can be used in place of icons when available.

public bool CanUseThumbnails { get; set; }

Property Value

bool:

true if thumbnail images can be used in place of icons when available; otherwise, false. The default value is true.

Remarks

Thumbnails are only used in certain LayoutMode options that render larger images.

ColumnHeaderTemplate

Gets or sets the DataTemplate to use for rendering column headers.

public DataTemplate ColumnHeaderTemplate { get; set; }

Property Value

DataTemplate:

The DataTemplate to use for rendering column headers.

DefaultShellService

Gets or sets the default IShellService that should be used when RootShellFolderParsingName or RootSpecialFolderKind are set.

public IShellService DefaultShellService { get; set; }

Property Value

IShellService:

The default IShellService that should be used when RootShellFolderParsingName or RootSpecialFolderKind are set. The default value is an instance of WindowsShellService.

Remarks

This property is not used if the RootShellFolder property is set directly.

DetailsLayoutModeItemTemplate

Gets or sets the DataTemplate to use as the ItemTemplate when the LayoutMode is Details.

public DataTemplate DetailsLayoutModeItemTemplate { get; set; }

Property Value

DataTemplate:

The DataTemplate to use as the ItemTemplate when the LayoutMode is Details.

ExtraLargeIconsLayoutModeItemTemplate

Gets or sets the DataTemplate to use as the ItemTemplate when the LayoutMode is ExtraLargeIcons.

public DataTemplate ExtraLargeIconsLayoutModeItemTemplate { get; set; }

Property Value

DataTemplate:

The DataTemplate to use as the ItemTemplate when the LayoutMode is ExtraLargeIcons.

IsDefaultItemContextMenuEnabled

Gets or sets whether the default context menu is enabled for shell objects.

public bool IsDefaultItemContextMenuEnabled { get; set; }

Property Value

bool:

true if the default context menu is enabled for shell objects; otherwise false. The default value is true.

IsRenamingEnabled

Gets or sets whether objects can be renamed.

public bool IsRenamingEnabled { get; set; }

Property Value

bool:

true if objects can be renamed; otherwise, false. The default value is true.

Remarks

The shell objects themselves must also support renaming via CanRename.

LargeIconsLayoutModeItemTemplate

Gets or sets the DataTemplate to use as the ItemTemplate when the LayoutMode is LargeIcons.

public DataTemplate LargeIconsLayoutModeItemTemplate { get; set; }

Property Value

DataTemplate:

The DataTemplate to use as the ItemTemplate when the LayoutMode is LargeIcons.

LayoutMode

Gets or sets a ShellListViewLayoutMode value indicating the item layout mode.

public ShellListViewLayoutMode LayoutMode { get; set; }

Property Value

ShellListViewLayoutMode:

A ShellListViewLayoutMode value indicating the item layout mode. The default value is Details.

ListLayoutModeItemTemplate

Gets or sets the DataTemplate to use as the ItemTemplate when the LayoutMode is List.

public DataTemplate ListLayoutModeItemTemplate { get; set; }

Property Value

DataTemplate:

The DataTemplate to use as the ItemTemplate when the LayoutMode is List.

MediumIconsLayoutModeItemTemplate

Gets or sets the DataTemplate to use as the ItemTemplate when the LayoutMode is MediumIcons.

public DataTemplate MediumIconsLayoutModeItemTemplate { get; set; }

Property Value

DataTemplate:

The DataTemplate to use as the ItemTemplate when the LayoutMode is MediumIcons.

RootShellFolder

Gets or sets the root IShellObject to display.

public IShellObject RootShellFolder { get; set; }

Property Value

IShellObject:

The root IShellObject to display.

RootShellFolderParsingName

Gets or sets the root folder's full parsing name (commonly the same as the file system path), if known.

public string RootShellFolderParsingName { get; set; }

Property Value

string:

The root folder's full parsing name, if known.

Remarks

Setting this property will update the RootShellFolder property.

RootSpecialFolderKind

Gets or sets the SpecialFolderKind that indicates the root special folder to display.

public SpecialFolderKind RootSpecialFolderKind { get; set; }

Property Value

SpecialFolderKind:

The SpecialFolderKind that indicates the root special folder to display.

Remarks

Setting this property will update the RootShellFolder property.

SmallIconsLayoutModeItemTemplate

Gets or sets the DataTemplate to use as the ItemTemplate when the LayoutMode is SmallIcons.

public DataTemplate SmallIconsLayoutModeItemTemplate { get; set; }

Property Value

DataTemplate:

The DataTemplate to use as the ItemTemplate when the LayoutMode is SmallIcons.

SortDirection

Gets or sets the ColumnSortDirection that indicates the current sort direction.

public ColumnSortDirection SortDirection { get; set; }

Property Value

ColumnSortDirection:

The ColumnSortDirection that indicates the current sort direction. The default value is Ascending.

SortShellPropertyKey

Gets or sets the Key of the IShellProperty whose column should be sorted.

public object SortShellPropertyKey { get; set; }

Property Value

object:

The Key of the IShellProperty whose column should be sorted.

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.

GetContainerForItemOverride()

Creates or identifies the element used to display the specified item.

protected override DependencyObject GetContainerForItemOverride()

Returns

DependencyObject:

The element that is used to display the given item.

NotifyDpiChanged()

Notifies that the DPI has changed.

public void NotifyDpiChanged()

Remarks

The shell controls are currently based on .NET 4.0 and can't access the DpiChanged event. If you watch the DpiChanged event for your window, call this method to tell the shell controls the DPI changed so they can adjust their images as needed.

OnApplyTemplate()

Invoked whenever application code or internal processes call ApplyTemplate.

public override void OnApplyTemplate()

OnColumnHeaderTapped(TreeListViewColumnEventArgs)

Occurs when a column's header is tapped.

protected override void OnColumnHeaderTapped(TreeListViewColumnEventArgs e)
Parameter Type Description
e TreeListViewColumnEventArgs

The TreeListViewColumnEventArgs that contains the event data.

OnContextMenuOpening(ContextMenuEventArgs)

Occurs when a context menu is requested.

protected override void OnContextMenuOpening(ContextMenuEventArgs e)
Parameter Type Description
e ContextMenuEventArgs

The ContextMenuEventArgs that contains the event data.

OnItemDefaultActionExecuting(TreeListBoxItemEventArgs)

Occurs before the default action is executed for an item.

protected override void OnItemDefaultActionExecuting(TreeListBoxItemEventArgs e)
Parameter Type Description
e TreeListBoxItemEventArgs

The TreeListBoxItemEventArgs that contains the event data.

OnItemMenuRequested(TreeListBoxItemMenuEventArgs)

Occurs when an item requests a context menu.

protected override void OnItemMenuRequested(TreeListBoxItemMenuEventArgs e)
Parameter Type Description
e TreeListBoxItemMenuEventArgs

The TreeListBoxItemMenuEventArgs that contains the event data.

ProcessKeyDown(KeyEventArgs)

Processes a key down event.

protected override void ProcessKeyDown(KeyEventArgs e)
Parameter Type Description
e KeyEventArgs

The KeyEventArgs that contains the event data.

RefreshColumns()

Refreshes the list's columns by requerying the CreateProperties(IList<IShellObject>, ShellPropertyRequestKind) method for properties.

public void RefreshColumns()

Fields

CanIncludeFilesProperty

Identifies the CanIncludeFiles dependency property. This field is read-only.

public static readonly DependencyProperty CanIncludeFilesProperty

CanIncludeFoldersProperty

Identifies the CanIncludeFolders dependency property. This field is read-only.

public static readonly DependencyProperty CanIncludeFoldersProperty

CanIncludeLinksProperty

Identifies the CanIncludeLinks dependency property. This field is read-only.

public static readonly DependencyProperty CanIncludeLinksProperty

CanNavigateIntoChildFoldersProperty

Identifies the CanNavigateIntoChildFolders dependency property. This field is read-only.

public static readonly DependencyProperty CanNavigateIntoChildFoldersProperty

CanResetSortOnRootShellFolderChangeProperty

Identifies the CanResetSortOnRootShellFolderChange dependency property. This field is read-only.

public static readonly DependencyProperty CanResetSortOnRootShellFolderChangeProperty

CanUseThumbnailsProperty

Identifies the CanUseThumbnails dependency property. This field is read-only.

public static readonly DependencyProperty CanUseThumbnailsProperty

ColumnHeaderTemplateProperty

Identifies the ColumnHeaderTemplate dependency property. This field is read-only.

public static readonly DependencyProperty ColumnHeaderTemplateProperty

DefaultShellServiceProperty

Identifies the DefaultShellService dependency property. This field is read-only.

public static readonly DependencyProperty DefaultShellServiceProperty

DetailsLayoutModeItemTemplateProperty

Identifies the DetailsLayoutModeItemTemplate dependency property. This field is read-only.

public static readonly DependencyProperty DetailsLayoutModeItemTemplateProperty

ExtraLargeIconsLayoutModeItemTemplateProperty

Identifies the ExtraLargeIconsLayoutModeItemTemplate dependency property. This field is read-only.

public static readonly DependencyProperty ExtraLargeIconsLayoutModeItemTemplateProperty

IsDefaultItemContextMenuEnabledProperty

Identifies the IsDefaultItemContextMenuEnabled dependency property. This field is read-only.

public static readonly DependencyProperty IsDefaultItemContextMenuEnabledProperty

IsRenamingEnabledProperty

Identifies the IsRenamingEnabled dependency property. This field is read-only.

public static readonly DependencyProperty IsRenamingEnabledProperty

LargeIconsLayoutModeItemTemplateProperty

Identifies the LargeIconsLayoutModeItemTemplate dependency property. This field is read-only.

public static readonly DependencyProperty LargeIconsLayoutModeItemTemplateProperty

LayoutModeProperty

Identifies the LayoutMode dependency property. This field is read-only.

public static readonly DependencyProperty LayoutModeProperty

ListLayoutModeItemTemplateProperty

Identifies the ListLayoutModeItemTemplate dependency property. This field is read-only.

public static readonly DependencyProperty ListLayoutModeItemTemplateProperty

MediumIconsLayoutModeItemTemplateProperty

Identifies the MediumIconsLayoutModeItemTemplate dependency property. This field is read-only.

public static readonly DependencyProperty MediumIconsLayoutModeItemTemplateProperty

RootShellFolderParsingNameProperty

Identifies the RootShellFolderParsingName dependency property. This field is read-only.

public static readonly DependencyProperty RootShellFolderParsingNameProperty

RootShellFolderProperty

Identifies the RootShellFolder dependency property. This field is read-only.

public static readonly DependencyProperty RootShellFolderProperty

RootSpecialFolderKindProperty

Identifies the RootSpecialFolderKind dependency property. This field is read-only.

public static readonly DependencyProperty RootSpecialFolderKindProperty

SmallIconsLayoutModeItemTemplateProperty

Identifies the SmallIconsLayoutModeItemTemplate dependency property. This field is read-only.

public static readonly DependencyProperty SmallIconsLayoutModeItemTemplateProperty

SortDirectionProperty

Identifies the SortDirection dependency property. This field is read-only.

public static readonly DependencyProperty SortDirectionProperty

SortShellPropertyKeyProperty

Identifies the SortShellPropertyKey dependency property. This field is read-only.

public static readonly DependencyProperty SortShellPropertyKeyProperty

Inherited Members