New to Telerik UI for WinFormsStart a free 30-day trial

Base class for the different file dialogs.

Definition

Namespace:Telerik.WinControls.FileDialogs

Assembly:Telerik.WinControls.UI.dll

Syntax:

C#
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

Initializes a new instance of the DialogViewModel class.

C#
protected DialogViewModel(FileSystemInfoWrapperFactoryBase fileSystemInfoWrapperFactory, bool showNetwork, string rootDirPath = "")
Parameters:fileSystemInfoWrapperFactoryFileSystemInfoWrapperFactoryBase

The FileSystemInfoWrapperFactoryBase used for creating FileSystemInfoWrappers.

showNetworkbool

Boolean indicating whether network locations are shown.

rootDirPathstring

The path of the initial directory.

Properties

Gets the currently visible FileSystemInfoWrappers.

C#
public BindingList<FileSystemInfoWrapper> CurrentFileSystemObjects { get; }

Gets the currently drilled directory.

C#
public DirectoryBaseWrapper CurrentParentDirectory { get; set; }

Implements: ICurrentDirectoryViewModel.CurrentParentDirectory

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

C#
public BindingList<FileSystemInfoWrapper> CurrentSearchResults { get; }

Gets or sets the collection of custom places.

C#
public IEnumerable<DirectoryInfoWrapper> CustomPlaces { get; set; }

Implements: IDialogViewModel.CustomPlaces

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.

C#
public EditingOptions EditingOptions { get; set; }

Gets the FileSystemInfoWrapperFactoryBase for creating wrappers for FileSystemInfos.

C#
protected FileSystemInfoWrapperFactoryBase FileSystemInfoWrapperFactory { get; }

Gets or sets the initial directory.

C#
public DirectoryBaseWrapper InitialDirectory { get; set; }

Implements: IDialogViewModel.InitialDirectory

C#
public static ExplorerControl InvokeContext { get; set; }

Return true if the selected item is directory.

C#
public bool IsDirectorySelected { get; }

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

C#
public bool IsMainPaneLoadingNetwork { get; set; }

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

C#
public bool IsSearchViewActive { get; set; }

Gets the available layouts for the dialog explorer.

C#
public virtual IEnumerable<LayoutConfigurationModel> Layouts { get; }

Implements: IDialogViewModel.Layouts

Gets the main root DirectoryInfoWrapper used for folder navigation.

C#
public DirectoryBaseWrapper MainNavigationRoot { get; }

Gets the root DirectoryInfoWrapper used for folder navigation.

C#
public ObservableCollection<DirectoryBaseWrapper> MainNavigationRootSource { get; }

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

C#
public string Name { get; set; }

Implements: IDialogViewModel.Name

Gets a string representing the path to the current folder.

C#
public string Path { get; }

Implements: IDialogViewModel.Path

Gets the currently root and current visible FileSystemInfoWrappers.

C#
public BindingList<FileSystemInfoWrapper> RootAndCurrentFileSystemObjects { get; }
C#
public IInvokeSelectedFileSystemObjects SelectedFilesInvoker { get; set; }

Gets the currently selected file or folder.

C#
public FileSystemInfoWrapper SelectedFileSystemObject { get; set; }

Implements: ICurrentDirectoryViewModel.SelectedFileSystemObject

Gets the selected LayoutConfigurationModel.

C#
public LayoutConfigurationModel SelectedLayout { get; set; }

Implements: IDialogViewModel.SelectedLayout

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

C#
public bool ShowHiddenFiles { get; set; }

Implements: IDialogViewModel.ShowHiddenFiles

Methods

C#
protected virtual bool CanCopyExecute()
Returns:

bool

C#
protected virtual bool CanCutExecute()
Returns:

bool

C#
protected virtual bool CanDeleteExecute()
Returns:

bool

C#
protected virtual bool CanEditExecute()
Returns:

bool

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

C#
protected virtual bool CanExecuteAccept()
Returns:

bool

C#
protected virtual bool CanExecuteHelper()
Returns:

bool

C#
protected virtual bool CanNewFolderExecute()
Returns:

bool

C#
protected virtual bool CanPasteExecute()
Returns:

bool

Creates new child folder in the CurrentParentDirectory.

C#
public bool CreateNewChildFolder()
Returns:

bool

Implements: ICurrentDirectoryViewModel.CreateNewChildFolder()

Releases unmanaged and - optionally - managed resources.

C#
protected override void Dispose(bool disposing)
Parameters:disposingbool

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

Overrides: ViewModelBase.Dispose(bool)

Gets the current visible FileSystemInfoWrappers.

C#
protected abstract IEnumerable<FileSystemInfoWrapper> GetCurrentFileSystemInfoWrappers(DirectoryBaseWrapper parent)
Parameters:parentDirectoryBaseWrapperReturns:

IEnumerable<FileSystemInfoWrapper>

Execute logic when accept is executed for the selected FileSystemInfoWrappers.

C#
protected virtual void InvokeSelectedFileSystemObjects()
C#
protected virtual void OnCopyCommand(IntPtr controlHandle)
Parameters:controlHandleIntPtr
C#
public void OnCurrentSearchResultsChanged()
C#
protected virtual void OnCutCommand(IntPtr controlHandle)
Parameters:controlHandleIntPtr
C#
protected virtual void OnDeleteCommand(IntPtr controlHandle)
Parameters:controlHandleIntPtr
C#
protected virtual void OnEditExecuted()
C#
protected virtual void OnNewFolderExecuted()
C#
protected virtual void OnPasteCommand(IntPtr controlHandle)
Parameters:controlHandleIntPtr
C#
protected virtual void OnPropertyChanging(string propertyName)
Parameters:propertyNamestring

Notifies when the SelectedFileSystemObject changes.

C#
protected virtual void OnSelectionChanged()
C#
protected virtual void PrepareCommandAndExecute(IntPtr controlHandle, ShellContextMenuCommand command)
Parameters:controlHandleIntPtrcommandShellContextMenuCommand

Resets the selection.

C#
protected virtual void ResetSelection()
C#
protected virtual bool ShouldCancelDiretoryNavigating(string newDir)
Parameters:newDirstringReturns:

bool

Events

C#
public event EventHandler<DirectoryNavigatingEventArgs> DirectoryNavigating
C#
public event PropertyChangingEventHandler PropertyChanging

Implements: INotifyPropertyChanging.PropertyChanging