Show / Hide Table of Contents

Class ChildWindow

Provides a window that can be displayed over a parent window and blocks interaction with the parent window.

Inheritance
System.Object
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
ChildWindow
Inherited Members
ContentControl.Content
ContentControl.ContentProperty
ContentControl.ContentTemplate
ContentControl.ContentTemplateProperty
ContentControl.OnContentChanged(Object, Object)
ContentControl.LogicalChildren
Control.EnableBaseControlHandlingOfVisualStates
Control.ManageIsEnabled(Boolean)
Control.Background
Control.BackgroundProperty
Control.BorderBrush
Control.BorderBrushProperty
Control.BorderThickness
Control.BorderThicknessProperty
Control.FontWeight
Control.FontWeightProperty
Control.FontStyle
Control.FontStyleProperty
Control.Foreground
Control.ForegroundProperty
Control.FontFamily
Control.FontFamilyProperty
Control.FontSize
Control.FontSizeProperty
Control.TextDecorations
Control.TextDecorationsProperty
Control.Padding
Control.PaddingProperty
Control.HorizontalContentAlignment
Control.HorizontalContentAlignmentProperty
Control.VerticalContentAlignment
Control.VerticalContentAlignmentProperty
Control.TabIndex
Control.TabIndexProperty
Control.IsTabStop
Control.IsTabStopProperty
Control.TabNavigation
Control.TabNavigationProperty
Control.Template
Control.TemplateProperty
Control.ApplyTemplate()
Control.GetTemplateChild(String)
Control.Focus()
Control.HandlesScrolling
Control.OnGotFocus(RoutedEventArgs)
Control.OnLostFocus(RoutedEventArgs)
Control.CreateDomElement(Object, Object)
Control.CharacterSpacingProperty
Control.CharacterSpacing
Control.FontStretchProperty
Control.FontStretch
Control.OnDrop(DragEventArgs)
Control.OnDragEnter(DragEventArgs)
Control.OnDragLeave(DragEventArgs)
Control.OnTextInputUpdate(TextCompositionEventArgs)
Control.MeasureOverride(Size)
Control.ArrangeOverride(Size)
FrameworkElement.LayoutUpdated
FrameworkElement.SizeChanged
FrameworkElement.ResourceLookupMode
FrameworkElement.StyleProperty
FrameworkElement.Style
FrameworkElement.DefaultStyleKeyProperty
FrameworkElement.DefaultStyleKey
FrameworkElement.OverridesDefaultStyleProperty
FrameworkElement.OverridesDefaultStyle
FrameworkElement.OnVisualParentChanged(DependencyObject)
FrameworkElement.VisualChildrenCount
FrameworkElement.GetVisualChild(Int32)
FrameworkElement.Parent
FrameworkElement.AddLogicalChild(Object)
FrameworkElement.RemoveLogicalChild(Object)
FrameworkElement.TemplatedParent
FrameworkElement.Resources
FrameworkElement.IsLoaded
FrameworkElement.SetBinding(DependencyProperty, BindingBase)
FrameworkElement.SetBinding(DependencyProperty, Binding)
FrameworkElement.GetBindingExpression(DependencyProperty)
FrameworkElement.Cursor
FrameworkElement.CursorProperty
FrameworkElement.FindName(String)
FrameworkElement.Name
FrameworkElement.NameProperty
FrameworkElement.DataContext
FrameworkElement.DataContextProperty
FrameworkElement.DataContextChanged
FrameworkElement.Triggers
FrameworkElement.FlowDirectionProperty
FrameworkElement.FlowDirection
FrameworkElement.LanguageProperty
FrameworkElement.Language
FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs)
FrameworkElement.Tag
FrameworkElement.TagProperty
FrameworkElement.LoadedEvent
FrameworkElement.Loaded
FrameworkElement.Unloaded
FrameworkElement.BindingValidationError
FrameworkElement.ContextMenuProperty
FrameworkElement.ContextMenu
FrameworkElement.ContextMenuOpening
FrameworkElement.ToolTipProperty
FrameworkElement.ToolTip
FrameworkElement.INTERNAL_OnDetachedFromVisualTree()
FrameworkElement.INTERNAL_OnAttachedToVisualTree()
FrameworkElement.Height
FrameworkElement.HeightProperty
FrameworkElement.Width
FrameworkElement.WidthProperty
FrameworkElement.HorizontalAlignment
FrameworkElement.HorizontalAlignmentProperty
FrameworkElement.VerticalAlignment
FrameworkElement.VerticalAlignmentProperty
FrameworkElement.Margin
FrameworkElement.MarginProperty
FrameworkElement.MinHeight
FrameworkElement.MinHeightProperty
FrameworkElement.MinWidth
FrameworkElement.MinWidthProperty
FrameworkElement.MaxHeight
FrameworkElement.MaxHeightProperty
FrameworkElement.MaxWidth
FrameworkElement.MaxWidthProperty
FrameworkElement.ActualWidthProperty
FrameworkElement.ActualWidth
FrameworkElement.ActualHeightProperty
FrameworkElement.ActualHeight
UIElement.TransformToVisual(UIElement)
UIElement.RenderSize
UIElement.DesiredSize
UIElement.InvalidateMeasure()
UIElement.InvalidateArrange()
UIElement.Measure(Size)
UIElement.Arrange(Rect)
UIElement.UpdateLayout()
UIElement.DragEnter
UIElement.DragLeave
UIElement.Drop
UIElement.DragOver
UIElement.CacheMode
UIElement.CacheModeProperty
UIElement.Projection
UIElement.ProjectionProperty
UIElement.VisualParent
UIElement.AddVisualChild(UIElement)
UIElement.RemoveVisualChild(UIElement)
UIElement.OnVisualChildrenChanged(DependencyObject, DependencyObject)
UIElement.XamlSourcePath
UIElement.ClipToBounds
UIElement.ClipToBoundsProperty
UIElement.ClipProperty
UIElement.Clip
UIElement.IsEnabledProperty
UIElement.IsEnabled
UIElement.IsEnabledChanged
UIElement.EffectProperty
UIElement.Effect
UIElement.RenderTransformProperty
UIElement.RenderTransform
UIElement.RenderTransformOriginProperty
UIElement.RenderTransformOrigin
UIElement.UseLayoutRounding
UIElement.UseLayoutRoundingProperty
UIElement.Visibility
UIElement.VisibilityProperty
UIElement.IsVisibleProperty
UIElement.IsVisible
UIElement.IsVisibleChanged
UIElement.OpacityProperty
UIElement.Opacity
UIElement.OpacityMaskProperty
UIElement.OpacityMask
UIElement.IsHitTestVisible
UIElement.IsHitTestVisibleProperty
UIElement.AllowDrop
UIElement.AllowDropProperty
UIElement.CaptureMouse()
UIElement.IsMouseCaptured
UIElement.ReleaseMouseCapture()
UIElement.AllowScrollOnTouchMove
UIElement.AllowScrollOnTouchMoveProperty
UIElement.AddHandler(RoutedEvent, Delegate, Boolean)
UIElement.RemoveHandler(RoutedEvent, Delegate)
UIElement.MouseMoveEvent
UIElement.MouseMove
UIElement.OnMouseMove(MouseEventArgs)
UIElement.MouseLeftButtonDownEvent
UIElement.MouseLeftButtonDown
UIElement.OnMouseLeftButtonDown(MouseButtonEventArgs)
UIElement.MouseRightButtonDownEvent
UIElement.MouseRightButtonDown
UIElement.OnMouseRightButtonDown(MouseButtonEventArgs)
UIElement.MouseWheelEvent
UIElement.MouseWheel
UIElement.OnMouseWheel(MouseWheelEventArgs)
UIElement.MouseLeftButtonUpEvent
UIElement.MouseLeftButtonUp
UIElement.OnMouseLeftButtonUp(MouseButtonEventArgs)
UIElement.MouseEnterEvent
UIElement.MouseEnter
UIElement.OnMouseEnter(MouseEventArgs)
UIElement.MouseLeaveEvent
UIElement.MouseLeave
UIElement.OnMouseLeave(MouseEventArgs)
UIElement.TextInputStartEvent
UIElement.TextInputStart
UIElement.OnTextInputStart(TextCompositionEventArgs)
UIElement.TextInputEvent
UIElement.TextInput
UIElement.OnTextInput(TextCompositionEventArgs)
UIElement.TextInputUpdateEvent
UIElement.TextInputUpdate
UIElement.TappedEvent
UIElement.Tapped
UIElement.OnTapped(TappedRoutedEventArgs)
UIElement.MouseRightButtonUpEvent
UIElement.MouseRightButtonUp
UIElement.OnMouseRightButtonUp(MouseButtonEventArgs)
UIElement.KeyDownEvent
UIElement.KeyDown
UIElement.OnKeyDown(KeyEventArgs)
UIElement.KeyUpEvent
UIElement.KeyUp
UIElement.OnKeyUp(KeyEventArgs)
UIElement.GotFocusEvent
UIElement.GotFocus
UIElement.LostFocusEvent
UIElement.LostFocus
UIElement.LostMouseCapture
UIElement.OnLostMouseCapture(MouseEventArgs)
UIElement.INTERNAL_AttachToDomEvents()
UIElement.INTERNAL_DetachFromDomEvents()
DependencyObject.GetValue(DependencyProperty)
DependencyObject.SetCurrentValue(DependencyProperty, Object)
DependencyObject.ReadLocalValue(DependencyProperty)
DependencyObject.SetValue(DependencyProperty, Object)
DependencyObject.SetValue(DependencyPropertyKey, Object)
DependencyObject.CoerceValue(DependencyProperty)
DependencyObject.Dispatcher
DependencyObject.ClearValue(DependencyProperty)
DependencyObject.ClearValue(DependencyPropertyKey)
DependencyObject.CheckAccess()
DependencyObject.GetAnimationBaseValue(DependencyProperty)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: System.Windows.Controls
Assembly: OpenSilver.dll
Syntax
[TemplatePart(Name = "Chrome", Type = typeof(FrameworkElement))]
[TemplatePart(Name = "CloseButton", Type = typeof(ButtonBase))]
[TemplatePart(Name = "ContentPresenter", Type = typeof(FrameworkElement))]
[TemplatePart(Name = "ContentRoot", Type = typeof(FrameworkElement))]
[TemplatePart(Name = "Overlay", Type = typeof(Panel))]
[TemplatePart(Name = "Root", Type = typeof(FrameworkElement))]
public class ChildWindow : ContentControl, IControl, IFrameworkElement, IUIElement, IDependencyObject

Constructors

| Improve this Doc View Source

ChildWindow()

Initializes a new instance of the ChildWindow class.

Declaration
public ChildWindow()

Fields

| Improve this Doc View Source

HasCloseButtonProperty

Identifies the HasCloseButton dependency property.

Declaration
public static readonly DependencyProperty HasCloseButtonProperty
Field Value
Type Description
DependencyProperty

The identifier for the HasCloseButton dependency property.

| Improve this Doc View Source

IsModalProperty

Identifies the IsModal dependency property.

Declaration
public static readonly DependencyProperty IsModalProperty
Field Value
Type Description
DependencyProperty

The identifier for the IsModal dependency property.

| Improve this Doc View Source

OverlayBrushProperty

Identifies the OverlayBrush dependency property.

Declaration
public static readonly DependencyProperty OverlayBrushProperty
Field Value
Type Description
DependencyProperty

The identifier for the OverlayBrush dependency property.

| Improve this Doc View Source

OverlayOpacityProperty

Identifies the OverlayOpacity dependency property.

Declaration
public static readonly DependencyProperty OverlayOpacityProperty
Field Value
Type Description
DependencyProperty

The identifier for the OverlayOpacity dependency property.

| Improve this Doc View Source

TitleProperty

Identifies the Title dependency property.

Declaration
public static readonly DependencyProperty TitleProperty
Field Value
Type Description
DependencyProperty

The identifier for the Title dependency property.

Properties

| Improve this Doc View Source

DialogResult

Gets or sets a value indicating whether the ChildWindow was accepted or canceled.

Declaration
[TypeConverter(typeof(NullableBoolConverter))]
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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

IsModal

Gets or sets a value indicating whether the ChildWindow is modal.

Declaration
public bool IsModal { get; set; }
Property Value
Type Description
System.Boolean
Exceptions
Type Condition
System.InvalidOperationException

The ChildWindow was open when attempting the modify IsModal.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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 Source

Close()

Closes a ChildWindow.

Declaration
public void Close()
| Improve this Doc View Source

OnApplyTemplate()

Builds the visual tree for the ChildWindow control when a new template is applied.

Declaration
public override void OnApplyTemplate()
Overrides
Control.OnApplyTemplate()
| Improve this Doc View Source

OnClosed(EventArgs)

Raises the Closed event.

Declaration
protected virtual void OnClosed(EventArgs e)
Parameters
Type Name Description
System.EventArgs e

The event data.

| Improve this Doc View Source

OnClosing(CancelEventArgs)

Raises the Closing event.

Declaration
protected virtual void OnClosing(CancelEventArgs e)
Parameters
Type Name Description
System.ComponentModel.CancelEventArgs e

The event data.

| Improve this Doc View Source

OnCreateAutomationPeer()

Returns a ChildWindowAutomationPeer for use by the Silverlight automation infrastructure.

Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
Type Description
AutomationPeer

ChildWindowAutomationPeer for the ChildWindow object.

Overrides
UIElement.OnCreateAutomationPeer()
| Improve this Doc View Source

OnOpened()

This method is called every time a ChildWindow is displayed.

Declaration
protected virtual void OnOpened()
| Improve this Doc View Source

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.

| Improve this Doc View Source

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 Source

Closed

Occurs when the ChildWindow is closed.

Declaration
public event EventHandler Closed
Event Type
Type Description
System.EventHandler
| Improve this Doc View Source

Closing

Occurs when the ChildWindow is closing.

Declaration
public event EventHandler<CancelEventArgs> Closing
Event Type
Type Description
System.EventHandler<System.ComponentModel.CancelEventArgs>

Extension Methods

DependencyObjectHelper.GetSelfAndAncestors(DependencyObject)
UIElementExtendedRoutedEventExtensions.AddHandler(UIElement, ExtendedRoutedEvent, Delegate, Boolean)
UIElementExtendedRoutedEventExtensions.RemoveHandler(UIElement, ExtendedRoutedEvent, Delegate)
VisualTreeExtensions.GetVisualAncestors(DependencyObject)
VisualTreeExtensions.GetVisualAncestorsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualChildren(DependencyObject)
VisualTreeExtensions.GetVisualChildrenAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualDescendants(DependencyObject)
VisualTreeExtensions.GetVisualDescendantsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualSiblings(DependencyObject)
VisualTreeExtensions.GetVisualSiblingsAndSelf(DependencyObject)
VisualTreeExtensions.GetBoundsRelativeTo(FrameworkElement, UIElement)
VisualTreeExtensions.InvokeOnLayoutUpdated(FrameworkElement, Action)
  • Improve this Doc
  • View Source