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:
[TelerikToolboxCategory("Containers")]
public class RadWindow : WindowBase, INotifyLayoutChange, IDragAware
Inheritance: objectWindowBaseRadWindow
Derived Classes:
Implements:
Inherited Members
Constructors
Initializes a new instance of the RadWindow class.
public RadWindow()
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
public static readonly DependencyProperty BorderBackgroundProperty
DialogResultProperty
DependencyProperty
Identifies the
public static readonly DependencyProperty DialogResultProperty
IconMarginProperty
DependencyProperty
Identifies the
public static readonly DependencyProperty IconMarginProperty
IconProperty
DependencyProperty
Identifies the
public static readonly DependencyProperty IconProperty
IconTemplateProperty
DependencyProperty
Identifies the
public static readonly DependencyProperty IconTemplateProperty
IsRestrictedProperty
DependencyProperty
Identifies the
public static readonly DependencyProperty IsRestrictedProperty
IsRestrictedWhenMaximizedProperty
DependencyProperty
Identifies the
public static readonly DependencyProperty IsRestrictedWhenMaximizedProperty
PromptResultProperty
DependencyProperty
Identifies the
public static readonly DependencyProperty PromptResultProperty
ResponseButtonProperty
DependencyProperty
Identifies the
public static readonly DependencyProperty ResponseButtonProperty
RestoreMinimizedLocationProperty
DependencyProperty
Identifies the
public static readonly DependencyProperty RestoreMinimizedLocationProperty
RestrictedAreaMarginProperty
DependencyProperty
Identifies the
public static readonly DependencyProperty RestrictedAreaMarginProperty
ShouldUpdateActiveStateProperty
DependencyProperty
Identifies the
public static readonly DependencyProperty ShouldUpdateActiveStateProperty
WindowStartupLocationProperty
DependencyProperty
Identifies the
public static readonly DependencyProperty WindowStartupLocationProperty
Properties
BorderBackground
Brush
Gets or sets a brush to be used to draw the title of RadWindow. This is a dependency property.
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.
public static double DefaultSizeRatio { get; }
Gets or sets a DialogResult value for the RadWindow. This is a dependency property.
public bool? DialogResult { get; set; }
Gets or sets the Icon image to appear in the RadWindow title bar. This is a dependency property.
public object Icon { get; set; }
IconMargin
Thickness
Gets or sets the margin of the icon of
public Thickness IconMargin { get; set; }
IconTemplate
DataTemplate
Gets or sets the IconTemplate property. This is a dependency property.
public DataTemplate IconTemplate { get; set; }
Gets or sets a value indicating whether this instance is restricted.
public bool IsRestricted { get; set; }
True if this instance is restricted; otherwise, false.
Gets or sets whether when maximized the window to be restricted.
public bool IsRestrictedWhenMaximized { get; set; }
Gets or sets a PromptResult value for the RadWindow. This is a dependency property.
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.
public bool RestoreMinimizedLocation { get; set; }
RestrictedAreaMargin
Thickness
Gets or sets the restricted area margin.
public Thickness RestrictedAreaMargin { get; set; }
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.
public bool ShouldUpdateActiveState { get; set; }
WindowStartupLocation
WindowStartupLocation
Gets or sets a WindowStartupLocation value for the RadWindow. This is a dependency property.
public WindowStartupLocation WindowStartupLocation { get; set; }
Methods
Opens an Alert modal window.
public static void Alert(DialogParameters dialogParameters)
Structure that holds all possible parameters for customizing dialog window.
Use this method to populate Alert message that informs the user for a specific problem or warning.
Opens an Alert modal window.
public static void Alert(object content, EventHandler<WindowClosedEventArgs> closed)
The content to be displayed.
closedEventHandler<WindowClosedEventArgs>Represents the method that will handle the closed event.
Use this method to populate Alert message that informs the user for a specific problem or warning.
Opens an Alert modal window.
public static void Alert(object content)
The content to be displayed.
Use this method to populate Alert message that informs the user for a specific problem or warning.
Updates the visual state of the control.
protected override void ChangeVisualState(bool useTransitions)
Indicates whether transitions should be used.
Overrides:
Configures a modal window with the specified alert and dialog parameters.
public static void ConfigureModal(RadAlert content, DialogParameters dialogParams)
The RadAlert instance to be displayed as the modal window.
dialogParamsDialogParametersThe parameters that define the dialog's behavior and appearance.
Opens a Confirm modal window.
public static void Confirm(DialogParameters dialogParameters)
Structure that holds all possible parameters for customizing dialog window.
Use this method to populate Confirm message that request the user to confirm some actions.
Opens a Confirm modal window.
public static void Confirm(object content, EventHandler<WindowClosedEventArgs> closed)
The content to be displayed.
closedEventHandler<WindowClosedEventArgs>Represents the method that will handle the closed event.
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.
public static RadWindow GetParentRadWindow(DependencyObject child)
The object which parent is searched.
Returns:Gets the response button.
public static ResponseButton GetResponseButton(DependencyObject button)
The button.
Returns:GetWindowOwner()
ContentControl
Gets the owner of the RadWindow.
protected override ContentControl GetWindowOwner()
ContentControl
Overrides:
GetWindowStartupLocation()
WindowStartupLocation
Gets the WindowStartupLocation value for the RadWindow.
protected override WindowStartupLocation GetWindowStartupLocation()
WindowStartupLocation
Overrides:
When overridden in a derived class, is invoked whenever application code or internal processes (such as a rebuilding layout pass) call .
public override void OnApplyTemplate()
Called when the window is closed.
protected override void OnClosed()
Overrides:
Raises the event.
protected virtual void OnClosed(WindowClosedEventArgs args)
The WindowClosedEventArgs instance containing the event data.
Raises the event and checks whether the closing should be canceled.
OnCreateAutomationPeer()
AutomationPeer
Create the automation peer for this class.
protected override AutomationPeer OnCreateAutomationPeer()
AutomationPeer
Overrides:
Called before the event occurs.
protected override void OnGotFocus(RoutedEventArgs e)
The data for the event.
Raises the event.
protected override void OnHostCreated(HostWindowCreatedEventArgs args)
The HostWindowCreatedEventArgs instance containing the event data.
Overrides:
Raises the event and sets from the active theme.
protected override void OnInitialized(EventArgs e)
The RoutedEventArgs that contains the event data.
Called before the event occurs.
protected override void OnKeyDown(KeyEventArgs e)
The data for the event.
Called before the event occurs.
protected override void OnLostFocus(RoutedEventArgs e)
The data for the event.
Raises the event and checks whether the closing should be canceled.
Raises the event.
protected virtual void OnPreviewClosed(WindowPreviewClosedEventArgs args)
The WindowPreviewClosedEventArgs instance containing the event data.
Raises the event.
protected override void OnWindowStateChanged(EventArgs args)
The RoutedEventArgs instance containing the event data.
Overrides:
Opens a Prompt modal window.
public static void Prompt(DialogParameters dialogParameters)
Structure that holds all possible parameters for customizing dialog window.
Opens a Prompt modal window.
public static void Prompt(object content, EventHandler<WindowClosedEventArgs> closed, string defaultPromptResult)
Question to the user.
closedEventHandler<WindowClosedEventArgs>Represents the method that will handle the closed event.
defaultPromptResultstringThe default prompt result value that will appear in the textbox.
Use this method to populate Prompt message that requires the user to enter specific value.
Opens a Prompt modal window.
public static void Prompt(object content, EventHandler<WindowClosedEventArgs> closed)
Question to the user.
closedEventHandler<WindowClosedEventArgs>Represents the method that will handle the closed event.
Use this method to populate Prompt message that requires the user to enter specific value.
Resets the theme.
public void ResetTheme()
Sets the response button.
public static void SetResponseButton(DependencyObject button, ResponseButton value)
The button.
valueResponseButtonThe ResponseButton value.
Determines whether the control should focus when it is activated.
Opens RadWindow in case it hasn't been already opened.
public void Show()
Opens modal RadWindow in case it hasn't been already opened.
public bool? ShowDialog()
bool?
A System.Nullable value of type System.Boolean that determines how the dialog was closed.
Events
Occurs when the RadWindow is closed.
[SRCategory("Behavior")]
public event EventHandler<WindowClosedEventArgs> Closed
The event is raised right next after the
Occurs when the "Host" Window instance is created.
[SRCategory("Behavior")]
public event EventHandler<HostWindowCreatedEventArgs> HostCreated
Occurs when the RadWindow is closing.
[SRCategory("Behavior")]
public event EventHandler<WindowPreviewClosedEventArgs> PreviewClosed
The event is raised whenever the