Class ChildWindow
Provides a window that can be displayed over a parent window and blocks interaction with the parent window.
Inheritance
Inherited Members
Namespace: System.Windows.Controls
Assembly: OpenSilver.dll
Syntax
public class ChildWindow : ContentControl
Constructors
| Improve this Doc View SourceChildWindow()
Initializes a new instance of the ChildWindow class.
Declaration
public ChildWindow()
Fields
| Improve this Doc View SourceHasCloseButtonProperty
Identifies the HasCloseButton dependency property.
Declaration
public static readonly DependencyProperty HasCloseButtonProperty
Field Value
Type | Description |
---|---|
DependencyProperty | The identifier for the HasCloseButton dependency property. |
IsModalProperty
Idetifies the ChildWindow.IsModal dependency property.
Declaration
public static readonly DependencyProperty IsModalProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
OverlayBrushProperty
Identifies the OverlayBrush dependency property.
Declaration
public static readonly DependencyProperty OverlayBrushProperty
Field Value
Type | Description |
---|---|
DependencyProperty | The identifier for the OverlayBrush dependency property. |
OverlayOpacityProperty
Identifies the OverlayOpacity dependency property.
Declaration
public static readonly DependencyProperty OverlayOpacityProperty
Field Value
Type | Description |
---|---|
DependencyProperty | The identifier for the OverlayOpacity dependency property. |
TitleProperty
Identifies the ChildWindow.Title" /> dependency property.
Declaration
public static readonly DependencyProperty TitleProperty
Field Value
Type | Description |
---|---|
DependencyProperty | The identifier for the ChildWindow dependency property. |
Properties
| Improve this Doc View SourceDialogResult
Gets or sets a value indicating whether the ChildWindow was accepted or canceled.
Declaration
public bool? DialogResult { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Boolean> | True if the child window was accepted; false if the child window was canceled. The default is null. |
HasCloseButton
Gets or sets a value indicating whether the ChildWindow has a close button.
Declaration
public bool HasCloseButton { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if the child window has a close button; otherwise, false. The default is true. |
IsModal
Gets or sets a value indicating whether the ChildWindow is modal.
Declaration
public bool IsModal { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
OverlayBrush
Gets or sets the visual brush that is used to cover the parent window when the child window is open.
Declaration
public Brush OverlayBrush { get; set; }
Property Value
Type | Description |
---|---|
Brush | The visual brush that is used to cover the parent window when the ChildWindow is open. The default is null. |
OverlayOpacity
Gets or sets the opacity of the overlay brush that is used to cover the parent window when the child window is open.
Declaration
public double OverlayOpacity { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The opacity of the overlay brush that is used to cover the parent window when the ChildWindow is open. The default is 1.0. |
Title
Gets or sets the title that is displayed in the frame of the ChildWindow.
Declaration
public object Title { get; set; }
Property Value
Type | Description |
---|---|
System.Object | The title displayed at the top of the window. The default is null. |
Methods
| Improve this Doc View SourceClose()
Closes a ChildWindow.
Declaration
public void Close()
OnApplyTemplate()
Builds the visual tree for the ChildWindow control when a new template is applied.
Declaration
public override void OnApplyTemplate()
Overrides
| Improve this Doc View SourceOnClosed(EventArgs)
Raises the ChildWindow.Closed event.
Declaration
protected virtual void OnClosed(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | The event data. |
OnClosing(CancelEventArgs)
Raises the ChildWindow.Closing event.
Declaration
protected virtual void OnClosing(CancelEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.ComponentModel.CancelEventArgs | e | The event data. |
OnOpened()
This method is called every time a ChildWindow is displayed.
Declaration
protected virtual void OnOpened()
Show()
Opens a ChildWindow and returns without waiting for the ChildWindow to close.
Declaration
public void Show()
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The child window is already in the visual tree. |
ShowAndWait()
Opens a ChildWindow and waits for the ChildWindow to close.
Declaration
public Task ShowAndWait()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The child window is already in the visual tree. |
Events
| Improve this Doc View SourceClosed
Occurs when the ChildWindow is closed.
Declaration
public event EventHandler Closed
Event Type
Type | Description |
---|---|
System.EventHandler |
Closing
Occurs when the ChildWindow is closing.
Declaration
public event EventHandler<CancelEventArgs> Closing
Event Type
Type | Description |
---|---|
System.EventHandler<System.ComponentModel.CancelEventArgs> |