Skip to content

ContentDialog class

Defined in

Namespace: CrissCross.WPF.UI.Controls Assembly: CrissCross.WPF.UI.dll Full name: CrissCross.WPF.UI.Controls.ContentDialog Modifiers: public

Summary

         Dialogue displayed inside the application covering its internals, displaying some content.
         

Applies to

net10.0-windows10.0.19041, net9.0-windows10.0.19041, net8.0-windows10.0.19041, net481

Class hierarchy
classDiagram
class ContentDialog
class ContentControl
ContentControl <|-- ContentDialog

Inherits from: ContentControl

Examples

<ContentPresenter x:Name="RootContentDialogPresenter" Grid.Row="0" />
var contentDialog = new ContentDialog(RootContentDialogPresenter);
 
 contentDialog.SetCurrentValue(ContentDialog.TitleProperty, "Hello World");
 contentDialog.SetCurrentValue(ContentControl.ContentProperty, "This is a message");
 contentDialog.SetCurrentValue(ContentDialog.CloseButtonTextProperty, "Close this dialog");
 
 await contentDialog.ShowAsync(cancellationToken);
var contentDialogService = new ContentDialogService();
 contentDialogService.SetContentPresenter(RootContentDialogPresenter);
 
 await _contentDialogService.ShowSimpleDialogAsync(
 new SimpleContentDialogCreateOptions()
 {
 Title = "The cake?",
 Content = "IS A LIE!",
 PrimaryButtonText = "Save",
 SecondaryButtonText = "Don't Save",
 CloseButtonText = "Cancel"
 }
 );

Constructors

NameSummary
.ctorInitializes a new instance of the [ContentDialog](# class.

Properties

NameSummary
TitleGets or sets the title of the [ContentDialog](#
TitleTemplateGets or sets the title template of the [ContentDialog](#
DialogWidthGets or sets the width of the [ContentDialog](#
DialogHeightGets or sets the height of the [ContentDialog](#
DialogMaxWidthGets or sets the max width of the [ContentDialog](#
DialogMaxHeightGets or sets the max height of the [ContentDialog](#
DialogMarginGets or sets the margin of the [ContentDialog](#
PrimaryButtonTextGets or sets the text to display on the primary button.
SecondaryButtonTextGets or sets the text to be displayed on the secondary button.
CloseButtonTextGets or sets the text to display on the close button.
PrimaryButtonIconGets or sets the [SymbolRegular](# on the secondary button.
SecondaryButtonIconGets or sets the [SymbolRegular](# on the primary button.
CloseButtonIconGets or sets the [SymbolRegular](# on the close button.
IsPrimaryButtonEnabledGets or sets a value indicating whether gets or sets whether the [ContentDialog](# primary button is enabled.
IsSecondaryButtonEnabledGets or sets a value indicating whether gets or sets whether the [ContentDialog](# secondary button is enabled.
PrimaryButtonAppearanceGets or sets the [ControlAppearance](# to apply to the primary button.
SecondaryButtonAppearanceGets or sets the [ControlAppearance](# to apply to the secondary button.
CloseButtonAppearanceGets or sets the [ControlAppearance](# to apply to the close button.
DefaultButtonGets or sets a value that indicates which button on the dialog is the default action.
IsFooterVisibleGets or sets a value indicating whether gets or sets a value that indicates the visibility of the footer buttons.
TemplateButtonCommandGets command triggered after clicking the button in the template.
ContentPresenterGets or sets [ContentPresenter](# inside of which the dialogue will be placed. The new...
OnButtonClickCommandOccurs after the [ContentDialogButton](# is clicked.

Fields

NameSummary
static TitlePropertyProperty for [Title](#
static TitleTemplatePropertyProperty for [TitleTemplate](#
static DialogWidthPropertyProperty for [DialogWidth](#
static DialogHeightPropertyProperty for [DialogHeight](#
static DialogMaxWidthPropertyProperty for [DialogMaxWidth](#
static DialogMaxHeightPropertyProperty for [DialogMaxHeight](#
static DialogMarginPropertyProperty for [DialogMargin](#
static PrimaryButtonTextPropertyProperty for [PrimaryButtonText](#
static SecondaryButtonTextPropertyProperty for [SecondaryButtonText](#
static CloseButtonTextPropertyProperty for [CloseButtonText](#
static PrimaryButtonIconPropertyProperty for [PrimaryButtonIcon](#
static SecondaryButtonIconPropertyProperty for [SecondaryButtonIcon](#
static CloseButtonIconPropertyProperty for [CloseButtonIcon](#
static IsPrimaryButtonEnabledPropertyProperty for [IsPrimaryButtonEnabled](#
static IsSecondaryButtonEnabledPropertyProperty for [IsSecondaryButtonEnabled](#
static PrimaryButtonAppearancePropertyProperty for [PrimaryButtonAppearance](#
static SecondaryButtonAppearancePropertyProperty for [SecondaryButtonAppearance](#
static CloseButtonAppearancePropertyProperty for [CloseButtonAppearance](#
static DefaultButtonPropertyProperty for [DefaultButton](#
static IsFooterVisiblePropertyProperty for [IsFooterVisible](#
static TemplateButtonCommandPropertyProperty for [TemplateButtonCommand](#
static OpenedEventProperty for [Opened](#
static ClosingEventProperty for [Closing](#
static ClosedEventProperty for [Closed](#
static ButtonClickedEventProperty for [ButtonClicked](#
TcsThe TCS.

Methods

NameSummary
ShowAsyncShows the dialog.
HideHides the dialog with result.
OnClosedOccurs after ContentPresenter.Content = null.
OnButtonClickOccurs after the [ContentDialogButton](# is clicked.
MeasureOverrideMeasures the override.
OnLoadedOccurs after Loaded event.

Events

NameSummary
OpenedOccurs after the dialog is opened.
ClosingOccurs after the dialog starts to close, but before it is closed and before the [Closed](# event occurs.
ClosedOccurs after the dialog is closed.
ButtonClickedOccurs after the [ContentDialogButton](# has been tapped.
Inherited members