skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • NEW: Design Kits for Figma
    • Online Training
    • Document Processing Library
    • Embedded Reporting for web and desktop
    Web
    Kendo UI UI for jQuery UI for Angular UI for React UI for Vue UI for ASP.NET AJAX UI for ASP.NET MVC UI for ASP.NET Core UI for Blazor UI for Silverlight UI for PHP UI for JSP
    Mobile
    UI for .NET MAUI UI for Xamarin
    Document Management
    Telerik Document Processing
    Desktop
    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF UI for UWP
    Reporting & Mocking
    Telerik Reporting Telerik Report Server Telerik JustMock
    Automated Testing
    Test Studio Test Studio Dev Edition
    CMS
    Sitefinity
    UI/UX Tools
    ThemeBuilder
    Debugging
    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Jam FiddlerCap FiddlerCore
    Extended Reality
    UI for Unity XR
    Free Tools
    JustAssembly JustDecompile VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Docs & Support
  • Pricing
  • Search
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class RadWindow

This class represents an interactive window and provides static methods for showing standard dialog windows - Alert, Confirm and Prompt.

Inheritance
System.Object
WindowBase
RadWindow
RadDiagramPrintPreviewDialog
FindDialog
PasswordRequiredDialog
SignaturePropertiesDialog
SignSignatureDialog
RadTabbedWindow
RadVirtualKeyboardWindow
AddModifyChoiceDialog
ModifyMultiLevelListDialog
NewCaptionLabelDialog
RadRichTextBoxWindow
SchedulerWindow
EditCustomDictionaryDialog
SpellCheckAllAtOnceWindow
SpellCheckWordByWordWindow
Inherited Members
WindowBase.IsModalProperty
WindowBase.IsOpenProperty
WindowBase.IsResizingProperty
WindowBase.IsDraggingProperty
WindowBase.IsActiveWindowProperty
WindowBase.IsInActiveStateProperty
WindowBase.IsTopmostProperty
WindowBase.CaptionHeightProperty
WindowBase.ResizeBorderProperty
WindowBase.LeftProperty
WindowBase.TopProperty
WindowBase.WindowStateProperty
WindowBase.ResizeModeProperty
WindowBase.CanCloseProperty
WindowBase.CanMoveProperty
WindowBase.SizeToContentProperty
WindowBase.HideMinimizeButtonProperty
WindowBase.HideMaximizeButtonProperty
WindowBase.CornerRadiusProperty
WindowBase.Close()
WindowBase.GetZIndex()
WindowBase.BringToFront()
WindowBase.GetNormalSizeAndPosition()
WindowBase.IDragAware.OnDragStart(Point, Boolean)
WindowBase.IDragAware.OnDragEnd(Point, Boolean, Boolean)
WindowBase.IDragAware.OnDragDelta(Point, Rect, Rect, Boolean)
WindowBase.ShouldActivateOnShow()
WindowBase.ShouldShowInTaskSwitcher()
WindowBase.ShouldActivate()
WindowBase.ChangeVisualState()
WindowBase.ShowWindow(Boolean)
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, Boolean)
WindowBase.OnDragEnd(Point, Boolean, Boolean)
WindowBase.OnDragDelta(Point, Rect, Rect, Boolean)
WindowBase.GetWindowOwnerHandle()
WindowBase.OnActivated(EventArgs)
WindowBase.OnDeactivated(EventArgs)
WindowBase.ShouldSystemMenuOnRightClick()
WindowBase.IsModal
WindowBase.IsOpen
WindowBase.IsTopmost
WindowBase.CaptionHeight
WindowBase.ResizeBorder
WindowBase.Left
WindowBase.Top
WindowBase.IsResizing
WindowBase.IsDragging
WindowBase.IsLayoutChanging
WindowBase.WindowState
WindowBase.ResizeMode
WindowBase.CanClose
WindowBase.CanMove
WindowBase.IsActiveWindow
WindowBase.IsInActiveState
WindowBase.CornerRadius
WindowBase.SizeToContent
WindowBase.HideMaximizeButton
WindowBase.HideMinimizeButton
WindowBase.Owner
WindowBase.Activated
WindowBase.Deactivated
WindowBase.LayoutChangeEnded
WindowBase.LayoutChangeStarted
WindowBase.LocationChanged
WindowBase.WindowStateChanged
Namespace: Telerik.Windows.Controls
Assembly: Telerik.Windows.Controls.Navigation.dll

Syntax

[TelerikToolboxCategory("Containers")]
public class RadWindow : WindowBase, INotifyLayoutChange, IWindowDragAware, IDragAware, IClickAware, IThemable

Constructors

RadWindow()

Initializes a new instance of the RadWindow class.

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

Examples
RadWindow window = new RadWindow();
Dim window As RadWindow = New RadWindow

Fields

BorderBackgroundProperty

Identifies the BorderBackground dependency property.

Declaration
public static readonly DependencyProperty BorderBackgroundProperty
Field Value
System.Windows.DependencyProperty

DialogResultProperty

Identifies the DialogResult dependency property.

Declaration
public static readonly DependencyProperty DialogResultProperty
Field Value
System.Windows.DependencyProperty

IconMarginProperty

Identifies the IconMargin dependency property.

Declaration
public static readonly DependencyProperty IconMarginProperty
Field Value
System.Windows.DependencyProperty

IconProperty

Identifies the Icon dependency property.

Declaration
public static readonly DependencyProperty IconProperty
Field Value
System.Windows.DependencyProperty

IconTemplateProperty

Identifies the IconTemplate dependency property.

Declaration
public static readonly DependencyProperty IconTemplateProperty
Field Value
System.Windows.DependencyProperty

IsRestrictedProperty

Identifies the IsRestricted Property.

Declaration
public static readonly DependencyProperty IsRestrictedProperty
Field Value
System.Windows.DependencyProperty

IsRestrictedWhenMaximizedProperty

Identifies the IsRestrictedWhenMaximized Property.

Declaration
public static readonly DependencyProperty IsRestrictedWhenMaximizedProperty
Field Value
System.Windows.DependencyProperty

ModalBackgroundProperty

Identifies the ModalBackground dependency property.

Declaration
public static readonly DependencyProperty ModalBackgroundProperty
Field Value
System.Windows.DependencyProperty

PromptResultProperty

Identifies the PromptResult dependency property.

Declaration
public static readonly DependencyProperty PromptResultProperty
Field Value
System.Windows.DependencyProperty

ResponseButtonProperty

Identifies the ResponseButton Property.

Declaration
public static readonly DependencyProperty ResponseButtonProperty
Field Value
System.Windows.DependencyProperty

RestoreMinimizedLocationProperty

Identifies the RestoreMinimizedLocation Property.

Declaration
public static readonly DependencyProperty RestoreMinimizedLocationProperty
Field Value
System.Windows.DependencyProperty

RestrictedAreaMarginProperty

Identifies the RestrictedAreaMargin Property.

Declaration
public static readonly DependencyProperty RestrictedAreaMarginProperty
Field Value
System.Windows.DependencyProperty

ShouldUpdateActiveStateProperty

Identifies the ShouldUpdateActiveState Property.

Declaration
public static readonly DependencyProperty ShouldUpdateActiveStateProperty
Field Value
System.Windows.DependencyProperty

WindowStartupLocationProperty

Identifies the WindowStartupLocation dependency property.

Declaration
public static readonly DependencyProperty WindowStartupLocationProperty
Field Value
System.Windows.DependencyProperty

Properties

BorderBackground

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

Declaration
public Brush BorderBackground { get; set; }
Property Value
System.Windows.Media.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
public static double DefaultSizeRatio { get; }
Property Value
System.Double

DialogResult

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

Declaration
public bool? DialogResult { get; set; }
Property Value
System.Nullable<System.Boolean>

Icon

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

Declaration
public object Icon { get; set; }
Property Value
System.Object

IconMargin

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

Declaration
public Thickness IconMargin { get; set; }
Property Value
System.Windows.Thickness

IconTemplate

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

Declaration
public DataTemplate IconTemplate { get; set; }
Property Value
System.Windows.DataTemplate

IsRestricted

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

Declaration
public bool IsRestricted { get; set; }
Property Value
System.Boolean

True if this instance is restricted; otherwise, false.

IsRestrictedWhenMaximized

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

Declaration
public bool IsRestrictedWhenMaximized { get; set; }
Property Value
System.Boolean

ModalBackground

Gets or sets a brush for the modal background of RadWindow. This is a dependency property.

Declaration
public Brush ModalBackground { get; set; }
Property Value
System.Windows.Media.Brush

PromptResult

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

Declaration
public string PromptResult { get; set; }
Property Value
System.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
public bool RestoreMinimizedLocation { get; set; }
Property Value
System.Boolean

RestrictedAreaMargin

Gets or sets the restricted area margin.

Declaration
public Thickness RestrictedAreaMargin { get; set; }
Property Value
System.Windows.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
public bool ShouldUpdateActiveState { get; set; }
Property Value
System.Boolean

WindowStartupLocation

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

Declaration
public WindowStartupLocation WindowStartupLocation { get; set; }
Property Value
System.Windows.WindowStartupLocation

Methods

Alert(Object)

Opens an Alert modal window.

Declaration
public static void Alert(object content)
Parameters
System.Object content

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
public static void Alert(object content, EventHandler<WindowClosedEventArgs> closed)
Parameters
System.Object content

The content to be displayed.

System.EventHandler<WindowClosedEventArgs> closed

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.

Alert(DialogParameters)

Opens an Alert modal window.

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

ChangeVisualState(Boolean)

Updates the visual state of the control.

Declaration
protected override void ChangeVisualState(bool useTransitions)
Parameters
System.Boolean useTransitions

Indicates whether transitions should be used.

Overrides
WindowBase.ChangeVisualState(Boolean)

ConfigureModal(RadAlert, DialogParameters)

Declaration
public static void ConfigureModal(RadAlert content, DialogParameters dialogParams)
Parameters
RadAlert content

DialogParameters dialogParams

Confirm(Object, EventHandler<WindowClosedEventArgs>)

Opens a Confirm modal window.

Declaration
public static void Confirm(object content, EventHandler<WindowClosedEventArgs> closed)
Parameters
System.Object content

The content to be displayed.

System.EventHandler<WindowClosedEventArgs> closed

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.

Confirm(DialogParameters)

Opens a Confirm modal window.

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

GetParentRadWindow(DependencyObject)

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

Declaration
public static RadWindow GetParentRadWindow(DependencyObject child)
Parameters
System.Windows.DependencyObject child

The object which parent is searched.

Returns
RadWindow

GetResponseButton(DependencyObject)

Gets the response button.

Declaration
public static ResponseButton GetResponseButton(DependencyObject button)
Parameters
System.Windows.DependencyObject button

The button.

Returns
ResponseButton

GetWindowOwner()

Declaration
protected override ContentControl GetWindowOwner()
Returns
System.Windows.Controls.ContentControl

Overrides
WindowBase.GetWindowOwner()

GetWindowStartupLocation()

Declaration
protected override WindowStartupLocation GetWindowStartupLocation()
Returns
System.Windows.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 System.Windows.Controls.Control.ApplyTemplate.

Declaration
public override void OnApplyTemplate()

OnClosed()

Declaration
protected override void OnClosed()
Overrides
WindowBase.OnClosed()

OnClosed(WindowClosedEventArgs)

Raises the Closed event.

Declaration
protected virtual void OnClosed(WindowClosedEventArgs args)
Parameters
WindowClosedEventArgs args

The WindowClosedEventArgs instance containing the event data.

OnClosing()

Declaration
protected override bool OnClosing()
Returns
System.Boolean

Overrides
WindowBase.OnClosing()

OnCreateAutomationPeer()

Create the automation peer for this class.

Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
System.Windows.Automation.Peers.AutomationPeer

Overrides
WindowBase.OnCreateAutomationPeer()

OnGotFocus(RoutedEventArgs)

Called before the System.Windows.UIElement.GotFocus event occurs.

Declaration
protected override void OnGotFocus(RoutedEventArgs e)
Parameters
System.Windows.RoutedEventArgs e

The data for the event.

OnHostCreated(HostWindowCreatedEventArgs)

Raises the HostCreated event.

Declaration
protected override void OnHostCreated(HostWindowCreatedEventArgs args)
Parameters
HostWindowCreatedEventArgs args

The HostWindowCreatedEventArgs instance containing the event data.

Overrides
WindowBase.OnHostCreated(HostWindowCreatedEventArgs)

OnInitialized(EventArgs)

Raises the System.Windows.FrameworkElement.Initialized event and sets System.Windows.FrameworkElement.DefaultStyleKey from the active theme.

Declaration
protected override void OnInitialized(EventArgs e)
Parameters
System.EventArgs e

The System.Windows.RoutedEventArgs that contains the event data.

OnKeyDown(KeyEventArgs)

Called before the System.Windows.UIElement.KeyDown event occurs.

Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
System.Windows.Input.KeyEventArgs e

The data for the event.

OnLostFocus(RoutedEventArgs)

Called before the System.Windows.UIElement.LostFocus event occurs.

Declaration
protected override void OnLostFocus(RoutedEventArgs e)
Parameters
System.Windows.RoutedEventArgs e

The data for the event.

OnPreviewClosed()

Declaration
protected virtual bool OnPreviewClosed()
Returns
System.Boolean

OnPreviewClosed(WindowPreviewClosedEventArgs)

Raises the PreviewClose event.

Declaration
protected virtual void OnPreviewClosed(WindowPreviewClosedEventArgs args)
Parameters
WindowPreviewClosedEventArgs args

The WindowPreviewClosedEventArgs instance containing the event data.

OnWindowStateChanged(EventArgs)

Raises the WindowStateChanged event.

Declaration
protected override void OnWindowStateChanged(EventArgs args)
Parameters
System.EventArgs args

The System.Windows.RoutedEventArgs instance containing the event data.

Overrides
WindowBase.OnWindowStateChanged(EventArgs)

Prompt(Object, EventHandler<WindowClosedEventArgs>)

Opens a Prompt modal window.

Declaration
public static void Prompt(object content, EventHandler<WindowClosedEventArgs> closed)
Parameters
System.Object content

Question to the user.

System.EventHandler<WindowClosedEventArgs> closed

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
public static void Prompt(object content, EventHandler<WindowClosedEventArgs> closed, string defaultPromptResult)
Parameters
System.Object content

Question to the user.

System.EventHandler<WindowClosedEventArgs> closed

Represents the method that will handle the closed event.

System.String defaultPromptResult

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.

Prompt(DialogParameters)

Opens a Prompt modal window.

Declaration
public static void Prompt(DialogParameters dialogParameters)
Parameters
DialogParameters dialogParameters

Structure that holds all possible parameters for customizing dialog window.

ResetTheme()

Resets the theme.

Declaration
public void ResetTheme()

SetResponseButton(DependencyObject, ResponseButton)

Sets the response button.

Declaration
public static void SetResponseButton(DependencyObject button, ResponseButton value)
Parameters
System.Windows.DependencyObject button

The button.

ResponseButton value

The ResponseButton value.

ShouldFocusOnActivate()

Declaration
protected override bool ShouldFocusOnActivate()
Returns
System.Boolean

Overrides
WindowBase.ShouldFocusOnActivate()

Show()

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

Declaration
public void Show()
Examples
RadWindow window = new RadWindow();
window.Height = 100;
window.Width = 100;
window.Header = "RadWindow";
window.Content = "This is your content";
window.Show();
Dim window As RadWindow = New RadWindow
window.Height = 100
window.Width = 100
window.Header = "RadWindow"
window.Content = "This is your content"
window.Show()

ShowDialog()

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

Declaration
public bool? ShowDialog()
Returns
System.Nullable<System.Boolean>

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

Examples
RadWindow window = new RadWindow();
window.Height = 100;
window.Width = 100;
window.Header = "RadWindow";
window.Content = "This is your content";
window.ShowDialog();
Dim window As RadWindow = New RadWindow
window.Height = 100
window.Width = 100
window.Header = "RadWindow"
window.Content = "This is your content"
window.ShowDialog()

Events

Closed

Occurs when the RadWindow is closed.

Declaration
[SRCategory("Behavior")]
public event EventHandler<WindowClosedEventArgs> Closed
Event Type
System.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" System.Windows.Window instance is created.

Declaration
[SRCategory("Behavior")]
public event EventHandler<HostWindowCreatedEventArgs> HostCreated
Event Type
System.EventHandler<HostWindowCreatedEventArgs>

PreviewClosed

Occurs when the RadWindow is closing.

Declaration
[SRCategory("Behavior")]
public event EventHandler<WindowPreviewClosedEventArgs> PreviewClosed
Event Type
System.EventHandler<WindowPreviewClosedEventArgs>

Remarks

The event is raised whenever the Close method is invoked.

Extension Methods

CollectionExtensions.ToEnumerable<T>(T)
EnumerableExtensions.ToEnumerable<T>(T)

Was this article helpful?

Tell us how we can improve this article

Skip
Getting Started
  • Install Now
  • Demos
  • SDK Samples Browser
  • Sample Applications
Support Resources
  • Code Library
  • Knowledge Base
  • MVVM Support
  • Videos
  • GitHub SDK Repository
Community
  • Forums
  • Blogs
  • XAML Feedback Portal
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.