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

Base class for file and folder dialogs.

Definition

Namespace:Telerik.Windows.Controls

Assembly:Telerik.Windows.Controls.FileDialogs.dll

Syntax:

C#
public abstract class DialogWindowBase : WindowBase, INotifyLayoutChange, IDragAware

Inheritance: objectWindowBaseDialogWindowBase

Derived Classes: RadOpenFileDialogRadOpenFolderDialogRadSaveFileDialog

Implements: IDragAwareINotifyLayoutChange

Inherited Members WindowBase.IsModalPropertyWindowBase.IsOpenPropertyWindowBase.IsResizingPropertyWindowBase.IsDraggingPropertyWindowBase.IsActiveWindowPropertyWindowBase.IsInActiveStatePropertyWindowBase.IsTopmostPropertyWindowBase.CaptionHeightPropertyWindowBase.ResizeBorderPropertyWindowBase.LeftPropertyWindowBase.TopPropertyWindowBase.WindowStatePropertyWindowBase.ResizeModePropertyWindowBase.CanClosePropertyWindowBase.CanMovePropertyWindowBase.SizeToContentPropertyWindowBase.HideMinimizeButtonPropertyWindowBase.HideMaximizeButtonPropertyWindowBase.CornerRadiusPropertyWindowBase.Close()WindowBase.GetZIndex()WindowBase.BringToFront()WindowBase.GetNormalSizeAndPosition()WindowBase.ShouldActivateOnShow()WindowBase.ShouldShowInTaskSwitcher()WindowBase.ShouldActivate()WindowBase.ChangeVisualState()WindowBase.ShowWindow(bool)WindowBase.CheckCanClose()WindowBase.OnLayoutChangeEnded(EventArgs)WindowBase.OnLocationChanged(EventArgs)WindowBase.OnLayoutChangeStarted(EventArgs)WindowBase.OnWindowStateChanged(EventArgs)WindowBase.OnHostCreated(HostWindowCreatedEventArgs)WindowBase.OnGotKeyboardFocus(KeyboardFocusChangedEventArgs)WindowBase.GetApplicationSize()WindowBase.OnLayoutChangeEnded()WindowBase.OnLayoutChangeStarted()WindowBase.CloseWithoutEventsAndAnimations()WindowBase.OnCloseAnimationFinished()WindowBase.OnShowAnimationFinished()WindowBase.OnRightMouseButtonUp()WindowBase.OnRootVisualSizeChanged()WindowBase.OnDragStart(Point, bool)WindowBase.OnDragEnd(Point, bool, bool)WindowBase.OnDragDelta(Point, Rect, Rect, bool)WindowBase.OnActivated(EventArgs)WindowBase.OnDeactivated(EventArgs)WindowBase.ShouldSystemMenuOnRightClick()WindowBase.IsModalWindowBase.IsOpenWindowBase.IsTopmostWindowBase.CaptionHeightWindowBase.ResizeBorderWindowBase.LeftWindowBase.TopWindowBase.IsResizingWindowBase.IsDraggingWindowBase.IsLayoutChangingWindowBase.WindowStateWindowBase.ResizeModeWindowBase.CanCloseWindowBase.CanMoveWindowBase.IsActiveWindowWindowBase.IsInActiveStateWindowBase.CornerRadiusWindowBase.SizeToContentWindowBase.HideMaximizeButtonWindowBase.HideMinimizeButtonWindowBase.OwnerWindowBase.ActivatedWindowBase.DeactivatedWindowBase.LayoutChangeEndedWindowBase.LayoutChangeStartedWindowBase.LocationChangedWindowBase.WindowStateChanged...

Fields

BorderBackgroundProperty

DependencyProperty

Identifies the BorderBackground dependency property.

C#
public static readonly DependencyProperty BorderBackgroundProperty

CanUserRenameProperty

DependencyProperty

Identifies the CanUserRename dependency property.

C#
public static readonly DependencyProperty CanUserRenameProperty

DialogResultProperty

DependencyProperty

Identifies the DialogResult dependency property.

C#
public static readonly DependencyProperty DialogResultProperty

Identifies the DialogStartupLocation dependency property.

C#
public static readonly DependencyProperty DialogStartupLocationProperty

DragDropBehaviorProperty

DependencyProperty

Identifies the DragDropBehavior dependency property.

C#
public static readonly DependencyProperty DragDropBehaviorProperty

Identifies the ExpandToCurrentDirectory dependency property.

C#
public static readonly DependencyProperty ExpandToCurrentDirectoryProperty

IconProperty

DependencyProperty

Identifies the Icon dependency property.

C#
public static readonly DependencyProperty IconProperty

IconTemplateProperty

DependencyProperty

Identifies the IconTemplate dependency property.

C#
public static readonly DependencyProperty IconTemplateProperty

IsDragDropEnabledProperty

DependencyProperty

Identifies the IsDragDropEnabled dependency property.

C#
public static readonly DependencyProperty IsDragDropEnabledProperty

Identifies the LoadDrivesInBackground dependency property.

C#
public static readonly DependencyProperty LoadDrivesInBackgroundProperty

ResponseButtonProperty

DependencyProperty

Identifies the ResponseButton Property.

C#
public static readonly DependencyProperty ResponseButtonProperty

ShowHiddenFilesProperty

DependencyProperty

Identifies the ShowHiddenFiles dependency property.

C#
public static readonly DependencyProperty ShowHiddenFilesProperty

Properties

Gets or sets a brush to be used to draw the title of DialogWindow. This is a dependency property.

C#
public Brush BorderBackground { get; set; }

Gets or sets a value indicating whether the user can rename file or folders via mouse click or keyboard F2 press in main pane.

C#
public bool CanUserRename { get; set; }

Gets or sets the collection of custom places.

C#
public IList<string> CustomPlaces { get; }

Gets or sets a DialogResult value for the RadWindow. This is a dependency property.

C#
public bool? DialogResult { get; set; }

DialogStartupLocation

WindowStartupLocation

Gets or sets a DialogStartupLocation value for this DialogWindowBase. This is a dependency property.

C#
public WindowStartupLocation DialogStartupLocation { get; set; }
C#
public FileBrowserDragDropBehavior DragDropBehavior { get; set; }

Gets or sets a value indicating whether the main navigation pane expands and brings into view the current directory.

C#
public bool ExpandToCurrentDirectory { get; set; }

Gets or sets a string containing the selected file name, including the path. Short file name without the full path is not supported.

C#
public string FileName { get; set; }
C#
protected FileSystemInfoWrapperFactoryBase FileSystemInfoWrapperFactory { get; }

Gets or sets the Icon image to appear in the RadWindow title bar. This is a dependency property.

C#
public object Icon { get; set; }

IconTemplate

DataTemplate

Gets or sets the IconTemplate property. This is a dependency property.

C#
public DataTemplate IconTemplate { get; set; }

Gets or sets the initial directory.

C#
public string InitialDirectory { get; set; }

Gets or sets the initial LayoutType.

C#
public LayoutType InitialSelectedLayout { get; set; }

Gets or sets a value indicating whether this DialogWindowBase allows drag-drop operations.

C#
public bool IsDragDropEnabled { get; set; }

Gets or sets a value indicating whether the control loads the drives under 'This PC' node in background thread. Could be used in scenarios when some drives are expected to load slower than normal.

C#
public bool LoadDrivesInBackground { get; set; }

Gets or sets a value indicating whether the dialog box restores the directory to the previously selected directory before closing.

C#
public bool RestoreDirectory { get; set; }

Gets or sets a boolean value indicating whether hidden files and folders should be visible in the Dialog.

C#
public bool ShowHiddenFiles { get; set; }

Gets or sets a value indicating whether the dialog shows network computers in the navigation tree.

C#
public bool ShowNetworkLocations { get; set; }

Methods

Updates the visual state of the control.

C#
protected override void ChangeVisualState(bool useTransitions)
Parameters:useTransitionsbool

Indicates whether transitions should be used.

Overrides: WindowBase.ChangeVisualState(bool)

Provides the CustomPlaces as list of DirectoryInfoWrappers to the DialogViewModel of this DialogWindowBase instance.

C#
protected virtual IList<DirectoryInfoWrapper> GetDialogViewModelCustomPlaces()
Returns:

IList<DirectoryInfoWrapper>

Provides the InitialDirectory as DirectoryInfoWrapper to the DialogViewModel of this DialogWindowBase instance. Returns null if DirectoryInfo cannot be created due to incorrect InitialDirectory string or access rights.

C#
protected virtual DirectoryInfoWrapper GetDialogViewModelInitialDirectory()
Returns:

DirectoryInfoWrapper

This walks the visual tree for a parent of a specific type.

C#
public static DialogWindowBase GetParentDialogWindow(DependencyObject child)
Parameters:childDependencyObject

The object which parent is searched.

Returns:

DialogWindowBase

Gets the response button.

C#
public static ResponseButton GetResponseButton(DependencyObject button)
Parameters:buttonDependencyObject

The button.

Returns:

ResponseButton

GetWindowOwner()

ContentControl

C#
protected override ContentControl GetWindowOwner()
Returns:

ContentControl

Overrides: WindowBase.GetWindowOwner()

Gets the owner handle of the WindowBase.

C#
protected override nint GetWindowOwnerHandle()
Returns:

nint

Overrides: WindowBase.GetWindowOwnerHandle()

GetWindowStartupLocation()

WindowStartupLocation

C#
protected override WindowStartupLocation GetWindowStartupLocation()
Returns:

WindowStartupLocation

Overrides: WindowBase.GetWindowStartupLocation()

When overridden in a derived class, is invoked whenever application code or internal processes (such as a rebuilding layout pass) call .

C#
public override void OnApplyTemplate()
C#
protected override void OnClosed()

Overrides: WindowBase.OnClosed()

Raises the event.

C#
protected virtual void OnClosed(WindowClosedEventArgs args)
Parameters:argsWindowClosedEventArgs

The WindowClosedEventArgs instance containing the event data.

C#
protected override bool OnClosing()
Returns:

bool

Overrides: WindowBase.OnClosing()

Create the automation peer for this class.

C#
protected override AutomationPeer OnCreateAutomationPeer()
Returns:

AutomationPeer

Overrides: WindowBase.OnCreateAutomationPeer()

Called before the event occurs.

C#
protected override void OnGotFocus(RoutedEventArgs e)
Parameters:eRoutedEventArgs

The data for the event.

Called before the event occurs.

C#
protected override void OnKeyDown(KeyEventArgs e)
Parameters:eKeyEventArgs

The data for the event.

Called before the event occurs.

C#
protected override void OnLostFocus(RoutedEventArgs e)
Parameters:eRoutedEventArgs

The data for the event.

C#
protected virtual bool OnPreviewClosed()
Returns:

bool

Raises the event.

C#
protected virtual void OnPreviewClosed(WindowPreviewClosedEventArgs args)
Parameters:argsWindowPreviewClosedEventArgs

The WindowPreviewClosedEventArgs instance containing the event data.

Creates a FileStream with the specified FileMode and FileAccess.

C#
protected Stream OpenFileInternal(FileMode fileMode, FileAccess fileAccess)
Parameters:fileModeFileModefileAccessFileAccessReturns:

Stream

Exceptions:

ArgumentNullException

Selected file is null.

ArgumentException

Selected file is empty string, contains only white space, contains one or more invalid characters, or refers to a non-file device.

NotSupportedException

Selected file refers to a non-file device.

Selected file cannot be found, such as when mode is FileMode.Truncate or FileMode.Open, and the file specified by path does not exist. The file must already exist in these modes.

An I/O error occurred or the stream has been closed.

The caller does not have the required permission.

Selected file is invalid, such as being on an unmapped drive.

UnauthorizedAccessException

The access requested is not permitted by the operating system for the specified path, such as when access is Write or ReadWrite and the file or directory is set for read-only access.

The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.

ArgumentOutOfRangeException

The specified mode contains an invalid value.

Save information from the OpenFileDialogViewModel into this DialogWindowBase instance before the window is closed on Accept.

C#
protected virtual void SaveStateOnAccept()

Sets the response button.

C#
public static void SetResponseButton(DependencyObject button, ResponseButton value)
Parameters:buttonDependencyObject

The button.

valueResponseButton

The ResponseButton value.

C#
protected override bool ShouldFocusOnActivate()
Returns:

bool

Overrides: WindowBase.ShouldFocusOnActivate()

Opens modal DialogWindow in case it hasn't been already opened.

C#
public bool? ShowDialog()
Returns:

bool?

The DialogResult value.

Events

Occurs when the DialogWindowBase is closed.

C#
[SRCategory("Behavior")]
public event EventHandler<WindowClosedEventArgs> Closed
Remarks:

The event is raised right next after the PreviewClosed event. Both events are raise by Close method.

Occurs when the current folder is about to change.

C#
public event EventHandler<DirectoryNavigatingEventArgs> DirectoryNavigating

Occurs when the DirectoryInfo wrapper is about to be created.

C#
public event EventHandler<DirectoryRequestingEventArgs> DirectoryRequesting

Occurs when the Exception is raised.

C#
public event EventHandler<FileBrowserExceptionRaisedEventArgs> ExceptionRaised

Occurs when the DialogWindowBase is closing.

C#
[SRCategory("Behavior")]
public event EventHandler<WindowPreviewClosedEventArgs> PreviewClosed
Remarks:

The event is raised whenever the Close method is invoked.

Occurs when a file or directory is about to enter edit mode.

C#
public event EventHandler<RenamingEventArgs> Renaming

Occurs when context menu is about to open.

C#
public event EventHandler<ContextMenuOpeningEventArgs> ShellContextMenuOpening