In This Article

UserPromptWindow Class

Defines a Window which can host a UserPromptControl.

public class UserPromptWindow : Window
Inheritance:
object Visual UIElement FrameworkElement Control ContentControl Window object

Properties

DefaultTitle

Gets or sets the default value to be used for Title when an explicit title is not defined.

[Obsolete("Use 'UserPromptBuilder.FallbackTitle' instead.  This method will be removed in a future release.")]
public static string? DefaultTitle { get; set; }

Property Value

string

Remarks

When set to null, a default title will be derived from the kind of icon, if any, displayed on the prompt (e.g. Error or Warning).

Methods

OnActivated(EventArgs)

Raises the Activated event.

protected override void OnActivated(EventArgs e)
Parameter Type Description
e EventArgs

An EventArgs that contains the event data.

OnClosed(EventArgs)

Raises the Closed event.

protected override void OnClosed(EventArgs e)
Parameter Type Description
e EventArgs

An EventArgs that contains the event data.

OnCreateAutomationPeer()

Creates and returns a WindowAutomationPeer object for this Window.

protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer:

A WindowAutomationPeer object for this Window.

ShowDialog(UserPromptControl)

Shows a user prompt as a modal dialog with a default title and owner window.

public static UserPromptStandardResult ShowDialog(UserPromptControl userPromptControl)
Parameter Type Description
userPromptControl UserPromptControl

The control which defines the prompt to be displayed.

Returns

UserPromptStandardResult:

One of the UserPromptStandardResult values indicating the user's response to the prompt.

ShowDialog(UserPromptControl, string?)

Shows a user prompt as a modal dialog with a default owner window.

public static UserPromptStandardResult ShowDialog(UserPromptControl userPromptControl, string? title)
Parameter Type Description
userPromptControl UserPromptControl

The control which defines the prompt to be displayed.

title string

The title of the window. When null, a default title may be assigned.

Returns

UserPromptStandardResult:

One of the UserPromptStandardResult values indicating the user's response to the prompt.

ShowDialog(UserPromptControl, string?, Window?)

Shows a user prompt as a modal dialog.

public static UserPromptStandardResult ShowDialog(UserPromptControl userPromptControl, string? title, Window? owner)
Parameter Type Description
userPromptControl UserPromptControl

The control which defines the prompt to be displayed.

title string

The title of the window. When null, a default title may be assigned.

owner Window

The window which is the owner of the dialog. When null, a default owner will be assigned.

Returns

UserPromptStandardResult:

One of the UserPromptStandardResult values indicating the user's response to the prompt.

ShowDialog(UserPromptControl, string?, Window?, Action<UserPromptWindow>?)

Shows a user prompt as a modal dialog.

public static UserPromptStandardResult ShowDialog(UserPromptControl userPromptControl, string? title, Window? owner, Action<UserPromptWindow>? initializeAction)
Parameter Type Description
userPromptControl UserPromptControl

The control which defines the prompt to be displayed.

title string

The title of the window. When null, a default title may be assigned.

owner Window

The window which is the owner of the dialog. When null, a default owner will be assigned.

initializeAction Action<UserPromptWindow>

An optional action which will be called to initialize the UserPromptWindow before it is displayed.

Returns

UserPromptStandardResult:

One of the UserPromptStandardResult values indicating the user's response to the prompt.