Skip to main content

ContentDialog

Description​

Use ContentDialog for modal prompts that require an explicit choice (confirmations, errors, sign-in).

The images show the dialog while it is open. A closed dialog has no visible surface.

ContentDialog in light mode ContentDialog in dark mode

Example usage​

Fluence.Wpf.Controls.ContentDialog dialog = new Fluence.Wpf.Controls.ContentDialog()
{
Title = "Delete file?",
Content = "Roadmap.md will be permanently deleted.",
PrimaryButtonText = "Delete",
CloseButtonText = "Cancel",
};
Fluence.Wpf.ContentDialogResult result = await dialog.ShowAsync();

Call ShowAsync on the UI dispatcher while an owner window is active.

Key properties​

PropertyDefaultPurpose
TitlenullDialog title.
PrimaryButtonTextEmpty stringLabel for the primary action.
SecondaryButtonTextEmpty stringLabel for the secondary action.
CloseButtonTextEmpty stringLabel for the close action.
DefaultButtonNoneIdentifies the default action.
IsPrimaryButtonEnabledtrueEnables the primary action.

State and behavior​

ShowAsync presents a modal choice; button actions complete it with a result.

Additional behavior​

FlyoutBase is an abstract support type. ContentDialog.ShowAsync needs an active owner and must run on the UI dispatcher. See dialogs and feedback.

Events​

PrimaryButtonClick, SecondaryButtonClick, and CloseButtonClick report actions; Opened and Closed report lifecycle changes.

Reference​