Class
RadWindow

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:

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

RadWindow()

Initializes a new instance of the RadWindow class.

Declaration

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

Identifies the BorderBackground dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty BorderBackgroundProperty

Field Value

DependencyProperty

DialogResultProperty

Identifies the DialogResult dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty DialogResultProperty

Field Value

DependencyProperty

IconMarginProperty

Identifies the IconMargin dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IconMarginProperty

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

IsRestrictedProperty

Identifies the IsRestricted Property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsRestrictedProperty

Field Value

DependencyProperty

IsRestrictedWhenMaximizedProperty

Identifies the IsRestrictedWhenMaximized Property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsRestrictedWhenMaximizedProperty

Field Value

DependencyProperty

PromptResultProperty

Identifies the PromptResult dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty PromptResultProperty

Field Value

DependencyProperty

ResponseButtonProperty

Identifies the ResponseButton Property.

Declaration

cs-api-definition
public static readonly DependencyProperty ResponseButtonProperty

Field Value

DependencyProperty

RestoreMinimizedLocationProperty

Identifies the RestoreMinimizedLocation Property.

Declaration

cs-api-definition
public static readonly DependencyProperty RestoreMinimizedLocationProperty

Field Value

DependencyProperty

RestrictedAreaMarginProperty

Identifies the RestrictedAreaMargin Property.

Declaration

cs-api-definition
public static readonly DependencyProperty RestrictedAreaMarginProperty

Field Value

DependencyProperty

ShouldUpdateActiveStateProperty

Identifies the ShouldUpdateActiveState Property.

Declaration

cs-api-definition
public static readonly DependencyProperty ShouldUpdateActiveStateProperty

Field Value

DependencyProperty

WindowStartupLocationProperty

Identifies the WindowStartupLocation dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty WindowStartupLocationProperty

Field Value

DependencyProperty

Properties

BorderBackground

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

Declaration

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

Property Value

Brush

DefaultSizeRatio

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.

Declaration

cs-api-definition
public static double DefaultSizeRatio { get; }

Property Value

double

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?

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

IconMargin

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

Declaration

cs-api-definition
public Thickness IconMargin { get; set; }

Property Value

Thickness

IconTemplate

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

Declaration

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

Property Value

DataTemplate

IsRestricted

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

Declaration

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

Property Value

bool

True if this instance is restricted; otherwise, false.

IsRestrictedWhenMaximized

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

Declaration

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

Property Value

bool

PromptResult

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

Declaration

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

Property Value

string

RestoreMinimizedLocation

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.

Declaration

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

Property Value

bool

RestrictedAreaMargin

Gets or sets the restricted area margin.

Declaration

cs-api-definition
public Thickness RestrictedAreaMargin { get; set; }

Property Value

Thickness

The restricted area margin.

ShouldUpdateActiveState

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.

Declaration

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

Property Value

bool

WindowStartupLocation

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

Declaration

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

Property Value

WindowStartupLocation

Methods

Alert(DialogParameters)

Opens an Alert modal window.

Declaration

cs-api-definition
public static void Alert(DialogParameters dialogParameters)

Parameters

dialogParameters

DialogParameters

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.

Alert(object)

Opens an Alert modal window.

Declaration

cs-api-definition
public static void Alert(object content)

Parameters

content

object

The content to be displayed.

Remarks

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

Alert(object, EventHandler<WindowClosedEventArgs>)

Opens an Alert modal window.

Declaration

cs-api-definition
public static void Alert(object content, EventHandler<WindowClosedEventArgs> closed)

Parameters

content

object

The content to be displayed.

closed

EventHandler<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.

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)

ConfigureModal(RadAlert, DialogParameters)

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

Declaration

cs-api-definition
public static void ConfigureModal(RadAlert content, DialogParameters dialogParams)

Parameters

content

RadAlert

The RadAlert instance to be displayed as the modal window.

dialogParams

DialogParameters

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

Confirm(DialogParameters)

Opens a Confirm modal window.

Declaration

cs-api-definition
public static void Confirm(DialogParameters dialogParameters)

Parameters

dialogParameters

DialogParameters

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.

Confirm(object, EventHandler<WindowClosedEventArgs>)

Opens a Confirm modal window.

Declaration

cs-api-definition
public static void Confirm(object content, EventHandler<WindowClosedEventArgs> closed)

Parameters

content

object

The content to be displayed.

closed

EventHandler<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.

GetParentRadWindow(DependencyObject)

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

Declaration

cs-api-definition
public static RadWindow GetParentRadWindow(DependencyObject child)

Parameters

child

DependencyObject

The object which parent is searched.

Returns

RadWindow

GetResponseButton(DependencyObject)

Gets the response button.

Declaration

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

Parameters

button

DependencyObject

The button.

Returns

ResponseButton

GetWindowOwner()

Gets the owner of the RadWindow.

Declaration

cs-api-definition
protected override ContentControl GetWindowOwner()

Returns

ContentControl

Overrides WindowBase.GetWindowOwner()

GetWindowStartupLocation()

Gets the WindowStartupLocation value for the RadWindow.

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

Called when the window is closed.

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

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

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.

OnHostCreated(HostWindowCreatedEventArgs)

Raises the event.

Declaration

cs-api-definition
protected override void OnHostCreated(HostWindowCreatedEventArgs args)

Parameters

args

HostWindowCreatedEventArgs

The HostWindowCreatedEventArgs instance containing the event data.

Overrides WindowBase.OnHostCreated(HostWindowCreatedEventArgs)

OnInitialized(EventArgs)

Raises the event and sets from the active theme.

Declaration

cs-api-definition
protected override void OnInitialized(EventArgs e)

Parameters

e

EventArgs

The RoutedEventArgs that contains the event data.

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

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

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.

OnWindowStateChanged(EventArgs)

Raises the event.

Declaration

cs-api-definition
protected override void OnWindowStateChanged(EventArgs args)

Parameters

args

EventArgs

The RoutedEventArgs instance containing the event data.

Overrides WindowBase.OnWindowStateChanged(EventArgs)

Prompt(DialogParameters)

Opens a Prompt modal window.

Declaration

cs-api-definition
public static void Prompt(DialogParameters dialogParameters)

Parameters

dialogParameters

DialogParameters

Structure that holds all possible parameters for customizing dialog window.

Prompt(object, EventHandler<WindowClosedEventArgs>)

Opens a Prompt modal window.

Declaration

cs-api-definition
public static void Prompt(object content, EventHandler<WindowClosedEventArgs> closed)

Parameters

content

object

Question to the user.

closed

EventHandler<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.

Prompt(object, EventHandler<WindowClosedEventArgs>, string)

Opens a Prompt modal window.

Declaration

cs-api-definition
public static void Prompt(object content, EventHandler<WindowClosedEventArgs> closed, string defaultPromptResult)

Parameters

content

object

Question to the user.

closed

EventHandler<WindowClosedEventArgs>

Represents the method that will handle the closed event.

defaultPromptResult

string

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.

ResetTheme()

Resets the theme.

Declaration

cs-api-definition
public void ResetTheme()

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

Determines whether the control should focus when it is activated.

Declaration

cs-api-definition
protected override bool ShouldFocusOnActivate()

Returns

bool

Overrides WindowBase.ShouldFocusOnActivate()

Show()

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

Declaration

cs-api-definition
public void Show()

ShowDialog()

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

Declaration

cs-api-definition
public bool? ShowDialog()

Returns

bool?

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

Events

Closed

Occurs when the RadWindow 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.

HostCreated

Occurs when the "Host" Window instance is created.

Declaration

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

Event Value

EventHandler<HostWindowCreatedEventArgs>

PreviewClosed

Occurs when the RadWindow 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.

In this article
DefinitionConstructorsRadWindow()FieldsBorderBackgroundPropertyDialogResultPropertyIconMarginPropertyIconPropertyIconTemplatePropertyIsRestrictedPropertyIsRestrictedWhenMaximizedPropertyPromptResultPropertyResponseButtonPropertyRestoreMinimizedLocationPropertyRestrictedAreaMarginPropertyShouldUpdateActiveStatePropertyWindowStartupLocationPropertyPropertiesBorderBackgroundDefaultSizeRatioDialogResultIconIconMarginIconTemplateIsRestrictedIsRestrictedWhenMaximizedPromptResultRestoreMinimizedLocationRestrictedAreaMarginShouldUpdateActiveStateWindowStartupLocationMethodsAlert(DialogParameters)Alert(object)Alert(object, EventHandler<WindowClosedEventArgs>)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>)Prompt(object, EventHandler<WindowClosedEventArgs>, string)ResetTheme()SetResponseButton(DependencyObject, ResponseButton)ShouldFocusOnActivate()Show()ShowDialog()EventsClosedHostCreatedPreviewClosed
Not finding the help you need?
Contact Support