ContentDialog
Namespace: FluentAvalonia.UI.Controls
Presents a asynchronous dialog to the user.
C#
public class ContentDialog : ContentControl
Xaml
<ui:ContentDialog />
Required Template Parts
| Name | Control Type |
|---|---|
| PrimaryButton | Button |
| SecondaryButton | Button |
| CloseButton | Button |
Pseudoclasses
:hidden, :open, :primary, :secondary, :close, :fullsize, :disabled, :focus, :focus-visible, :focus-within, :pointerover
Examples and Usage Notes
None yet.
API
Note: Inherited members are not shown
Properties
| CloseButtonCommand | Gets or sets the command to invoke when the close button is tapped. |
| CloseButtonCommandParameter | Gets or sets the parameter to pass to the command for the close button. |
| CloseButtonCommandParameterProperty | Defines the `FluentAvalonia.UI.Controls.ContentDialog.CloseButtonCommandParameter` property |
| CloseButtonCommandProperty | Defines the `FluentAvalonia.UI.Controls.ContentDialog.CloseButtonCommand` property |
| CloseButtonText | Gets or sets the text to display on the close button. |
| CloseButtonTextProperty | Defines the `FluentAvalonia.UI.Controls.ContentDialog.CloseButtonText` property |
| DefaultButton | Gets or sets a value that indicates which button on the dialog is the default action. |
| DefaultButtonProperty | Defines the `FluentAvalonia.UI.Controls.ContentDialog.DefaultButton` property |
| FullSizeDesired | Gets or sets whether the Dialog should show full screen On WinUI3, at least desktop, this just show the dialog at the maximum size of a contentdialog. |
| FullSizeDesiredProperty | Defines the `FluentAvalonia.UI.Controls.ContentDialog.FullSizeDesired` property |
| IsPrimaryButtonEnabled | Gets or sets whether the dialog's primary button is enabled. |
| IsPrimaryButtonEnabledProperty | Defines the `FluentAvalonia.UI.Controls.ContentDialog.IsPrimaryButtonEnabled` property |
| IsSecondaryButtonEnabled | Gets or sets whether the dialog's secondary button is enabled. |
| IsSecondaryButtonEnabledProperty | Defines the `FluentAvalonia.UI.Controls.ContentDialog.IsSecondaryButtonEnabled` property |
| PrimaryButtonCommand | Gets or sets the command to invoke when the primary button is tapped. |
| PrimaryButtonCommandParameter | Gets or sets the parameter to pass to the command for the primary button. |
| PrimaryButtonCommandParameterProperty | Defines the `FluentAvalonia.UI.Controls.ContentDialog.PrimaryButtonCommandParameter` property |
| PrimaryButtonCommandProperty | Defines the `FluentAvalonia.UI.Controls.ContentDialog.PrimaryButtonCommand` property |
| PrimaryButtonText | Gets or sets the text to display on the primary button. |
| PrimaryButtonTextProperty | Defines the `FluentAvalonia.UI.Controls.ContentDialog.PrimaryButtonText` property |
| SecondaryButtonCommand | Gets or sets the command to invoke when the secondary button is tapped. |
| SecondaryButtonCommandParameter | Gets or sets the parameter to pass to the command for the secondary button. |
| SecondaryButtonCommandParameterProperty | Defines the `FluentAvalonia.UI.Controls.ContentDialog.SecondaryButtonCommandParameter` property |
| SecondaryButtonCommandProperty | Defines the `FluentAvalonia.UI.Controls.ContentDialog.SecondaryButtonCommand` property |
| SecondaryButtonText | Gets or sets the text to be displayed on the secondary button. |
| SecondaryButtonTextProperty | Defines the `FluentAvalonia.UI.Controls.ContentDialog.SecondaryButtonText` property |
| Title | Gets or sets the title of the dialog. |
| TitleProperty | Defines the `FluentAvalonia.UI.Controls.ContentDialog.Title` property |
| TitleTemplate | Gets or sets the title template. |
| TitleTemplateProperty | Defines the `FluentAvalonia.UI.Controls.ContentDialog.TitleTemplate` property |
Events
| CloseButtonClick | Occurs after the close button has been tapped. |
| Closed | Occurs after the dialog is closed. |
| Closing | Occurs after the dialog starts to close, but before it is closed and before the Closed event occurs. |
| Opened | Occurs after the dialog is opened. |
| Opening | Occurs before the dialog is opened |
| PrimaryButtonClick | Occurs after the primary button has been tapped. |
| SecondaryButtonClick | Occurs after the secondary button has been tapped. |
Methods
| ShowAsync() | Begins an asynchronous operation to show the dialog. |
| ShowAsync(Window) | Begins an asynchronous operation to show the dialog using the specified window |
| ShowAsyncCore(Window, ContentDialogPlacement) | Shows the content dialog on the specified window asynchronously. |
| Hide() | Closes the current `FluentAvalonia.UI.Controls.ContentDialog` without a result (`FluentAvalonia.UI.Controls.ContentDialogResult`.`FluentAvalonia.UI.Controls.ContentDialogResult.None`) |
| Hide(ContentDialogResult) | Closes the current `FluentAvalonia.UI.Controls.ContentDialog` with the given `FluentAvalonia.UI.Controls.ContentDialogResult` |
| OnPrimaryButtonClick(ContentDialogButtonClickEventArgs) | Called when the primary button is invoked |
| OnSecondaryButtonClick(ContentDialogButtonClickEventArgs) | Called when the secondary button is invoked |
| OnCloseButtonClick(ContentDialogButtonClickEventArgs) | Called when the close button is invoked |
| OnOpening() | Called when the ContentDialog is requested to be opened |
| OnOpened() | Called after the ContentDialog is initialized but just before its presented on screen |
| OnClosing(ContentDialogClosingEventArgs) | Called when the ContentDialog has been requested to close, but before it actually closes |
| OnClosed(ContentDialogClosedEventArgs) | Called when the ContentDialog has been closed and removed from the tree |
Related Enums/Classes
ContentDialogButton
| None | No button is specified as the default. |
| Primary | The primary button is the default. |
| Secondary | The secondary button is the default. |
| Close | The close button is the default. |
ContentDialogResult
| None | No button was tapped. |
| Primary | The primary button was tapped by the user. |
| Secondary | The secondary button was tapped by the user. |
ContentDialogButtonClickEventArgs
| Cancel | Gets or sets a value that can cancel the button click. A true value for Cancel cancels the default behavior. |
| GetDeferral | Gets a `FluentAvalonia.Core.Deferral` that the app can use to respond asynchronously to the closing event. |
ContentDialogClosedEventArgs
| Result | Gets the `FluentAvalonia.UI.Controls.ContentDialogResult` of the button click event. |
ContentDialogClosingEventArgs
| Cancel | Gets or sets a value that can cancel the closing of the dialog. A true value for Cancel cancels the default behavior. |
| Result | Gets the `FluentAvalonia.UI.Controls.ContentDialogResult` of the closing event. |
| GetDeferral | Gets a `FluentAvalonia.Core.Deferral` that the app can use to respond asynchronously to the closing event. |