ClassRadWindow
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:
[TelerikToolboxCategory("Containers")]
public class RadWindow : WindowBase, INotifyLayoutChange, IDragAware
Inheritance: objectWindowBaseRadWindow
Derived Classes:
Implements:
Inherited Members
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.
Fields
BorderBackgroundProperty
Identifies the
Declaration
public static readonly DependencyProperty BorderBackgroundProperty
Field Value
DependencyProperty
DialogResultProperty
Identifies the
Declaration
public static readonly DependencyProperty DialogResultProperty
Field Value
DependencyProperty
IconMarginProperty
Identifies the
Declaration
public static readonly DependencyProperty IconMarginProperty
Field Value
DependencyProperty
IconProperty
Identifies the
Declaration
public static readonly DependencyProperty IconProperty
Field Value
DependencyProperty
IconTemplateProperty
Identifies the
Declaration
public static readonly DependencyProperty IconTemplateProperty
Field Value
DependencyProperty
IsRestrictedProperty
Identifies the
Declaration
public static readonly DependencyProperty IsRestrictedProperty
Field Value
DependencyProperty
IsRestrictedWhenMaximizedProperty
Identifies the
Declaration
public static readonly DependencyProperty IsRestrictedWhenMaximizedProperty
Field Value
DependencyProperty
PromptResultProperty
Identifies the
Declaration
public static readonly DependencyProperty PromptResultProperty
Field Value
DependencyProperty
ResponseButtonProperty
Identifies the
Declaration
public static readonly DependencyProperty ResponseButtonProperty
Field Value
DependencyProperty
RestoreMinimizedLocationProperty
Identifies the
Declaration
public static readonly DependencyProperty RestoreMinimizedLocationProperty
Field Value
DependencyProperty
RestrictedAreaMarginProperty
Identifies the
Declaration
public static readonly DependencyProperty RestrictedAreaMarginProperty
Field Value
DependencyProperty
ShouldUpdateActiveStateProperty
Identifies the
Declaration
public static readonly DependencyProperty ShouldUpdateActiveStateProperty
Field Value
DependencyProperty
WindowStartupLocationProperty
Identifies the
Declaration
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
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.
DialogResult
Gets or sets a DialogResult value for the RadWindow. This is a dependency property.
Icon
Gets or sets the Icon image to appear in the RadWindow title bar. This is a dependency property.
IconMargin
Gets or sets the margin of the icon of
Declaration
public Thickness IconMargin { get; set; }
Property Value
Thickness
IconTemplate
Gets or sets the IconTemplate property. This is a dependency property.
Declaration
public DataTemplate IconTemplate { get; set; }
Property Value
DataTemplate
IsRestricted
Gets or sets a value indicating whether this instance is restricted.
Declaration
public bool IsRestricted { get; set; }
Property Value
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
PromptResult
Gets or sets a PromptResult value for the RadWindow. This is a dependency property.
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
RestrictedAreaMargin
Gets or sets the restricted area margin.
Declaration
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.
WindowStartupLocation
Gets or sets a WindowStartupLocation value for the RadWindow. This is a dependency property.
Declaration
public WindowStartupLocation WindowStartupLocation { get; set; }
Property Value
WindowStartupLocation
Methods
Alert(DialogParameters)
Opens an Alert modal window.
Declaration
public static void Alert(DialogParameters dialogParameters)
Parameters
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
public static void Alert(object content)
Parameters
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
content
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
protected override void ChangeVisualState(bool useTransitions)
Parameters
useTransitions
Indicates whether transitions should be used.
Overrides
ConfigureModal(RadAlert, DialogParameters)
Configures a modal window with the specified alert and dialog parameters.
Declaration
public static void ConfigureModal(RadAlert content, DialogParameters dialogParams)
Parameters
content
The RadAlert instance to be displayed as the modal window.
dialogParams
The parameters that define the dialog's behavior and appearance.
Confirm(DialogParameters)
Opens a Confirm modal window.
Declaration
public static void Confirm(DialogParameters dialogParameters)
Parameters
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
public static void Confirm(object content, EventHandler<WindowClosedEventArgs> closed)
Parameters
content
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
public static RadWindow GetParentRadWindow(DependencyObject child)
Parameters
child
DependencyObject
The object which parent is searched.
Returns
GetResponseButton(DependencyObject)
Gets the response button.
Declaration
public static ResponseButton GetResponseButton(DependencyObject button)
Parameters
button
DependencyObject
The button.
Returns
GetWindowOwner()
Gets the owner of the RadWindow.
Declaration
protected override ContentControl GetWindowOwner()
Returns
ContentControl
Overrides
GetWindowStartupLocation()
Gets the WindowStartupLocation value for the RadWindow.
Declaration
protected override WindowStartupLocation GetWindowStartupLocation()
Returns
WindowStartupLocation
Overrides
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes (such as a rebuilding layout pass) call .
Declaration
public override void OnApplyTemplate()
OnClosed()
Called when the window is closed.
Declaration
protected override void OnClosed()
Overrides
OnClosed(WindowClosedEventArgs)
Raises the event.
Declaration
protected virtual void OnClosed(WindowClosedEventArgs args)
Parameters
args
The WindowClosedEventArgs instance containing the event data.
OnClosing()
Raises the event and checks whether the closing should be canceled.
OnCreateAutomationPeer()
Create the automation peer for this class.
Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
AutomationPeer
Overrides
OnGotFocus(RoutedEventArgs)
Called before the event occurs.
Declaration
protected override void OnGotFocus(RoutedEventArgs e)
Parameters
e
RoutedEventArgs
The data for the event.
OnHostCreated(HostWindowCreatedEventArgs)
Raises the event.
Declaration
protected override void OnHostCreated(HostWindowCreatedEventArgs args)
Parameters
args
The HostWindowCreatedEventArgs instance containing the event data.
Overrides
OnInitialized(EventArgs)
Raises the event and sets from the active theme.
Declaration
protected override void OnInitialized(EventArgs e)
Parameters
e
The RoutedEventArgs that contains the event data.
OnKeyDown(KeyEventArgs)
Called before the event occurs.
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
e
KeyEventArgs
The data for the event.
OnLostFocus(RoutedEventArgs)
Called before the event occurs.
Declaration
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.
OnPreviewClosed(WindowPreviewClosedEventArgs)
Raises the event.
Declaration
protected virtual void OnPreviewClosed(WindowPreviewClosedEventArgs args)
Parameters
args
The WindowPreviewClosedEventArgs instance containing the event data.
OnWindowStateChanged(EventArgs)
Raises the event.
Declaration
protected override void OnWindowStateChanged(EventArgs args)
Parameters
args
The RoutedEventArgs instance containing the event data.
Overrides
Prompt(DialogParameters)
Opens a Prompt modal window.
Declaration
public static void Prompt(DialogParameters dialogParameters)
Parameters
dialogParameters
Structure that holds all possible parameters for customizing dialog window.
Prompt(object, EventHandler<WindowClosedEventArgs>)
Opens a Prompt modal window.
Declaration
public static void Prompt(object content, EventHandler<WindowClosedEventArgs> closed)
Parameters
content
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
public static void Prompt(object content, EventHandler<WindowClosedEventArgs> closed, string defaultPromptResult)
Parameters
content
Question to the user.
closed
EventHandler<WindowClosedEventArgs>
Represents the method that will handle the closed event.
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.
SetResponseButton(DependencyObject, ResponseButton)
Sets the response button.
Declaration
public static void SetResponseButton(DependencyObject button, ResponseButton value)
Parameters
button
DependencyObject
The button.
value
The ResponseButton value.
ShouldFocusOnActivate()
Determines whether the control should focus when it is activated.
Declaration
protected override bool ShouldFocusOnActivate()
Returns
Overrides
Show()
Opens RadWindow in case it hasn't been already opened.
Declaration
public void Show()
ShowDialog()
Opens modal RadWindow in case it hasn't been already opened.
Declaration
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
[SRCategory("Behavior")]
public event EventHandler<WindowClosedEventArgs> Closed
Event Value
Remarks
The event is raised right next after the
HostCreated
Occurs when the "Host" Window instance is created.
Declaration
[SRCategory("Behavior")]
public event EventHandler<HostWindowCreatedEventArgs> HostCreated
Event Value
PreviewClosed
Occurs when the RadWindow is closing.
Declaration
[SRCategory("Behavior")]
public event EventHandler<WindowPreviewClosedEventArgs> PreviewClosed
Event Value
Remarks
The event is raised whenever the