Class
DialogViewModel

Base class for the different file dialogs.

Definition

Namespace:Telerik.WinControls.FileDialogs

Assembly:Telerik.WinControls.UI.dll

Syntax:

cs-api-definition
public abstract class DialogViewModel : ViewModelBase, INotifyPropertyChanged, IDisposable, IDialogViewModel, ICurrentDirectoryViewModel, INotifyPropertyChanging

Inheritance: objectViewModelBaseDialogViewModel

Derived Classes: FileDialogViewModelOpenFolderDialogViewModel

Implements: ICurrentDirectoryViewModelIDialogViewModelIDisposableINotifyPropertyChangedINotifyPropertyChanging

Inherited Members ViewModelBase.Dispose()ViewModelBase.InvokeOnUIThread(Action)ViewModelBase.OnPropertyChanged(string)ViewModelBase.VerifyPropertyName(string)ViewModelBase.PropertyChanged

Constructors

DialogViewModel(FileSystemInfoWrapperFactoryBase, bool, string)

Initializes a new instance of the DialogViewModel class.

Declaration

cs-api-definition
protected DialogViewModel(FileSystemInfoWrapperFactoryBase fileSystemInfoWrapperFactory, bool showNetwork, string rootDirPath = "")

Parameters

fileSystemInfoWrapperFactory

FileSystemInfoWrapperFactoryBase

The FileSystemInfoWrapperFactoryBase used for creating FileSystemInfoWrappers.

showNetwork

bool

Boolean indicating whether network locations are shown.

rootDirPath

string

The path of the initial directory.

Properties

CurrentFileSystemObjects

Gets the currently visible FileSystemInfoWrappers.

Declaration

cs-api-definition
public BindingList<FileSystemInfoWrapper> CurrentFileSystemObjects { get; }

Property Value

BindingList<FileSystemInfoWrapper>

CurrentParentDirectory

Gets the currently drilled directory.

Declaration

cs-api-definition
public DirectoryBaseWrapper CurrentParentDirectory { get; set; }

Property Value

DirectoryBaseWrapper

Implements ICurrentDirectoryViewModel.CurrentParentDirectory

CurrentSearchResults

Collection of search results. We do not use ViewModels CurrentFileSystemObjects in order to be process the results in background successfully.

Declaration

cs-api-definition
public BindingList<FileSystemInfoWrapper> CurrentSearchResults { get; }

Property Value

BindingList<FileSystemInfoWrapper>

CustomPlaces

Gets or sets the collection of custom places.

Declaration

cs-api-definition
public IEnumerable<DirectoryInfoWrapper> CustomPlaces { get; set; }

Property Value

IEnumerable<DirectoryInfoWrapper>

Implements IDialogViewModel.CustomPlaces

EditingOptions

Determines how the files and folders in the DialogViewModel can be edited. Note that the shell context menu and drag and drop operations are handled separately.

Declaration

cs-api-definition
public EditingOptions EditingOptions { get; set; }

Property Value

EditingOptions

FileSystemInfoWrapperFactory

Gets the FileSystemInfoWrapperFactoryBase for creating wrappers for FileSystemInfos.

Declaration

cs-api-definition
protected FileSystemInfoWrapperFactoryBase FileSystemInfoWrapperFactory { get; }

Property Value

FileSystemInfoWrapperFactoryBase

InitialDirectory

Gets or sets the initial directory.

Declaration

cs-api-definition
public DirectoryBaseWrapper InitialDirectory { get; set; }

Property Value

DirectoryBaseWrapper

Implements IDialogViewModel.InitialDirectory

InvokeContext

Declaration

cs-api-definition
public static ExplorerControl InvokeContext { get; set; }

Property Value

ExplorerControl

IsDirectorySelected

Return true if the selected item is directory.

Declaration

cs-api-definition
public bool IsDirectorySelected { get; }

Property Value

bool

IsMainPaneLoadingNetwork

Used to trigger a busy indicator while network location is being loaded for the main pane.

Declaration

cs-api-definition
public bool IsMainPaneLoadingNetwork { get; set; }

Property Value

bool

IsSearchViewActive

Gets or sets the IsSearchViewActive. When true, it indicates the Dialog's Main Pane shows results from search operation.

Declaration

cs-api-definition
public bool IsSearchViewActive { get; set; }

Property Value

bool

Layouts

Gets the available layouts for the dialog explorer.

Declaration

cs-api-definition
public virtual IEnumerable<LayoutConfigurationModel> Layouts { get; }

Property Value

IEnumerable<LayoutConfigurationModel>

Implements IDialogViewModel.Layouts

MainNavigationRoot

Gets the main root DirectoryInfoWrapper used for folder navigation.

Declaration

cs-api-definition
public DirectoryBaseWrapper MainNavigationRoot { get; }

Property Value

DirectoryBaseWrapper

MainNavigationRootSource

Gets the root DirectoryInfoWrapper used for folder navigation.

Declaration

cs-api-definition
public ObservableCollection<DirectoryBaseWrapper> MainNavigationRootSource { get; }

Property Value

ObservableCollection<DirectoryBaseWrapper>

Name

Gets or sets a string representing the full path to the current file system object.

Declaration

cs-api-definition
public string Name { get; set; }

Property Value

string

Implements IDialogViewModel.Name

Path

Gets a string representing the path to the current folder.

Declaration

cs-api-definition
public string Path { get; }

Property Value

string

Implements IDialogViewModel.Path

RootAndCurrentFileSystemObjects

Gets the currently root and current visible FileSystemInfoWrappers.

Declaration

cs-api-definition
public BindingList<FileSystemInfoWrapper> RootAndCurrentFileSystemObjects { get; }

Property Value

BindingList<FileSystemInfoWrapper>

SelectedFileSystemObject

Gets the currently selected file or folder.

Declaration

cs-api-definition
public FileSystemInfoWrapper SelectedFileSystemObject { get; set; }

Property Value

FileSystemInfoWrapper

Implements ICurrentDirectoryViewModel.SelectedFileSystemObject

SelectedFilesInvoker

Declaration

cs-api-definition
public IInvokeSelectedFileSystemObjects SelectedFilesInvoker { get; set; }

Property Value

IInvokeSelectedFileSystemObjects

SelectedLayout

Gets the selected LayoutConfigurationModel.

Declaration

cs-api-definition
public LayoutConfigurationModel SelectedLayout { get; set; }

Property Value

LayoutConfigurationModel

Implements IDialogViewModel.SelectedLayout

ShowHiddenFiles

Gets or sets a boolean value indicating whether the dialog shows hidden files and folders.

Declaration

cs-api-definition
public bool ShowHiddenFiles { get; set; }

Property Value

bool

Implements IDialogViewModel.ShowHiddenFiles

Methods

CanCopyExecute()

Declaration

cs-api-definition
protected virtual bool CanCopyExecute()

Returns

bool

CanCutExecute()

Declaration

cs-api-definition
protected virtual bool CanCutExecute()

Returns

bool

CanDeleteExecute()

Declaration

cs-api-definition
protected virtual bool CanDeleteExecute()

Returns

bool

CanEditExecute()

Declaration

cs-api-definition
protected virtual bool CanEditExecute()

Returns

bool

CanExecuteAccept()

Defines the method that determines whether the accept command can execute in its current state.

Declaration

cs-api-definition
protected virtual bool CanExecuteAccept()

Returns

bool

CanExecuteHelper()

Declaration

cs-api-definition
protected virtual bool CanExecuteHelper()

Returns

bool

CanNewFolderExecute()

Declaration

cs-api-definition
protected virtual bool CanNewFolderExecute()

Returns

bool

CanPasteExecute()

Declaration

cs-api-definition
protected virtual bool CanPasteExecute()

Returns

bool

CreateNewChildFolder()

Creates new child folder in the CurrentParentDirectory.

Declaration

cs-api-definition
public bool CreateNewChildFolder()

Returns

bool

Implements ICurrentDirectoryViewModel.CreateNewChildFolder()

Dispose(bool)

Releases unmanaged and - optionally - managed resources.

Declaration

cs-api-definition
protected override void Dispose(bool disposing)

Parameters

disposing

bool

true to release both managed and unmanaged resources. false to release only unmanaged resources.

Overrides ViewModelBase.Dispose(bool)

GetCurrentFileSystemInfoWrappers(DirectoryBaseWrapper)

Gets the current visible FileSystemInfoWrappers.

Declaration

cs-api-definition
protected abstract IEnumerable<FileSystemInfoWrapper> GetCurrentFileSystemInfoWrappers(DirectoryBaseWrapper parent)

Parameters

parent

DirectoryBaseWrapper

Returns

IEnumerable<FileSystemInfoWrapper>

InvokeSelectedFileSystemObjects()

Execute logic when accept is executed for the selected FileSystemInfoWrappers.

Declaration

cs-api-definition
protected virtual void InvokeSelectedFileSystemObjects()

OnCopyCommand(IntPtr)

Declaration

cs-api-definition
protected virtual void OnCopyCommand(IntPtr controlHandle)

Parameters

controlHandle

IntPtr

OnCurrentSearchResultsChanged()

Declaration

cs-api-definition
public void OnCurrentSearchResultsChanged()

OnCutCommand(IntPtr)

Declaration

cs-api-definition
protected virtual void OnCutCommand(IntPtr controlHandle)

Parameters

controlHandle

IntPtr

OnDeleteCommand(IntPtr)

Declaration

cs-api-definition
protected virtual void OnDeleteCommand(IntPtr controlHandle)

Parameters

controlHandle

IntPtr

OnEditExecuted()

Declaration

cs-api-definition
protected virtual void OnEditExecuted()

OnNewFolderExecuted()

Declaration

cs-api-definition
protected virtual void OnNewFolderExecuted()

OnPasteCommand(IntPtr)

Declaration

cs-api-definition
protected virtual void OnPasteCommand(IntPtr controlHandle)

Parameters

controlHandle

IntPtr

OnPropertyChanging(string)

Declaration

cs-api-definition
protected virtual void OnPropertyChanging(string propertyName)

Parameters

propertyName

string

OnSelectionChanged()

Notifies when the SelectedFileSystemObject changes.

Declaration

cs-api-definition
protected virtual void OnSelectionChanged()

PrepareCommandAndExecute(IntPtr, ShellContextMenuCommand)

Declaration

cs-api-definition
protected virtual void PrepareCommandAndExecute(IntPtr controlHandle, ShellContextMenuCommand command)

Parameters

controlHandle

IntPtr

command

ShellContextMenuCommand

ResetSelection()

Resets the selection.

Declaration

cs-api-definition
protected virtual void ResetSelection()

ShouldCancelDiretoryNavigating(string)

Declaration

cs-api-definition
protected virtual bool ShouldCancelDiretoryNavigating(string newDir)

Parameters

newDir

string

Returns

bool

Events

DirectoryNavigating

Declaration

cs-api-definition
public event EventHandler<DirectoryNavigatingEventArgs> DirectoryNavigating

Event Value

EventHandler<DirectoryNavigatingEventArgs>

PropertyChanging

Declaration

cs-api-definition
public event PropertyChangingEventHandler PropertyChanging

Event Value

PropertyChangingEventHandler

Implements INotifyPropertyChanging.PropertyChanging