DialogViewModel
Base class for the different file dialogs.
Definition
Namespace:Telerik.WinControls.FileDialogs
Assembly:Telerik.WinControls.UI.dll
Syntax:
public abstract class DialogViewModel : ViewModelBase, INotifyPropertyChanged, IDisposable, IDialogViewModel, ICurrentDirectoryViewModel, INotifyPropertyChanging
Inheritance: objectViewModelBaseDialogViewModel
Derived Classes:
Implements:
Inherited Members
Constructors
Initializes a new instance of the DialogViewModel class.
protected DialogViewModel(FileSystemInfoWrapperFactoryBase fileSystemInfoWrapperFactory, bool showNetwork, string rootDirPath = "")
The FileSystemInfoWrapperFactoryBase used for creating FileSystemInfoWrappers.
showNetworkboolBoolean indicating whether network locations are shown.
rootDirPathstringThe path of the initial directory.
Properties
Gets the currently visible FileSystemInfoWrappers.
public BindingList<FileSystemInfoWrapper> CurrentFileSystemObjects { get; }
Gets the currently drilled directory.
public DirectoryBaseWrapper CurrentParentDirectory { get; set; }
Implements:
Collection of search results. We do not use ViewModels CurrentFileSystemObjects in order to be process the results in background successfully.
public BindingList<FileSystemInfoWrapper> CurrentSearchResults { get; }
CustomPlaces
IEnumerable<DirectoryInfoWrapper>
Gets or sets the collection of custom places.
public IEnumerable<DirectoryInfoWrapper> CustomPlaces { get; set; }
Implements:
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.
public EditingOptions EditingOptions { get; set; }
Gets the FileSystemInfoWrapperFactoryBase for creating wrappers for FileSystemInfos.
protected FileSystemInfoWrapperFactoryBase FileSystemInfoWrapperFactory { get; }
Gets or sets the initial directory.
public DirectoryBaseWrapper InitialDirectory { get; set; }
Implements:
Gets or sets the ExplorerControl used by FileDialogs helpers for theme-aware layout and directory-change notifications.
public static ExplorerControl InvokeContext { get; set; }
Return true if the selected item is directory.
public bool IsDirectorySelected { get; }
Used to trigger a busy indicator while network location is being loaded for the main pane.
public bool IsMainPaneLoadingNetwork { get; set; }
Gets or sets the IsSearchViewActive. When true, it indicates the Dialog's Main Pane shows results from search operation.
public bool IsSearchViewActive { get; set; }
Layouts
IEnumerable<LayoutConfigurationModel>
Gets the available layouts for the dialog explorer.
public virtual IEnumerable<LayoutConfigurationModel> Layouts { get; }
Implements:
Gets the root directory wrapper currently used for folder navigation.
public DirectoryBaseWrapper MainNavigationRoot { get; }
Gets the collection of root locations available in the dialog's navigation pane.
public ObservableCollection<DirectoryBaseWrapper> MainNavigationRootSource { get; }
Gets or sets a string representing the full path to the current file system object.
public string Name { get; set; }
Implements:
Gets a string representing the path to the current folder.
public string Path { get; }
Implements:
Gets the currently root and current visible FileSystemInfoWrappers.
public BindingList<FileSystemInfoWrapper> RootAndCurrentFileSystemObjects { get; }
Gets or sets the handler called when the dialog accepts the selected file-system objects.
public IInvokeSelectedFileSystemObjects SelectedFilesInvoker { get; set; }
Gets the currently selected file or folder.
public FileSystemInfoWrapper SelectedFileSystemObject { get; set; }
Implements:
Gets the selected LayoutConfigurationModel.
public LayoutConfigurationModel SelectedLayout { get; set; }
Implements:
Gets or sets a boolean value indicating whether the dialog shows hidden files and folders.
public bool ShowHiddenFiles { get; set; }
Implements:
Methods
Determines whether Copy is enabled by EditingOptions and the current selection supports shell commands.
Determines whether Cut is enabled by EditingOptions and the current selection supports shell commands.
Determines whether Delete is enabled by EditingOptions and the current selection supports shell commands.
Determines whether the selected file-system object can be edited.
Defines the method that determines whether the accept command can execute in its current state.
Determines whether a selected item exists and is not a non-operable network or shell directory.
Determines whether a child folder can be created in the current directory under the configured editing options.
Determines whether Paste is enabled by EditingOptions.
Creates new child folder in the CurrentParentDirectory.
Clears the shared ExplorerControl context during disposal.
protected override void Dispose(bool disposing)
Indicates whether disposal is occurring as part of an explicit dispose operation.
Overrides:
Gets the current visible FileSystemInfoWrappers.
protected abstract IEnumerable<FileSystemInfoWrapper> GetCurrentFileSystemInfoWrappers(DirectoryBaseWrapper parent)
The directory whose visible file-system entries are retrieved.
Returns:IEnumerable<FileSystemInfoWrapper>
Execute logic when accept is executed for the selected FileSystemInfoWrappers.
protected virtual void InvokeSelectedFileSystemObjects()
Runs the Shell Copy command for the current selection.
protected virtual void OnCopyCommand(IntPtr controlHandle)
Handle of the control that owns the shell operation.
Notifies bindings that the current search results were replaced or cleared.
public void OnCurrentSearchResultsChanged()
Marks the current selection as cut and runs the Shell Cut command.
protected virtual void OnCutCommand(IntPtr controlHandle)
Handle of the control that owns the shell operation.
Runs the Shell Delete command for the current selection.
protected virtual void OnDeleteCommand(IntPtr controlHandle)
Handle of the control that owns the shell operation.
Enters edit mode for the selected file-system object.
protected virtual void OnEditExecuted()
Creates a child folder when this view model supports current-directory operations.
protected virtual void OnNewFolderExecuted()
Runs the Shell Paste command for the current directory.
protected virtual void OnPasteCommand(IntPtr controlHandle)
Handle of the control that owns the shell operation.
Raises PropertyChanging for the specified property.
protected virtual void OnPropertyChanging(string propertyName)
The name of the property about to change.
Notifies when the SelectedFileSystemObject changes.
protected virtual void OnSelectionChanged()
Builds the target selection and invokes the specified Shell command.
protected virtual void PrepareCommandAndExecute(IntPtr controlHandle, ShellContextMenuCommand command)
Handle of the control that owns the shell operation.
commandShellContextMenuCommandThe Shell command to execute.
Resets the selection.
protected virtual void ResetSelection()
Raises DirectoryNavigating and reports whether navigation to the specified directory was canceled.
Events
Occurs before navigation to a directory; set Cancel to prevent the navigation.
public event EventHandler<DirectoryNavigatingEventArgs> DirectoryNavigating
Occurs when the view model raises its pre-change notification; the base implementation does so before CurrentParentDirectory changes.
public event PropertyChangingEventHandler PropertyChanging
Implements: