In This Article

UserPromptBuilder Class

Defines a builder for configuring and showing user prompts using a UserPromptControl.

public sealed class UserPromptBuilder
Inheritance:
object object

Properties

ActualDisplayMode

The actual mode used for displaying the user prompt, which is populated just before the user prompt is shown.

public UserPromptDisplayMode? ActualDisplayMode { get; }

Property Value

UserPromptDisplayMode?:

Either Dialog or Overlay.

Remarks

When DialogPreferred is requested, this property will indicate the actual display mode used.

See Also

AutoSize

When true, the size of the UserPromptControl will be automatically set based on its message content. When null, the size with be automatically set only when string-based content is defined.

public bool? AutoSize { get; }

Property Value

bool?

Remarks

The default value is null.

See Also

AutoSizeMinimumWidth

When AutoSize is true, defines the preferred width of the UserPromptControl.

public double AutoSizeMinimumWidth { get; }

Property Value

double

Remarks

The default value is 500.

See Also

ButtonItemsClipboardText

The value to be assigned to the ButtonItemsClipboardText property of the UserPromptControl created by the builder.

public string? ButtonItemsClipboardText { get; }

Property Value

string

ButtonItemsHorizontalAlignment

The value to be assigned to the ButtonItemsHorizontalAlignment property of the UserPromptControl created by the builder.

public HorizontalAlignment? ButtonItemsHorizontalAlignment { get; }

Property Value

HorizontalAlignment?

ButtonTheme

The value to be assigned to ButtonTheme.

public ControlTheme? ButtonTheme { get; }

Property Value

ControlTheme

CheckBoxContentClipboardText

The value to be assigned to the CheckBoxContentClipboardText property of the UserPromptControl created by the builder.

public string? CheckBoxContentClipboardText { get; }

Property Value

string

CheckBoxContentTemplate

The value to be assigned to the CheckBoxContentTemplate property of the UserPromptControl created by the builder.

public IDataTemplate? CheckBoxContentTemplate { get; }

Property Value

IDataTemplate

CloseResult

The value to be assigned to the CloseResult property of the UserPromptControl created by the builder.

public MessageBoxResult? CloseResult { get; }

Property Value

MessageBoxResult?

ContentClipboardText

The value to be assigned to the ContentClipboardText property of the UserPromptControl created by the builder.

public string? ContentClipboardText { get; }

Property Value

string

DefaultButtonClasses

The value to be assigned to DefaultButtonClasses.

public string? DefaultButtonClasses { get; }

Property Value

string

DefaultDisplayMode

The default display mode to be used when showing user prompts.

public static UserPromptDisplayMode DefaultDisplayMode { get; set; }

Property Value

UserPromptDisplayMode

See Also

DefaultOverlayTitleMode

The default value to be used for overlay title mode when an explicit options is not defined.

public static UserPromptOverlayTitleMode DefaultOverlayTitleMode { get; set; }

Property Value

UserPromptOverlayTitleMode:

The property is initialized to ShowWhenNoHeader.

See Also

DefaultResult

The value to be assigned to the DefaultResult property of the UserPromptControl created by the builder.

public MessageBoxResult? DefaultResult { get; }

Property Value

MessageBoxResult?

ExpandedInformationCollapsedHeaderText

The value to be assigned to the ExpandedInformationCollapsedHeaderText property of the UserPromptControl created by the builder.

public string? ExpandedInformationCollapsedHeaderText { get; }

Property Value

string

ExpandedInformationContentClipboardText

The value to be assigned to the ExpandedInformationContentClipboardText property of the UserPromptControl created by the builder.

public string? ExpandedInformationContentClipboardText { get; }

Property Value

string

ExpandedInformationContentTemplate

The value to be assigned to the ExpandedInformationContentTemplate property of the UserPromptControl created by the builder.

public IDataTemplate? ExpandedInformationContentTemplate { get; }

Property Value

IDataTemplate

ExpandedInformationExpandedHeaderText

The value to be assigned to the ExpandedInformationExpandedHeaderText property of the UserPromptControl created by the builder.

public string? ExpandedInformationExpandedHeaderText { get; }

Property Value

string

FallbackTitle

The value to be used for user prompt titles (e.g., Avalonia.Controls.Window.Title when displayed as a dialog) when an explicit title is not defined and one cannot be inferred.

public static string? FallbackTitle { get; set; }

Property Value

string

See Also

FooterClipboardText

The value to be assigned to the FooterClipboardText property of the UserPromptControl created by the builder.

public string? FooterClipboardText { get; }

Property Value

string

FooterIcon

The value to be assigned to the FooterIcon property of the UserPromptControl created by the builder.

public object? FooterIcon { get; }

Property Value

object

FooterIconTemplate

The value to be assigned to the FooterIconTemplate property of the UserPromptControl created by the builder.

public IDataTemplate? FooterIconTemplate { get; }

Property Value

IDataTemplate

FooterImage

The value to be assigned to the FooterImageSource property of the UserPromptControl created by the builder.

[Obsolete("Use 'FooterIcon' instead.")]
[Browsable(false)]
public IImage? FooterImage { get; }

Property Value

IImage

FooterTemplate

The value to be assigned to the FooterTemplate property of the UserPromptControl created by the builder.

public IDataTemplate? FooterTemplate { get; }

Property Value

IDataTemplate

HeaderBackground

The value to be assigned to the HeaderBackground property of the UserPromptControl created by the builder.

public IBrush? HeaderBackground { get; }

Property Value

IBrush

HeaderBorderBrush

The value to be assigned to the HeaderBorderBrush property of the UserPromptControl created by the builder.

public IBrush? HeaderBorderBrush { get; }

Property Value

IBrush

HeaderBorderThickness

The value to be assigned to the HeaderBorderThickness property of the UserPromptControl created by the builder.

public Thickness? HeaderBorderThickness { get; }

Property Value

Thickness?

HeaderClipboardText

The value to be assigned to the HeaderClipboardText property of the UserPromptControl created by the builder.

public string? HeaderClipboardText { get; }

Property Value

string

HeaderFontSize

The value to be assigned to the HeaderFontSize property of the UserPromptControl created by the builder.

public double? HeaderFontSize { get; }

Property Value

double?

HeaderForeground

The value to be assigned to the HeaderForeground property of the UserPromptControl created by the builder.

public IBrush? HeaderForeground { get; }

Property Value

IBrush

HeaderTemplate

The value to be assigned to the HeaderTemplate property of the UserPromptControl created by the builder.

public IDataTemplate? HeaderTemplate { get; }

Property Value

IDataTemplate

HelpCommand

The value to be assigned to the HelpCommand property of the UserPromptControl created by the builder.

public ICommand? HelpCommand { get; }

Property Value

ICommand

HelpCommandParameter

The value to be assigned to the HelpCommandParameter property of the UserPromptControl created by the builder.

public object? HelpCommandParameter { get; }

Property Value

object

HorizontalContentAlignment

The value to be assigned to the HorizontalContentAlignment> property of the UserPromptControl created by the builder.

public HorizontalAlignment? HorizontalContentAlignment { get; }

Property Value

HorizontalAlignment?

HorizontalScrollBarVisibility

The value to be assigned to the HorizontalScrollBarVisibility property of the UserPromptControl created by the builder.

public ScrollBarVisibility? HorizontalScrollBarVisibility { get; }

Property Value

ScrollBarVisibility?

Instance

The UserPromptControl instance that is being configured.

public UserPromptControl? Instance { get; }

Property Value

UserPromptControl

Remarks

This property is not populated until ActiproSoftware.UI.Avalonia.Controls.UserPromptBuilder.Build is initiated by the Show() or BuildWithoutShowing() methods.

IsChecked

The value to be assigned to the IsChecked property of the UserPromptControl created by the builder.

public bool? IsChecked { get; }

Property Value

bool?

IsExpanded

The value to be assigned to the IsExpanded property of the UserPromptControl created by the builder.

public bool? IsExpanded { get; }

Property Value

bool?

OverlayTitleMode

The title mode to be used when displayed as an overlay.

public UserPromptOverlayTitleMode? OverlayTitleMode { get; }

Property Value

UserPromptOverlayTitleMode?

See Also

Owner

The owner to be used when showing the prompt.

public TopLevel? Owner { get; }

Property Value

TopLevel

RequestedDisplayMode

The requested mode used for displaying the user prompt.

public UserPromptDisplayMode? RequestedDisplayMode { get; }

Property Value

UserPromptDisplayMode?

See Also

StandardButtons

The value to be assigned to the StandardButtons property of the UserPromptControl created by the builder.

public MessageBoxButtons? StandardButtons { get; }

Property Value

MessageBoxButtons?

StandardStatusIcon

The value to be assigned to the StandardStatusIcon property of the UserPromptControl created by the builder.

public MessageBoxImage? StandardStatusIcon { get; }

Property Value

MessageBoxImage?

StandardStatusImage

The value to be assigned to the StandardStatusImage property of the UserPromptControl created by the builder.

[Obsolete("Use 'StandardStatusIcon' instead.")]
[Browsable(false)]
public MessageBoxImage? StandardStatusImage { get; }

Property Value

MessageBoxImage?

StatusIcon

The value to be assigned to the StatusIcon property of the UserPromptControl created by the builder.

public object? StatusIcon { get; }

Property Value

object

StatusIconTemplate

The value to be assigned to the StatusIconTemplate property of the UserPromptControl created by the builder.

public IDataTemplate? StatusIconTemplate { get; }

Property Value

IDataTemplate

StatusImage

The value to be assigned to the StatusImageSource property of the UserPromptControl created by the builder.

[Obsolete("Use 'StatusIcon' instead.")]
[Browsable(false)]
public IImage? StatusImage { get; }

Property Value

IImage

Tag

An arbitrary object value that can be used to store custom information.

public object? Tag { get; }

Property Value

object

Title

The value to be assigned as the title for a window or overlay displaying the prompt.

public string? Title { get; }

Property Value

string

See Also

VerticalContentAlignment

The value to be assigned to the VerticalContentAlignment> property of the UserPromptControl created by the builder.

public VerticalAlignment? VerticalContentAlignment { get; }

Property Value

VerticalAlignment?

VerticalScrollBarVisibility

The value to be assigned to the VerticalScrollBarVisibility property of the UserPromptControl created by the builder.

public ScrollBarVisibility? VerticalScrollBarVisibility { get; }

Property Value

ScrollBarVisibility?

WindowStartupLocation

The value to be assigned to UserPromptWindow.WindowStartupLocation.

public WindowStartupLocation? WindowStartupLocation { get; }

Property Value

WindowStartupLocation?:

One of the Avalonia.Controls.WindowStartupLocation values. When null, user prompts that fit within the bounds of their owner window will center on their owner and, when too large, will center on the owner's screen instead.

Remarks

This option does not apply when using Overlay.

Methods

AfterBuild(Action<UserPromptBuilder>?)

Registers a delegate to be called after the build is complete.

public UserPromptBuilder AfterBuild(Action<UserPromptBuilder>? callback)
Parameter Type Description
callback Action<UserPromptBuilder>

The callback, which will be invoked after any already registered callbacks are invoked.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

AfterInitialize(Action<UserPromptBuilder>?)

Registers a delegate to be called after the Instance is created, but before the build starts.

public UserPromptBuilder AfterInitialize(Action<UserPromptBuilder>? callback)
Parameter Type Description
callback Action<UserPromptBuilder>

The callback, which will be invoked after any already registered callbacks are invoked.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

AfterInitializeWindow(Action<UserPromptWindow>?)

Registers a delegate to be called after a UserPromptWindow is initialized that will host the UserPromptControl when it is shown as a dialog.

public UserPromptBuilder AfterInitializeWindow(Action<UserPromptWindow>? callback)
Parameter Type Description
callback Action<UserPromptWindow>

The callback, which will be invoked after any already registered callbacks are invoked.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

AfterShow(Action<UserPromptBuilder, MessageBoxResult>?)

Registers a delegate to be called after the prompt is shown and a response is indicated.

public UserPromptBuilder AfterShow(Action<UserPromptBuilder, MessageBoxResult>? callback)
Parameter Type Description
callback Action<UserPromptBuilder, MessageBoxResult>

The callback, which will be invoked after any already registered callbacks are invoked.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

BeforeShow(Action<UserPromptBuilder>?)

Registers a delegate to be called before the prompt is shown.

public UserPromptBuilder BeforeShow(Action<UserPromptBuilder>? callback)
Parameter Type Description
callback Action<UserPromptBuilder>

The callback, which will be invoked after any already registered callbacks are invoked.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

BuildWithoutShowing()

Creates and configures a UserPromptControl based on the current builder configuration.

public UserPromptControl BuildWithoutShowing()

Returns

UserPromptControl:

The UserPromptControl created by this builder.

Exceptions

Type Condition
InvalidOperationException

Thrown if an instance of UserPromptControl has already been built.

Configure()

Initializes a new instance of UserPromptBuilder.

public static UserPromptBuilder Configure()

Returns

UserPromptBuilder:

A new instance of UserPromptBuilder.

OnResponding(Action<UserPromptBuilder, UserPromptResponseEventArgs>?)

Registers a delegate to be called when a user is responding to a prompt.

public UserPromptBuilder OnResponding(Action<UserPromptBuilder, UserPromptResponseEventArgs>? callback)
Parameter Type Description
callback Action<UserPromptBuilder, UserPromptResponseEventArgs>

The callback, which will be invoked after any already registered callbacks are invoked.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

RegisterGlobalConfigureCallback(Action<UserPromptBuilder>?)

Registers a global delegate to be called to configure a new instance of UserPromptBuilder.

public static void RegisterGlobalConfigureCallback(Action<UserPromptBuilder>? callback)
Parameter Type Description
callback Action<UserPromptBuilder>

The callback, which will be invoked immediately after the instance is created and before any instance-specific configuration can be applied.

Show()

Creates and configures a UserPromptControl based on the current builder configuration. The prompt is then shown to the user to await a response.

public Task<MessageBoxResult> Show()

Returns

Task<MessageBoxResult>:

The MessageBoxResult indicated by the user.

Exceptions

Type Condition
InvalidOperationException

Thrown if an instance of UserPromptControl has already been built.

PlatformNotSupportedException

Thrown if Dialog is used on an unsupported platform.

WithAutoSize(bool?, double?)

Sets the AutoSize and AutoSizeMinimumWidth property values.

public UserPromptBuilder WithAutoSize(bool? autoSize, double? minimumWidth = null)
Parameter Type Description
autoSize bool?

The value to assign to AutoSize.

minimumWidth double?

The value to assign to AutoSizeMinimumWidth, if any.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithButton(MessageBoxResult, ICommand?, object?, string?, Action<UserPromptButtonBuilder>?)

Adds an explicit button configuration.

public UserPromptBuilder WithButton(MessageBoxResult result, ICommand? command = null, object? commandParameter = null, string? label = null, Action<UserPromptButtonBuilder>? afterInitialize = null)
Parameter Type Description
result MessageBoxResult

The result associated with the button.

command ICommand

An optional command associated with the button.

commandParameter object

An optional command parameter associated with the button.

label string

An optional label to use as content for the button; otherwise the content is coerced from the result.

afterInitialize Action<UserPromptButtonBuilder>

An optional delegate to be called after the UserPromptButtonBuilder initializes the Avalonia.Controls.Button instance.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

Exceptions

Type Condition
ArgumentNullException

WithButton(UserPromptButtonBuilder)

Adds an explicit button configuration.

public UserPromptBuilder WithButton(UserPromptButtonBuilder buttonBuilder)
Parameter Type Description
buttonBuilder UserPromptButtonBuilder

A UserPromptButtonBuilder that will build the button.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

Exceptions

Type Condition
ArgumentNullException

WithButton(Action<UserPromptButtonBuilder>)

Adds an explicit button configuration.

public UserPromptBuilder WithButton(Action<UserPromptButtonBuilder> configure)
Parameter Type Description
configure Action<UserPromptButtonBuilder>

A delegate to configure a UserPromptButtonBuilder for the button.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

Exceptions

Type Condition
ArgumentNullException

WithButtonItemsClipboardText(string?)

Sets the ButtonItemsClipboardText property value.

public UserPromptBuilder WithButtonItemsClipboardText(string? text)
Parameter Type Description
text string

The value to set.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithButtonItemsHorizontalAlignment(HorizontalAlignment?)

Sets the ButtonItemsHorizontalAlignment property value.

public UserPromptBuilder WithButtonItemsHorizontalAlignment(HorizontalAlignment? alignment)
Parameter Type Description
alignment HorizontalAlignment?

The value to set.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithButtonTheme(ControlTheme?)

Sets the ButtonTheme property value.

public UserPromptBuilder WithButtonTheme(ControlTheme? buttonTheme)
Parameter Type Description
buttonTheme ControlTheme

The value to set.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithCheckBox(object?, bool)

Configures the checkbox.

public UserPromptBuilder WithCheckBox(object? content, bool isChecked = false)
Parameter Type Description
content object

The checkbox content.

isChecked bool

The initial value of the IsChecked property.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

WithCheckBoxContent(Func<UserPromptControl, object?>?)

Sets the checkbox content.

public UserPromptBuilder WithCheckBoxContent(Func<UserPromptControl, object?>? contentFactory)
Parameter Type Description
contentFactory Func<UserPromptControl, object>

A factory method which returns the content and is passed an instance of the current Instance.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithCheckBoxContent(Func<object?>?)

Sets the checkbox content.

public UserPromptBuilder WithCheckBoxContent(Func<object?>? contentFactory)
Parameter Type Description
contentFactory Func<object>

A factory method which returns the content.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithCheckBoxContent(object?)

Sets the checkbox content.

public UserPromptBuilder WithCheckBoxContent(object? content)
Parameter Type Description
content object

The content.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithCheckBoxContentClipboardText(string?)

Sets the CheckBoxContentClipboardText property value.

public UserPromptBuilder WithCheckBoxContentClipboardText(string? text)
Parameter Type Description
text string

The text.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithCheckBoxContentTemplate(IDataTemplate?)

Sets the CheckBoxContentTemplate property value.

public UserPromptBuilder WithCheckBoxContentTemplate(IDataTemplate? contentTemplate)
Parameter Type Description
contentTemplate IDataTemplate

The template.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithCloseResult(MessageBoxResult?)

Sets the CloseResult property value.

public UserPromptBuilder WithCloseResult(MessageBoxResult? result)
Parameter Type Description
result MessageBoxResult?

The result to be associated with the close button.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithContent(Func<UserPromptControl, object?>?)

Sets the primary message content.

public UserPromptBuilder WithContent(Func<UserPromptControl, object?>? contentFactory)
Parameter Type Description
contentFactory Func<UserPromptControl, object>

A factory method which returns the content and is passed an instance of the current Instance.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

WithContent(Func<object?>?)

Sets the primary message content.

public UserPromptBuilder WithContent(Func<object?>? contentFactory)
Parameter Type Description
contentFactory Func<object>

A factory method which returns the content.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

WithContent(object?)

Sets the primary message content.

public UserPromptBuilder WithContent(object? content)
Parameter Type Description
content object

The content.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

WithContentClipboardText(string?)

Sets the ContentClipboardText property value.

public UserPromptBuilder WithContentClipboardText(string? text)
Parameter Type Description
text string

The value.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithDefaultButtonClasses(string?)

Sets the DefaultButtonClasses property value.

public UserPromptBuilder WithDefaultButtonClasses(string? classes)
Parameter Type Description
classes string

The space-delimited list of classes.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithDefaultResult(MessageBoxResult?)

Sets the DefaultResult property value.

public UserPromptBuilder WithDefaultResult(MessageBoxResult? result)
Parameter Type Description
result MessageBoxResult?

The result.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithDisplayMode(UserPromptDisplayMode?)

Sets the requested mode to be used for displaying the user prompt.

public UserPromptBuilder WithDisplayMode(UserPromptDisplayMode? displayMode)
Parameter Type Description
displayMode UserPromptDisplayMode?

The requested mode to use.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

Remarks

Before the prompt is shown, the ActualDisplayMode property will indicate the actual display mode that was used.

WithExpandedInformation(string?, string?, object?)

Sets the ExpandedInformationCollapsedHeaderText and ExpandedInformationExpandedHeaderText property values and the content shown when expanded.

public UserPromptBuilder WithExpandedInformation(string? collapsedHeaderText, string? expandedHeaderText, object? expandedContent)
Parameter Type Description
collapsedHeaderText string

The header text when collapsed.

expandedHeaderText string

The header text when expanded.

expandedContent object

The content shown when expanded.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

WithExpandedInformationContent(Func<UserPromptControl, object?>?)

Sets the expanded information content.

public UserPromptBuilder WithExpandedInformationContent(Func<UserPromptControl, object?>? contentFactory)
Parameter Type Description
contentFactory Func<UserPromptControl, object>

A factory method which returns the content and is passed an instance of the current Instance.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithExpandedInformationContent(Func<object?>?)

Sets the expanded information content.

public UserPromptBuilder WithExpandedInformationContent(Func<object?>? contentFactory)
Parameter Type Description
contentFactory Func<object>

A factory method which returns the content.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithExpandedInformationContent(object?)

Sets the expanded information content.

public UserPromptBuilder WithExpandedInformationContent(object? content)
Parameter Type Description
content object

The content.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithExpandedInformationContentClipboardText(string?)

Sets the ExpandedInformationContentClipboardText property value.

public UserPromptBuilder WithExpandedInformationContentClipboardText(string? text)
Parameter Type Description
text string

The text.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithExpandedInformationContentTemplate(IDataTemplate?)

Sets the ExpandedInformationContentTemplate property value.

public UserPromptBuilder WithExpandedInformationContentTemplate(IDataTemplate? contentTemplate)
Parameter Type Description
contentTemplate IDataTemplate

The template.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithExpandedInformationHeaderText(string?)

Sets the ExpandedInformationCollapsedHeaderText and ExpandedInformationExpandedHeaderText property values to the same value.

public UserPromptBuilder WithExpandedInformationHeaderText(string? headerText)
Parameter Type Description
headerText string

The header text when collapsed or expanded.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithExpandedInformationHeaderText(string?, string?)

public UserPromptBuilder WithExpandedInformationHeaderText(string? collapsedHeaderText, string? expandedHeaderText)
Parameter Type Description
collapsedHeaderText string

The header text when collapsed.

expandedHeaderText string

The header text when expanded.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithFooterClipboardText(string?)

Sets the FooterClipboardText property value.

public UserPromptBuilder WithFooterClipboardText(string? text)
Parameter Type Description
text string

The value.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithFooterContent(Func<UserPromptControl, object?>?)

Sets the footer content.

public UserPromptBuilder WithFooterContent(Func<UserPromptControl, object?>? contentFactory)
Parameter Type Description
contentFactory Func<UserPromptControl, object>

A factory method which returns the content and is passed an instance of the current Instance.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithFooterContent(Func<object?>?)

Sets the footer content.

public UserPromptBuilder WithFooterContent(Func<object?>? contentFactory)
Parameter Type Description
contentFactory Func<object>

A factory method which returns the content.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithFooterContent(object?)

Sets the footer content.

public UserPromptBuilder WithFooterContent(object? content)
Parameter Type Description
content object

The content.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithFooterIcon(object?, IDataTemplate?)

Sets the FooterIcon and FooterIconTemplate property values.

public UserPromptBuilder WithFooterIcon(object? icon, IDataTemplate? template = null)
Parameter Type Description
icon object

The icon.

template IDataTemplate

The template.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithFooterImage(IImage?)

Sets the FooterImage property value.

[Obsolete("Use 'WithFooterIcon' instead.")]
[Browsable(false)]
public UserPromptBuilder WithFooterImage(IImage? image)
Parameter Type Description
image IImage

The value.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithFooterTemplate(IDataTemplate?)

Sets the FooterTemplate property value.

public UserPromptBuilder WithFooterTemplate(IDataTemplate? contentTemplate)
Parameter Type Description
contentTemplate IDataTemplate

The template.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithHeaderBackground(IBrush?)

Sets the HeaderBackground property value.

public UserPromptBuilder WithHeaderBackground(IBrush? brush)
Parameter Type Description
brush IBrush

The value.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithHeaderBackground(Color?)

Sets the HeaderBackground property value to a Avalonia.Media.SolidColorBrush of the given color.

public UserPromptBuilder WithHeaderBackground(Color? color)
Parameter Type Description
color Color?

The color.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithHeaderBorderBrush(IBrush?)

Sets the HeaderBorderBrush property value.

public UserPromptBuilder WithHeaderBorderBrush(IBrush? brush)
Parameter Type Description
brush IBrush

The value.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithHeaderBorderBrush(Color?)

Sets the HeaderBorderBrush property value to a Avalonia.Media.SolidColorBrush of the given color.

public UserPromptBuilder WithHeaderBorderBrush(Color? color)
Parameter Type Description
color Color?

The color.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithHeaderBorderThickness(Thickness?)

Sets the HeaderBorderThickness property value.

public UserPromptBuilder WithHeaderBorderThickness(Thickness? thickness)
Parameter Type Description
thickness Thickness?

The value.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithHeaderClipboardText(string?)

Sets the HeaderClipboardText property value.

public UserPromptBuilder WithHeaderClipboardText(string? text)
Parameter Type Description
text string

The value.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithHeaderContent(Func<UserPromptControl, object?>?)

Sets the header content.

public UserPromptBuilder WithHeaderContent(Func<UserPromptControl, object?>? contentFactory)
Parameter Type Description
contentFactory Func<UserPromptControl, object>

A factory method which returns the content and is passed an instance of the current Instance.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

WithHeaderContent(Func<object?>?)

Sets the content content.

public UserPromptBuilder WithHeaderContent(Func<object?>? contentFactory)
Parameter Type Description
contentFactory Func<object>

A factory method which returns the content.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

WithHeaderContent(object?)

Sets the header content.

public UserPromptBuilder WithHeaderContent(object? content)
Parameter Type Description
content object

The content.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

WithHeaderFontSize(double?)

Sets the HeaderFontSize property value.

public UserPromptBuilder WithHeaderFontSize(double? fontSize)
Parameter Type Description
fontSize double?

The value.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithHeaderForeground(IBrush?)

Sets the HeaderForeground property value.

public UserPromptBuilder WithHeaderForeground(IBrush? brush)
Parameter Type Description
brush IBrush

The value.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithHeaderForeground(Color?)

Sets the HeaderForeground property value to a Avalonia.Media.SolidColorBrush of the given color.

public UserPromptBuilder WithHeaderForeground(Color? color)
Parameter Type Description
color Color?

The color.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithHeaderTemplate(IDataTemplate?)

Sets the HeaderTemplate property value.

public UserPromptBuilder WithHeaderTemplate(IDataTemplate? contentTemplate)
Parameter Type Description
contentTemplate IDataTemplate

The value.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithHelpCommand(Action?)

Configures the HelpCommand property to perform the given action.

public UserPromptBuilder WithHelpCommand(Action? helpAction)
Parameter Type Description
helpAction Action

The help action.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithHelpCommand(ICommand?, object?)

Sets the HelpCommand and HelpCommandParameter property values.

public UserPromptBuilder WithHelpCommand(ICommand? helpCommand, object? helpCommandParameter = null)
Parameter Type Description
helpCommand ICommand

The help command.

helpCommandParameter object

The parameter, if any, to pass to the help command.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithHorizontalContentAlignment(HorizontalAlignment?)

Sets the HorizontalContentAlignment property values.

public UserPromptBuilder WithHorizontalContentAlignment(HorizontalAlignment? alignment)
Parameter Type Description
alignment HorizontalAlignment?

The horizontal alignment.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithIsChecked(Func<bool>, Action<bool>)

Synchronizes the initial and final values of the IsChecked property.

public UserPromptBuilder WithIsChecked(Func<bool> getter, Action<bool> setter)
Parameter Type Description
getter Func<bool>

The delegate which returns the initial value to assign to the IsChecked property.

setter Action<bool>

The delegate which is called with the final static of the IsChecked property.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

Exceptions

Type Condition
ArgumentNullException

WithIsChecked(bool?)

Sets the IsChecked property value.

public UserPromptBuilder WithIsChecked(bool? isChecked)
Parameter Type Description
isChecked bool?

The value.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithIsExpanded(bool?)

Sets the IsExpanded property value.

public UserPromptBuilder WithIsExpanded(bool? isExpanded)
Parameter Type Description
isExpanded bool?

The value.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithOverlayTitleMode(UserPromptOverlayTitleMode?)

Sets the OverlayTitleMode property value.

public UserPromptBuilder WithOverlayTitleMode(UserPromptOverlayTitleMode? overlayTitleMode)
Parameter Type Description
overlayTitleMode UserPromptOverlayTitleMode?

The value.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

WithOwner(TopLevel?)

Sets the Owner property value.

public UserPromptBuilder WithOwner(TopLevel? owner)
Parameter Type Description
owner TopLevel

The value.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithScrollBarVisibility(ScrollBarVisibility?)

public UserPromptBuilder WithScrollBarVisibility(ScrollBarVisibility? visibility)
Parameter Type Description
visibility ScrollBarVisibility?

The horizontal and vertical visibility.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithScrollBarVisibility(ScrollBarVisibility?, ScrollBarVisibility?)

public UserPromptBuilder WithScrollBarVisibility(ScrollBarVisibility? horizontal, ScrollBarVisibility? vertical)
Parameter Type Description
horizontal ScrollBarVisibility?

The horizontal visibility.

vertical ScrollBarVisibility?

The vertical visibility.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithStandardButtons(MessageBoxButtons?)

Sets the StandardButtons property value.

public UserPromptBuilder WithStandardButtons(MessageBoxButtons? standardButtons)
Parameter Type Description
standardButtons MessageBoxButtons?

The value.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithStatusIcon(MessageBoxImage?)

Sets the StandardStatusIcon property value.

public UserPromptBuilder WithStatusIcon(MessageBoxImage? icon)
Parameter Type Description
icon MessageBoxImage?

The standard icon.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithStatusIcon(object?, IDataTemplate?)

Sets the StatusIcon and StatusIconTemplate property values.

public UserPromptBuilder WithStatusIcon(object? icon, IDataTemplate? template = null)
Parameter Type Description
icon object

The icon.

template IDataTemplate

The template.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithStatusImage(IImage?)

Sets the StatusImage property value.

[Obsolete("Use 'WithStatusIcon' instead.")]
[Browsable(false)]
public UserPromptBuilder WithStatusImage(IImage? image)
Parameter Type Description
image IImage

The image.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithStatusImage(MessageBoxImage?)

Sets the StandardStatusImage property value.

[Obsolete("Use 'WithStatusIcon' instead.")]
[Browsable(false)]
public UserPromptBuilder WithStatusImage(MessageBoxImage? image)
Parameter Type Description
image MessageBoxImage?

The standard image.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithTag(object?)

Sets the Tag property value.

public UserPromptBuilder WithTag(object? tag)
Parameter Type Description
tag object

The value to set.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithTitle(string?)

Sets the Title property value.

public UserPromptBuilder WithTitle(string? title)
Parameter Type Description
title string

The value to set.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithVerticalContentAlignment(VerticalAlignment?)

Sets the VerticalContentAlignment property values.

public UserPromptBuilder WithVerticalContentAlignment(VerticalAlignment? alignment)
Parameter Type Description
alignment VerticalAlignment?

The horizontal alignment.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

See Also

WithWindowStartupLocation(WindowStartupLocation?)

Sets the WindowStartupLocation property value.

public UserPromptBuilder WithWindowStartupLocation(WindowStartupLocation? startupLocation)
Parameter Type Description
startupLocation WindowStartupLocation?

The value to set. When null, user prompts that fit within the bounds of their owner window will center on their owner and, when too large, will center on the owner's screen instead.

Returns

UserPromptBuilder:

This builder instance, which can be used for method chaining.

Remarks

This option does not apply when using Overlay.

Inherited Members

Extension Methods