Export (0) Print
Expand All

ChildWindow.Show Method

Silverlight

Opens a ChildWindow and returns without waiting for the ChildWindow to close.

Namespace:  System.Windows.Controls
Assembly:  System.Windows.Controls (in System.Windows.Controls.dll)

public void Show()

ExceptionCondition
InvalidOperationException

The child window is already in the visual tree.

When the ChildWindow class is instantiated, it is not visible by default. The Show method displays the child window and returns immediately, without waiting for the child window to close. This lets activity on the parent window, such as an animation, continue while the child window is open. However, the parent window is disabled as long as the child window is open, so that user interaction with the parent window is not possible.

When the child window is opened, if there are elements that have their IsTabStop property set to true, the element with the lowest TabIndex will get focus. However, if there are no elements that have their IsTabStop property set to true, no focus is set.

To detect when a child window is shown, you can override the OnOpened method.

The following code demonstrates how to instantiate a ChildWindow, set its content, and then show it. This example is part of a larger example available in the ChildWindow class overview.


ChildWindow cw = new ChildWindow();
cw.Content = "Please enter name and password or click Cancel.";
cw.Show();


Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2014 Microsoft