Class ContentDialogBuilder
Represents a builder that can be used to create Fluent UI dialogs.
Namespace: Artemis.UI.Shared.Services.Builders
Assembly: Artemis.UI.Shared.dll
Syntax
public class ContentDialogBuilder
Methods
HavingPrimaryButton(Action<ContentDialogButtonBuilder>)
Changes the primary button of the dialog.
Declaration
public ContentDialogBuilder HavingPrimaryButton(Action<ContentDialogButtonBuilder> configure)
Parameters
Type | Name | Description |
---|---|---|
Action<ContentDialogButtonBuilder> | configure | An action to configure the button. |
Returns
Type | Description |
---|---|
ContentDialogBuilder | The builder that can be used to further build the dialog. |
HavingSecondaryButton(Action<ContentDialogButtonBuilder>)
Changes the secondary button of the dialog.
Declaration
public ContentDialogBuilder HavingSecondaryButton(Action<ContentDialogButtonBuilder> configure)
Parameters
Type | Name | Description |
---|---|---|
Action<ContentDialogButtonBuilder> | configure | An action to configure the button. |
Returns
Type | Description |
---|---|
ContentDialogBuilder | The builder that can be used to further build the dialog. |
ShowAsync()
Asynchronously shows the content dialog.
Declaration
public Task<ContentDialogResult> ShowAsync()
Returns
Type | Description |
---|---|
Task<ContentDialogResult> | A task containing the result of the content dialog. |
Exceptions
Type | Condition |
---|---|
ArtemisSharedUIException | Thrown when the parent window does not contain a panel at its root. |
WithCloseButtonText(string?)
Changes the text of the close button of the dialog.
Declaration
public ContentDialogBuilder WithCloseButtonText(string? text)
Parameters
Type | Name | Description |
---|---|---|
string | text | The new text. |
Returns
Type | Description |
---|---|
ContentDialogBuilder | The builder that can be used to further build the dialog. |
WithContent(string?)
Changes the content of the dialog.
Declaration
public ContentDialogBuilder WithContent(string? content)
Parameters
Type | Name | Description |
---|---|---|
string | content | The new content. |
Returns
Type | Description |
---|---|
ContentDialogBuilder | The builder that can be used to further build the dialog. |
WithDefaultButton(ContentDialogButton)
Changes the default button of the dialog that is pressed on enter.
Declaration
public ContentDialogBuilder WithDefaultButton(ContentDialogButton defaultButton)
Parameters
Type | Name | Description |
---|---|---|
ContentDialogButton | defaultButton | The default button. |
Returns
Type | Description |
---|---|
ContentDialogBuilder | The builder that can be used to further build the dialog. |
WithFullSize()
Changes the dialog to take the full height of the window it's being hosted in.
Declaration
public ContentDialogBuilder WithFullSize()
Returns
Type | Description |
---|---|
ContentDialogBuilder | The builder that can be used to further build the dialog. |
WithTitle(string?)
Changes the title of the dialog.
Declaration
public ContentDialogBuilder WithTitle(string? title)
Parameters
Type | Name | Description |
---|---|---|
string | title | The new title. |
Returns
Type | Description |
---|---|
ContentDialogBuilder | The builder that can be used to further build the dialog. |
WithViewModel<T>(out T, params object[])
Changes the view model of the content dialog, hosting it inside the dialog.
Declaration
public ContentDialogBuilder WithViewModel<T>(out T viewModel, params object[] parameters) where T : ContentDialogViewModelBase
Parameters
Type | Name | Description |
---|---|---|
T | viewModel | The resulting view model. |
object[] | parameters | Optional parameters to pass to the constructor of the view model. |
Returns
Type | Description |
---|---|
ContentDialogBuilder | The builder that can be used to further build the dialog. |
Type Parameters
Name | Description |
---|---|
T | The type of the view model to host. |