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

Represents an interactive window that provides static methods for displaying standard dialog windows, including Alert, Confirm, and Prompt dialogs. The RadWindow class simplifies the creation and management of modal windows for user notifications and input, allowing developers to easily present messages and gather user responses through a customizable and styled interface.

Definition

Namespace:Telerik.Windows.Controls

Assembly:Telerik.Windows.Controls.Navigation.dll

Syntax:

C#
[TelerikToolboxCategory("Containers")]
public class RadWindow : WindowBase, INotifyLayoutChange, IDragAware

Inheritance: objectWindowBaseRadWindow

Derived Classes: RadDiagramPrintPreviewDialogFindDialogPasswordRequiredDialogSignSignatureDialogSignaturePropertiesDialogRadTabbedWindowRadVirtualKeyboardWindowAddModifyChoiceDialogModifyMultiLevelListDialogNewCaptionLabelDialogRadRichTextBoxWindowSchedulerWindowEditCustomDictionaryDialogSpellCheckAllAtOnceWindowSpellCheckWordByWordWindow...

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.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.GetWindowOwnerHandle()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...

Constructors

Initializes a new instance of the RadWindow class.

C#
public RadWindow()
Remarks:

Use this constructor to create an instance of the RadWindow. In order for the RadWindow to be displayed, it is not necessary to add it to the visual tree.

Fields

BorderBackgroundProperty

DependencyProperty

Identifies the BorderBackground dependency property.

C#
public static readonly DependencyProperty BorderBackgroundProperty

DialogResultProperty

DependencyProperty

Identifies the DialogResult dependency property.

C#
public static readonly DependencyProperty DialogResultProperty

IconMarginProperty

DependencyProperty

Identifies the IconMargin dependency property.

C#
public static readonly DependencyProperty IconMarginProperty

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

IsRestrictedProperty

DependencyProperty

Identifies the IsRestricted Property.

C#
public static readonly DependencyProperty IsRestrictedProperty

Identifies the IsRestrictedWhenMaximized Property.

C#
public static readonly DependencyProperty IsRestrictedWhenMaximizedProperty

PromptResultProperty

DependencyProperty

Identifies the PromptResult dependency property.

C#
public static readonly DependencyProperty PromptResultProperty

ResponseButtonProperty

DependencyProperty

Identifies the ResponseButton Property.

C#
public static readonly DependencyProperty ResponseButtonProperty

Identifies the RestoreMinimizedLocation Property.

C#
public static readonly DependencyProperty RestoreMinimizedLocationProperty

Identifies the RestrictedAreaMargin Property.

C#
public static readonly DependencyProperty RestrictedAreaMarginProperty

Identifies the ShouldUpdateActiveState Property.

C#
public static readonly DependencyProperty ShouldUpdateActiveStateProperty

Identifies the WindowStartupLocation dependency property.

C#
public static readonly DependencyProperty WindowStartupLocationProperty

Properties

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

C#
public Brush BorderBackground { get; set; }

Gets a size ratio when the window has infinity size and it is not restricted. The window size depends on root size and the default ratio.

C#
public static double DefaultSizeRatio { get; }

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

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

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

C#
public object Icon { get; set; }

IconMargin

Thickness

Gets or sets the margin of the icon of RadWindow. This is a dependency property.

C#
public Thickness IconMargin { get; set; }

IconTemplate

DataTemplate

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

C#
public DataTemplate IconTemplate { get; set; }

Gets or sets a value indicating whether this instance is restricted.

C#
public bool IsRestricted { get; set; }
Property Value:

True if this instance is restricted; otherwise, false.

Gets or sets whether when maximized the window to be restricted.

C#
public bool IsRestrictedWhenMaximized { get; set; }

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

C#
public string PromptResult { get; set; }

Gets or sets the value which determines whether the window preserves its size and location when WindowState property is changed. This is a dependency property.

C#
public bool RestoreMinimizedLocation { get; set; }

Gets or sets the restricted area margin.

C#
public Thickness RestrictedAreaMargin { get; set; }
Property Value:

The restricted area margin.

Gets or sets value indicating whether the visual active state of RadWindow should be updated to inactive state. By default is true. If set to false RadWindow will appear always visually active. This is a dependency property.

C#
public bool ShouldUpdateActiveState { get; set; }

WindowStartupLocation

WindowStartupLocation

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

C#
public WindowStartupLocation WindowStartupLocation { get; set; }

Methods

Opens an Alert modal window.

C#
public static void Alert(DialogParameters dialogParameters)
Parameters:dialogParametersDialogParameters

Structure that holds all possible parameters for customizing dialog window.

Remarks:

Use this method to populate Alert message that informs the user for a specific problem or warning.

Opens an Alert modal window.

C#
public static void Alert(object content, EventHandler<WindowClosedEventArgs> closed)
Parameters:contentobject

The content to be displayed.

closedEventHandler<WindowClosedEventArgs>

Represents the method that will handle the closed event.

Remarks:

Use this method to populate Alert message that informs the user for a specific problem or warning.

Opens an Alert modal window.

C#
public static void Alert(object content)
Parameters:contentobject

The content to be displayed.

Remarks:

Use this method to populate Alert message that informs the user for a specific problem or warning.

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)

Configures a modal window with the specified alert and dialog parameters.

C#
public static void ConfigureModal(RadAlert content, DialogParameters dialogParams)
Parameters:contentRadAlert

The RadAlert instance to be displayed as the modal window.

dialogParamsDialogParameters

The parameters that define the dialog's behavior and appearance.

Opens a Confirm modal window.

C#
public static void Confirm(DialogParameters dialogParameters)
Parameters:dialogParametersDialogParameters

Structure that holds all possible parameters for customizing dialog window.

Remarks:

Use this method to populate Confirm message that request the user to confirm some actions.

Opens a Confirm modal window.

C#
public static void Confirm(object content, EventHandler<WindowClosedEventArgs> closed)
Parameters:contentobject

The content to be displayed.

closedEventHandler<WindowClosedEventArgs>

Represents the method that will handle the closed event.

Remarks:

Use this method to populate Confirm message that request the user to confirm some actions.

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

C#
public static RadWindow GetParentRadWindow(DependencyObject child)
Parameters:childDependencyObject

The object which parent is searched.

Returns:

RadWindow

Gets the response button.

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

The button.

Returns:

ResponseButton

GetWindowOwner()

ContentControl

Gets the owner of the RadWindow.

C#
protected override ContentControl GetWindowOwner()
Returns:

ContentControl

Overrides: WindowBase.GetWindowOwner()

GetWindowStartupLocation()

WindowStartupLocation

Gets the WindowStartupLocation value for the RadWindow.

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()

Called when the window is closed.

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.

Raises the event and checks whether the closing should be canceled.

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.

Raises the event.

C#
protected override void OnHostCreated(HostWindowCreatedEventArgs args)
Parameters:argsHostWindowCreatedEventArgs

The HostWindowCreatedEventArgs instance containing the event data.

Overrides: WindowBase.OnHostCreated(HostWindowCreatedEventArgs)

Raises the event and sets from the active theme.

C#
protected override void OnInitialized(EventArgs e)
Parameters:eEventArgs

The RoutedEventArgs that contains the event data.

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.

Raises the event and checks whether the closing should be canceled.

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.

Raises the event.

C#
protected override void OnWindowStateChanged(EventArgs args)
Parameters:argsEventArgs

The RoutedEventArgs instance containing the event data.

Overrides: WindowBase.OnWindowStateChanged(EventArgs)

Opens a Prompt modal window.

C#
public static void Prompt(DialogParameters dialogParameters)
Parameters:dialogParametersDialogParameters

Structure that holds all possible parameters for customizing dialog window.

Opens a Prompt modal window.

C#
public static void Prompt(object content, EventHandler<WindowClosedEventArgs> closed, string defaultPromptResult)
Parameters:contentobject

Question to the user.

closedEventHandler<WindowClosedEventArgs>

Represents the method that will handle the closed event.

defaultPromptResultstring

The default prompt result value that will appear in the textbox.

Remarks:

Use this method to populate Prompt message that requires the user to enter specific value.

Opens a Prompt modal window.

C#
public static void Prompt(object content, EventHandler<WindowClosedEventArgs> closed)
Parameters:contentobject

Question to the user.

closedEventHandler<WindowClosedEventArgs>

Represents the method that will handle the closed event.

Remarks:

Use this method to populate Prompt message that requires the user to enter specific value.

Resets the theme.

C#
public void ResetTheme()

Sets the response button.

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

The button.

valueResponseButton

The ResponseButton value.

Determines whether the control should focus when it is activated.

C#
protected override bool ShouldFocusOnActivate()
Returns:

bool

Overrides: WindowBase.ShouldFocusOnActivate()

Opens RadWindow in case it hasn't been already opened.

C#
public void Show()

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

C#
public bool? ShowDialog()
Returns:

bool?

A System.Nullable value of type System.Boolean that determines how the dialog was closed.

Events

Occurs when the RadWindow 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 "Host" Window instance is created.

C#
[SRCategory("Behavior")]
public event EventHandler<HostWindowCreatedEventArgs> HostCreated

Occurs when the RadWindow is closing.

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

The event is raised whenever the Close method is invoked.

In this article
DefinitionConstructorsRadWindow()FieldsBorderBackgroundPropertyDialogResultPropertyIconMarginPropertyIconPropertyIconTemplatePropertyIsRestrictedPropertyIsRestrictedWhenMaximizedPropertyPromptResultPropertyResponseButtonPropertyRestoreMinimizedLocationPropertyRestrictedAreaMarginPropertyShouldUpdateActiveStatePropertyWindowStartupLocationPropertyPropertiesBorderBackgroundDefaultSizeRatioDialogResultIconIconMarginIconTemplateIsRestrictedIsRestrictedWhenMaximizedPromptResultRestoreMinimizedLocationRestrictedAreaMarginShouldUpdateActiveStateWindowStartupLocationMethodsAlert(DialogParameters)Alert(object, EventHandler<WindowClosedEventArgs>)Alert(object)ChangeVisualState(bool)ConfigureModal(RadAlert, DialogParameters)Confirm(DialogParameters)Confirm(object, EventHandler<WindowClosedEventArgs>)GetParentRadWindow(DependencyObject)GetResponseButton(DependencyObject)GetWindowOwner()GetWindowStartupLocation()OnApplyTemplate()OnClosed()OnClosed(WindowClosedEventArgs)OnClosing()OnCreateAutomationPeer()OnGotFocus(RoutedEventArgs)OnHostCreated(HostWindowCreatedEventArgs)OnInitialized(EventArgs)OnKeyDown(KeyEventArgs)OnLostFocus(RoutedEventArgs)OnPreviewClosed()OnPreviewClosed(WindowPreviewClosedEventArgs)OnWindowStateChanged(EventArgs)Prompt(DialogParameters)Prompt(object, EventHandler<WindowClosedEventArgs>, string)Prompt(object, EventHandler<WindowClosedEventArgs>)ResetTheme()SetResponseButton(DependencyObject, ResponseButton)ShouldFocusOnActivate()Show()ShowDialog()EventsClosedHostCreatedPreviewClosed
Not finding the help you need?
Contact Support