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 a new instance of the ShellObjectViewModel class.

public ShellObjectViewModel(IShellObject shellObject)
Parameter Type Description
shellObject IShellObject

The IShellObject model wrapped by this view model.

Properties

CanCreateChildFolder

Gets 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

Gets 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

Gets 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

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

Children

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

public IList<ShellObjectViewModel> Children { get; }

Property Value

IList<ShellObjectViewModel>:

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

CreateChildFolderCommand

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

public virtual ICommand CreateChildFolderCommand { get; }

Property Value

ICommand:

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

EditingName

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

public string EditingName { get; }

Property Value

string:

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

Remarks

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

ExtraLargeIcon

Gets the extra-large icon.

public ImageSource ExtraLargeIcon { get; }

Property Value

ImageSource:

The extra-large icon.

ExtraLargeIconOverlay

Gets the extra-large icon overlay.

public ImageSource ExtraLargeIconOverlay { get; }

Property Value

ImageSource:

The extra-large icon overlay.

ExtraLargeThumbnail

Gets the extra-large thumbnail.

public ImageSource ExtraLargeThumbnail { get; }

Property Value

ImageSource:

The extra-large thumbnail.

FileSystemPath

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

public string FileSystemPath { get; }

Property Value

string:

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

HasExtraLargeThumbnail

Gets whether a ExtraLargeThumbnail is available.

public bool HasExtraLargeThumbnail { get; }

Property Value

bool:

true if a ExtraLargeThumbnail is available; otherwise, false.

HasLargeThumbnail

Gets whether a LargeThumbnail is available.

public bool HasLargeThumbnail { get; }

Property Value

bool:

true if a LargeThumbnail is available; otherwise, false.

HasMediumThumbnail

Gets whether a MediumThumbnail is available.

public bool HasMediumThumbnail { get; }

Property Value

bool:

true if a MediumThumbnail is available; otherwise, false.

IsEditing

Gets or sets 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

Gets or sets whether the node is expanded.

public bool IsExpanded { get; set; }

Property Value

bool:

true if the node is expanded; otherwise, false.

IsFolder

Gets 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.

Gets 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

Gets 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

Gets or sets whether the node is selected.

public bool IsSelected { get; set; }

Property Value

bool:

true if the node is selected; otherwise, false.

IsVirtual

Gets 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

Gets 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

Gets a ShellObjectKind that specifies the kind of this shell object.

public ShellObjectKind Kind { get; }

Property Value

ShellObjectKind:

A ShellObjectKind that specifies the kind of this shell object.

LargeIcon

Gets the large icon.

public ImageSource LargeIcon { get; }

Property Value

ImageSource:

The large icon.

LargeIconOverlay

Gets the large icon overlay.

public ImageSource LargeIconOverlay { get; }

Property Value

ImageSource:

The large icon overlay.

LargeThumbnail

Gets the large thumbnail.

public ImageSource LargeThumbnail { get; }

Property Value

ImageSource:

The large thumbnail.

MediumIcon

Gets the medium icon.

public ImageSource MediumIcon { get; }

Property Value

ImageSource:

The medium icon.

MediumIconOverlay

Gets the medium icon overlay.

public ImageSource MediumIconOverlay { get; }

Property Value

ImageSource:

The medium icon overlay.

MediumThumbnail

Gets the medium thumbnail.

public ImageSource MediumThumbnail { get; }

Property Value

ImageSource:

The medium thumbnail.

Model

Gets the IShellObject model wrapped by this view-model.

public IShellObject Model { get; set; }

Property Value

IShellObject:

The IShellObject model wrapped by this view-model.

Name

Gets or sets the name of the shell object.

public string Name { get; set; }

Property Value

string:

The name of the shell object.

ParsingName

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

public string ParsingName { get; }

Property Value

string:

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

Remarks

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

RelativeParsingName

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

public string RelativeParsingName { get; }

Property Value

string:

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

Remarks

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

ShellService

Gets the IShellService used to return this shell object's children.

public IShellService ShellService { get; }

Property Value

IShellService:

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

SmallIcon

Gets the small icon.

public ImageSource SmallIcon { get; }

Property Value

ImageSource:

The small icon.

SmallIconOverlay

Gets the small icon overlay.

public ImageSource SmallIconOverlay { get; }

Property Value

ImageSource:

The small icon overlay.

SortOrder

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

public int SortOrder { get; }

Property Value

int:

A numeric sort order for sorting the shell object within other shell objects. The default value is 0.

SpecialFolderKind

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

public SpecialFolderKind SpecialFolderKind { get; }

Property Value

SpecialFolderKind:

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

Tag

Gets or sets custom data for the node.

public object Tag { get; set; }

Property Value

object:

The custom data for the node.

ToolTip

Gets 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 a string representation of this instance.

public override string ToString()

Returns

string:

A string representation of this instance.

Inherited Members