Class
DialogWindowBase

Base class for file and folder dialogs.

Definition

Namespace:Telerik.Windows.Controls

Assembly:Telerik.Windows.Controls.FileDialogs.dll

Syntax:

cs-api-definition
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

Identifies the BorderBackground dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty BorderBackgroundProperty

Field Value

DependencyProperty

CanUserRenameProperty

Identifies the CanUserRename dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty CanUserRenameProperty

Field Value

DependencyProperty

DialogResultProperty

Identifies the DialogResult dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty DialogResultProperty

Field Value

DependencyProperty

DialogStartupLocationProperty

Identifies the DialogStartupLocation dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty DialogStartupLocationProperty

Field Value

DependencyProperty

DragDropBehaviorProperty

Identifies the DragDropBehavior dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty DragDropBehaviorProperty

Field Value

DependencyProperty

ExpandToCurrentDirectoryProperty

Identifies the ExpandToCurrentDirectory dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty ExpandToCurrentDirectoryProperty

Field Value

DependencyProperty

IconProperty

Identifies the Icon dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IconProperty

Field Value

DependencyProperty

IconTemplateProperty

Identifies the IconTemplate dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IconTemplateProperty

Field Value

DependencyProperty

IsDragDropEnabledProperty

Identifies the IsDragDropEnabled dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsDragDropEnabledProperty

Field Value

DependencyProperty

LoadDrivesInBackgroundProperty

Identifies the LoadDrivesInBackground dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty LoadDrivesInBackgroundProperty

Field Value

DependencyProperty

ResponseButtonProperty

Identifies the ResponseButton Property.

Declaration

cs-api-definition
public static readonly DependencyProperty ResponseButtonProperty

Field Value

DependencyProperty

ShowHiddenFilesProperty

Identifies the ShowHiddenFiles dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty ShowHiddenFilesProperty

Field Value

DependencyProperty

Properties

BorderBackground

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

Declaration

cs-api-definition
public Brush BorderBackground { get; set; }

Property Value

Brush

CanUserRename

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

Declaration

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

Property Value

bool

CustomPlaces

Gets or sets the collection of custom places.

Declaration

cs-api-definition
public IList<string> CustomPlaces { get; }

Property Value

IList<string>

DialogResult

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

Declaration

cs-api-definition
public bool? DialogResult { get; set; }

Property Value

bool?

DialogStartupLocation

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

Declaration

cs-api-definition
public WindowStartupLocation DialogStartupLocation { get; set; }

Property Value

WindowStartupLocation

DragDropBehavior

Declaration

cs-api-definition
public FileBrowserDragDropBehavior DragDropBehavior { get; set; }

Property Value

FileBrowserDragDropBehavior

ExpandToCurrentDirectory

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

Declaration

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

Property Value

bool

FileName

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

Declaration

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

Property Value

string

FileSystemInfoWrapperFactory

Declaration

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

Property Value

FileSystemInfoWrapperFactoryBase

Icon

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

Declaration

cs-api-definition
public object Icon { get; set; }

Property Value

object

IconTemplate

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

Declaration

cs-api-definition
public DataTemplate IconTemplate { get; set; }

Property Value

DataTemplate

InitialDirectory

Gets or sets the initial directory.

Declaration

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

Property Value

string

InitialSelectedLayout

Gets or sets the initial LayoutType.

Declaration

cs-api-definition
public LayoutType InitialSelectedLayout { get; set; }

Property Value

LayoutType

IsDragDropEnabled

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

Declaration

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

Property Value

bool

LoadDrivesInBackground

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.

Declaration

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

Property Value

bool

RestoreDirectory

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

Declaration

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

Property Value

bool

ShowHiddenFiles

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

Declaration

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

Property Value

bool

ShowNetworkLocations

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

Declaration

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

Property Value

bool

Methods

ChangeVisualState(bool)

Updates the visual state of the control.

Declaration

cs-api-definition
protected override void ChangeVisualState(bool useTransitions)

Parameters

useTransitions

bool

Indicates whether transitions should be used.

Overrides WindowBase.ChangeVisualState(bool)

GetDialogViewModelCustomPlaces()

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

Declaration

cs-api-definition
protected virtual IList<DirectoryInfoWrapper> GetDialogViewModelCustomPlaces()

Returns

IList<DirectoryInfoWrapper>

GetDialogViewModelInitialDirectory()

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.

Declaration

cs-api-definition
protected virtual DirectoryInfoWrapper GetDialogViewModelInitialDirectory()

Returns

DirectoryInfoWrapper

GetParentDialogWindow(DependencyObject)

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

Declaration

cs-api-definition
public static DialogWindowBase GetParentDialogWindow(DependencyObject child)

Parameters

child

DependencyObject

The object which parent is searched.

Returns

DialogWindowBase

GetResponseButton(DependencyObject)

Gets the response button.

Declaration

cs-api-definition
public static ResponseButton GetResponseButton(DependencyObject button)

Parameters

button

DependencyObject

The button.

Returns

ResponseButton

GetWindowOwner()

Declaration

cs-api-definition
protected override ContentControl GetWindowOwner()

Returns

ContentControl

Overrides WindowBase.GetWindowOwner()

GetWindowOwnerHandle()

Gets the owner handle of the WindowBase.

Declaration

cs-api-definition
protected override nint GetWindowOwnerHandle()

Returns

nint

Overrides WindowBase.GetWindowOwnerHandle()

GetWindowStartupLocation()

Declaration

cs-api-definition
protected override WindowStartupLocation GetWindowStartupLocation()

Returns

WindowStartupLocation

Overrides WindowBase.GetWindowStartupLocation()

OnApplyTemplate()

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

Declaration

cs-api-definition
public override void OnApplyTemplate()

OnClosed()

Declaration

cs-api-definition
protected override void OnClosed()

Overrides WindowBase.OnClosed()

OnClosed(WindowClosedEventArgs)

Raises the event.

Declaration

cs-api-definition
protected virtual void OnClosed(WindowClosedEventArgs args)

Parameters

args

WindowClosedEventArgs

The WindowClosedEventArgs instance containing the event data.

OnClosing()

Declaration

cs-api-definition
protected override bool OnClosing()

Returns

bool

Overrides WindowBase.OnClosing()

OnCreateAutomationPeer()

Create the automation peer for this class.

Declaration

cs-api-definition
protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer

Overrides WindowBase.OnCreateAutomationPeer()

OnGotFocus(RoutedEventArgs)

Called before the event occurs.

Declaration

cs-api-definition
protected override void OnGotFocus(RoutedEventArgs e)

Parameters

e

RoutedEventArgs

The data for the event.

OnKeyDown(KeyEventArgs)

Called before the event occurs.

Declaration

cs-api-definition
protected override void OnKeyDown(KeyEventArgs e)

Parameters

e

KeyEventArgs

The data for the event.

OnLostFocus(RoutedEventArgs)

Called before the event occurs.

Declaration

cs-api-definition
protected override void OnLostFocus(RoutedEventArgs e)

Parameters

e

RoutedEventArgs

The data for the event.

OnPreviewClosed()

Declaration

cs-api-definition
protected virtual bool OnPreviewClosed()

Returns

bool

OnPreviewClosed(WindowPreviewClosedEventArgs)

Raises the event.

Declaration

cs-api-definition
protected virtual void OnPreviewClosed(WindowPreviewClosedEventArgs args)

Parameters

args

WindowPreviewClosedEventArgs

The WindowPreviewClosedEventArgs instance containing the event data.

OpenFileInternal(FileMode, FileAccess)

Creates a FileStream with the specified FileMode and FileAccess.

Declaration

cs-api-definition
protected Stream OpenFileInternal(FileMode fileMode, FileAccess fileAccess)

Parameters

fileMode

FileMode

fileAccess

FileAccess

Returns

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.

SaveStateOnAccept()

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

Declaration

cs-api-definition
protected virtual void SaveStateOnAccept()

SetResponseButton(DependencyObject, ResponseButton)

Sets the response button.

Declaration

cs-api-definition
public static void SetResponseButton(DependencyObject button, ResponseButton value)

Parameters

button

DependencyObject

The button.

value

ResponseButton

The ResponseButton value.

ShouldFocusOnActivate()

Declaration

cs-api-definition
protected override bool ShouldFocusOnActivate()

Returns

bool

Overrides WindowBase.ShouldFocusOnActivate()

ShowDialog()

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

Declaration

cs-api-definition
public bool? ShowDialog()

Returns

bool?

The DialogResult value.

Events

Closed

Occurs when the DialogWindowBase is closed.

Declaration

cs-api-definition
[SRCategory("Behavior")]
public event EventHandler<WindowClosedEventArgs> Closed

Event Value

EventHandler<WindowClosedEventArgs>

Remarks

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

DirectoryNavigating

Occurs when the current folder is about to change.

Declaration

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

Event Value

EventHandler<DirectoryNavigatingEventArgs>

DirectoryRequesting

Occurs when the DirectoryInfo wrapper is about to be created.

Declaration

cs-api-definition
public event EventHandler<DirectoryRequestingEventArgs> DirectoryRequesting

Event Value

EventHandler<DirectoryRequestingEventArgs>

ExceptionRaised

Occurs when the Exception is raised.

Declaration

cs-api-definition
public event EventHandler<FileBrowserExceptionRaisedEventArgs> ExceptionRaised

Event Value

EventHandler<FileBrowserExceptionRaisedEventArgs>

PreviewClosed

Occurs when the DialogWindowBase is closing.

Declaration

cs-api-definition
[SRCategory("Behavior")]
public event EventHandler<WindowPreviewClosedEventArgs> PreviewClosed

Event Value

EventHandler<WindowPreviewClosedEventArgs>

Remarks

The event is raised whenever the Close method is invoked.

Renaming

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

Declaration

cs-api-definition
public event EventHandler<RenamingEventArgs> Renaming

Event Value

EventHandler<RenamingEventArgs>

ShellContextMenuOpening

Occurs when context menu is about to open.

Declaration

cs-api-definition
public event EventHandler<ContextMenuOpeningEventArgs> ShellContextMenuOpening

Event Value

EventHandler<ContextMenuOpeningEventArgs>