In This Article

ShellObjectViewModel Class

Represents a view-model wrapper for an IShellObject.

public class ShellObjectViewModel : ObservableObjectBase
Inheritance:
object ObservableObjectBase object

Constructors

ShellObjectViewModel(IShellObject)

Initializes an instance of the class.

public ShellObjectViewModel(IShellObject shellObject)
Parameter Type Description
shellObject IShellObject

The IShellObject model wrapped by this view model.

Properties

CanCreateChildFolder

Indicates whether the shell object can create a child folder.

public bool CanCreateChildFolder { get; }

Property Value

bool:

true if the shell object can create a child folder; otherwise, false.

Remarks

Only shell folders can create child folders.

CanHaveChildFolders

Indicates whether the shell object may have child folders.

public bool CanHaveChildFolders { get; }

Property Value

bool:

true if the shell object may have child folders; otherwise, false.

Remarks

Some shell objects can immediately return that they don't have any child folders, whereas others might require a query to determine if there are any.

CanRename

Indicates whether the shell object may be renamed.

public bool CanRename { get; }

Property Value

bool:

true if the shell object may be renamed; otherwise, false.

CanUseThumbnails

Indicates 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 false.

Children

The collection of child view-models, which is initialized by an item adapter.

public IList<ShellObjectViewModel> Children { get; }

Property Value

IList<ShellObjectViewModel>

CreateChildFolderCommand

The ICommand used to add a new child into to an associated collection/parent.

public virtual ICommand CreateChildFolderCommand { get; }

Property Value

ICommand

EditingName

The full user-friendly editing name of the shell object, if available.

public string? EditingName { get; }

Property Value

string

Remarks

This value is usually the same as FileSystemPath, except that it can also return a special value to identify special shell objects.

ExtraLargeIcon

The extra-large icon.

public ImageSource? ExtraLargeIcon { get; }

Property Value

ImageSource

ExtraLargeIconOverlay

The extra-large icon overlay.

public ImageSource? ExtraLargeIconOverlay { get; }

Property Value

ImageSource

ExtraLargeThumbnail

The extra-large thumbnail.

public ImageSource? ExtraLargeThumbnail { get; }

Property Value

ImageSource

FileSystemPath

The file system path of the shell object, if available.

public string? FileSystemPath { get; }

Property Value

string

HasExtraLargeThumbnail

Indicates whether a ExtraLargeThumbnail is available.

public bool HasExtraLargeThumbnail { get; }

Property Value

bool:

true if a ExtraLargeThumbnail is available; otherwise, false.

HasLargeThumbnail

Indicates whether a LargeThumbnail is available.

public bool HasLargeThumbnail { get; }

Property Value

bool:

true if a LargeThumbnail is available; otherwise, false.

HasMediumThumbnail

Indicates whether a MediumThumbnail is available.

public bool HasMediumThumbnail { get; }

Property Value

bool:

true if a MediumThumbnail is available; otherwise, false.

IsEditing

Indicates whether the node is currently being edited.

public bool IsEditing { get; set; }

Property Value

bool:

true if the node is currently being edited; otherwise, false.

IsExpanded

Indicates whether the node is expanded.

public bool IsExpanded { get; set; }

Property Value

bool:

true if the node is expanded; otherwise, false.

IsFolder

Indicates whether the shell object is a folder, which is anything that can contain other shell objects.

public bool IsFolder { get; }

Property Value

bool:

true if the shell object is a folder, which is anything that can contain other shell objects; otherwise, false.

Indicates whether the shell object is a link, meaning a shortcut to another shell object.

public bool IsLink { get; }

Property Value

bool:

true if the shell object is a link, meaning a shortcut to another shell object; otherwise, false.

IsRemovable

Indicates whether the shell object is on removable media or is a removable device.

public bool IsRemovable { get; }

Property Value

bool:

true if the shell object is on removable media or is a removable device; otherwise, false.

IsSelected

Indicates whether the node is selected.

public bool IsSelected { get; set; }

Property Value

bool:

true if the node is selected; otherwise, false.

IsVirtual

Indicates whether the shell object is not part of the file system (files, directories, or root directories).

public bool IsVirtual { get; }

Property Value

bool:

true if the shell object is not part of the file system (files, directories, or root directories); otherwise, false.

IsWatching

Indicates whether the shell object's tree hierarchy is currently watching for change notifications.

public bool IsWatching { get; }

Property Value

bool:

true if the shell object's tree hierarchy is currently watching for change notifications; otherwise, false.

Kind

A ShellObjectKind that specifies the kind of this shell object.

public ShellObjectKind Kind { get; }

Property Value

ShellObjectKind

LargeIcon

The large icon.

public ImageSource? LargeIcon { get; }

Property Value

ImageSource

LargeIconOverlay

The large icon overlay.

public ImageSource? LargeIconOverlay { get; }

Property Value

ImageSource

LargeThumbnail

The large thumbnail.

public ImageSource? LargeThumbnail { get; }

Property Value

ImageSource

MediumIcon

The medium icon.

public ImageSource? MediumIcon { get; }

Property Value

ImageSource

MediumIconOverlay

The medium icon overlay.

public ImageSource? MediumIconOverlay { get; }

Property Value

ImageSource

MediumThumbnail

The medium thumbnail.

public ImageSource? MediumThumbnail { get; }

Property Value

ImageSource

Model

The IShellObject model wrapped by this view-model.

public IShellObject? Model { get; set; }

Property Value

IShellObject

Name

The name of the shell object.

public string? Name { get; set; }

Property Value

string

ParsingName

The full parsing name of the shell object, if available.

public string? ParsingName { get; }

Property Value

string

Remarks

This value is usually the same as FileSystemPath, except that it can also return a special syntax to identify special shell objects.

RelativeParsingName

The parent-relative parsing name of the shell object, if available.

public string? RelativeParsingName { get; }

Property Value

string

Remarks

This value is usually the same as Name, except that it can also return a special syntax to identify special shell objects.

ShellService

The IShellService used to return this shell object's children.

public IShellService? ShellService { get; }

Property Value

IShellService

SmallIcon

The small icon.

public ImageSource? SmallIcon { get; }

Property Value

ImageSource

SmallIconOverlay

The small icon overlay.

public ImageSource? SmallIconOverlay { get; }

Property Value

ImageSource

SortOrder

A numeric sort order for sorting the shell object within other shell objects.

public int SortOrder { get; }

Property Value

int:

The default value is 0.

SpecialFolderKind

A SpecialFolderKind that specifies kind of special folder represented by this shell object, if applicable.

public SpecialFolderKind SpecialFolderKind { get; }

Property Value

SpecialFolderKind

Tag

The custom data for the node.

public object? Tag { get; set; }

Property Value

object

ToolTip

The tool-tip object that is displayed for this shell object in the user interface (UI).

public object? ToolTip { get; }

Property Value

object:

The tool-tip object.

Methods

CreateChildFolder(string)

Creates a child folder with the specified name.

public bool CreateChildFolder(string name)
Parameter Type Description
name string

The name of the child folder.

Returns

bool:

true if the child folder was created; otherwise, false.

Remarks

Only shell folders can create child folders.

StartWatching()

Starts watching the shell object's tree hierarchy for change notifications.

public bool StartWatching()

Returns

bool:

true if the shell object is watching its tree hierarchy; otherwise, false.

StopWatching()

Stops watching the shell object's tree hierarchy for change notifications.

public void StopWatching()

ToString()

Returns the string representation of this object.

public override string ToString()

Returns

string:

The string representation of this object.

Inherited Members

Extension Methods