Class ContentDialogBuilder
Represents a builder that can be used to create Fluent UI dialogs.
public class ContentDialogBuilder
- Inheritance
-
objectContentDialogBuilder
Methods
HavingPrimaryButton(Action<ContentDialogButtonBuilder>)
Changes the primary button of the dialog.
public ContentDialogBuilder HavingPrimaryButton(Action<ContentDialogButtonBuilder> configure)
Parameters
configureAction<ContentDialogButtonBuilder>An action to configure the button.
Returns
- ContentDialogBuilder
The builder that can be used to further build the dialog.
HavingSecondaryButton(Action<ContentDialogButtonBuilder>)
Changes the secondary button of the dialog.
public ContentDialogBuilder HavingSecondaryButton(Action<ContentDialogButtonBuilder> configure)
Parameters
configureAction<ContentDialogButtonBuilder>An action to configure the button.
Returns
- ContentDialogBuilder
The builder that can be used to further build the dialog.
ShowAsync()
Asynchronously shows the content dialog.
public Task<ContentDialogResult> ShowAsync()
Returns
- Task<ContentDialogResult>
A task containing the result of the content dialog.
Exceptions
- 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.
public ContentDialogBuilder WithCloseButtonText(string? text)
Parameters
textstringThe new text.
Returns
- ContentDialogBuilder
The builder that can be used to further build the dialog.
WithContent(string?)
Changes the content of the dialog.
public ContentDialogBuilder WithContent(string? content)
Parameters
contentstringThe new content.
Returns
- 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.
public ContentDialogBuilder WithDefaultButton(ContentDialogButton defaultButton)
Parameters
defaultButtonContentDialogButtonThe default button.
Returns
- ContentDialogBuilder
The builder that can be used to further build the dialog.
WithFullScreen()
Changes the dialog to be full screen.
public ContentDialogBuilder WithFullScreen()
Returns
- 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.
public ContentDialogBuilder WithFullSize()
Returns
- ContentDialogBuilder
The builder that can be used to further build the dialog.
WithTitle(string?)
Changes the title of the dialog.
public ContentDialogBuilder WithTitle(string? title)
Parameters
titlestringThe new title.
Returns
- 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.
public ContentDialogBuilder WithViewModel<T>(out T viewModel, params object[] parameters) where T : ContentDialogViewModelBase
Parameters
viewModelTThe resulting view model.
parametersobject[]Optional parameters to pass to the constructor of the view model.
Returns
- ContentDialogBuilder
The builder that can be used to further build the dialog.
Type Parameters
TThe type of the view model to host.