Class RadWindow
This class represents an interactive window and provides static methods for showing standard dialog windows - Alert, Confirm and Prompt.
Inherited Members
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
Declaration
public static readonly DependencyProperty BorderBackgroundProperty
Field Value
System.Windows.DependencyProperty
|
DialogResultProperty
Identifies the
Declaration
public static readonly DependencyProperty DialogResultProperty
Field Value
System.Windows.DependencyProperty
|
IconMarginProperty
Identifies the
Declaration
public static readonly DependencyProperty IconMarginProperty
Field Value
System.Windows.DependencyProperty
|
IconProperty
Identifies the
Declaration
public static readonly DependencyProperty IconProperty
Field Value
System.Windows.DependencyProperty
|
IconTemplateProperty
Identifies the
Declaration
public static readonly DependencyProperty IconTemplateProperty
Field Value
System.Windows.DependencyProperty
|
IsRestrictedProperty
Identifies the
Declaration
public static readonly DependencyProperty IsRestrictedProperty
Field Value
System.Windows.DependencyProperty
|
IsRestrictedWhenMaximizedProperty
Identifies the
Declaration
public static readonly DependencyProperty IsRestrictedWhenMaximizedProperty
Field Value
System.Windows.DependencyProperty
|
ModalBackgroundProperty
Identifies the
Declaration
public static readonly DependencyProperty ModalBackgroundProperty
Field Value
System.Windows.DependencyProperty
|
PromptResultProperty
Identifies the
Declaration
public static readonly DependencyProperty PromptResultProperty
Field Value
System.Windows.DependencyProperty
|
ResponseButtonProperty
Identifies the
Declaration
public static readonly DependencyProperty ResponseButtonProperty
Field Value
System.Windows.DependencyProperty
|
RestoreMinimizedLocationProperty
Identifies the
Declaration
public static readonly DependencyProperty RestoreMinimizedLocationProperty
Field Value
System.Windows.DependencyProperty
|
RestrictedAreaMarginProperty
Identifies the
Declaration
public static readonly DependencyProperty RestrictedAreaMarginProperty
Field Value
System.Windows.DependencyProperty
|
ShouldUpdateActiveStateProperty
Identifies the
Declaration
public static readonly DependencyProperty ShouldUpdateActiveStateProperty
Field Value
System.Windows.DependencyProperty
|
WindowStartupLocationProperty
Identifies the
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 Nullable<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
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
|
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
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
GetWindowStartupLocation()
Declaration
protected override WindowStartupLocation GetWindowStartupLocation()
Returns
System.Windows.WindowStartupLocation
|
Overrides
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()
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
OnCreateAutomationPeer()
Create the automation peer for this class.
Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
System.Windows.Automation.Peers.AutomationPeer
|
Overrides
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
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
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
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 Nullable<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
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