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¶
| Name | Summary |
|---|---|
| .ctor | Initializes a new instance of the [ContentDialog](# class. |
Properties¶
| Name | Summary |
|---|---|
| Title | Gets or sets the title of the [ContentDialog](# |
| TitleTemplate | Gets or sets the title template of the [ContentDialog](# |
| DialogWidth | Gets or sets the width of the [ContentDialog](# |
| DialogHeight | Gets or sets the height of the [ContentDialog](# |
| DialogMaxWidth | Gets or sets the max width of the [ContentDialog](# |
| DialogMaxHeight | Gets or sets the max height of the [ContentDialog](# |
| DialogMargin | Gets or sets the margin of the [ContentDialog](# |
| PrimaryButtonText | Gets or sets the text to display on the primary button. |
| SecondaryButtonText | Gets or sets the text to be displayed on the secondary button. |
| CloseButtonText | Gets or sets the text to display on the close button. |
| PrimaryButtonIcon | Gets or sets the [SymbolRegular](# on the secondary button. |
| SecondaryButtonIcon | Gets or sets the [SymbolRegular](# on the primary button. |
| CloseButtonIcon | Gets or sets the [SymbolRegular](# on the close button. |
| IsPrimaryButtonEnabled | Gets or sets a value indicating whether gets or sets whether the [ContentDialog](# primary button is enabled. |
| IsSecondaryButtonEnabled | Gets or sets a value indicating whether gets or sets whether the [ContentDialog](# secondary button is enabled. |
| PrimaryButtonAppearance | Gets or sets the [ControlAppearance](# to apply to the primary button. |
| SecondaryButtonAppearance | Gets or sets the [ControlAppearance](# to apply to the secondary button. |
| CloseButtonAppearance | Gets or sets the [ControlAppearance](# to apply to the close button. |
| DefaultButton | Gets or sets a value that indicates which button on the dialog is the default action. |
| IsFooterVisible | Gets or sets a value indicating whether gets or sets a value that indicates the visibility of the footer buttons. |
| TemplateButtonCommand | Gets command triggered after clicking the button in the template. |
| ContentPresenter | Gets or sets [ContentPresenter](# inside of which the dialogue will be placed. The new... |
| OnButtonClickCommand | Occurs after the [ContentDialogButton](# is clicked. |
Fields¶
| Name | Summary |
|---|---|
| static TitleProperty | Property for [Title](# |
| static TitleTemplateProperty | Property for [TitleTemplate](# |
| static DialogWidthProperty | Property for [DialogWidth](# |
| static DialogHeightProperty | Property for [DialogHeight](# |
| static DialogMaxWidthProperty | Property for [DialogMaxWidth](# |
| static DialogMaxHeightProperty | Property for [DialogMaxHeight](# |
| static DialogMarginProperty | Property for [DialogMargin](# |
| static PrimaryButtonTextProperty | Property for [PrimaryButtonText](# |
| static SecondaryButtonTextProperty | Property for [SecondaryButtonText](# |
| static CloseButtonTextProperty | Property for [CloseButtonText](# |
| static PrimaryButtonIconProperty | Property for [PrimaryButtonIcon](# |
| static SecondaryButtonIconProperty | Property for [SecondaryButtonIcon](# |
| static CloseButtonIconProperty | Property for [CloseButtonIcon](# |
| static IsPrimaryButtonEnabledProperty | Property for [IsPrimaryButtonEnabled](# |
| static IsSecondaryButtonEnabledProperty | Property for [IsSecondaryButtonEnabled](# |
| static PrimaryButtonAppearanceProperty | Property for [PrimaryButtonAppearance](# |
| static SecondaryButtonAppearanceProperty | Property for [SecondaryButtonAppearance](# |
| static CloseButtonAppearanceProperty | Property for [CloseButtonAppearance](# |
| static DefaultButtonProperty | Property for [DefaultButton](# |
| static IsFooterVisibleProperty | Property for [IsFooterVisible](# |
| static TemplateButtonCommandProperty | Property for [TemplateButtonCommand](# |
| static OpenedEvent | Property for [Opened](# |
| static ClosingEvent | Property for [Closing](# |
| static ClosedEvent | Property for [Closed](# |
| static ButtonClickedEvent | Property for [ButtonClicked](# |
| Tcs | The TCS. |
Methods¶
| Name | Summary |
|---|---|
| ShowAsync | Shows the dialog. |
| Hide | Hides the dialog with result. |
| OnClosed | Occurs after ContentPresenter.Content = null. |
| OnButtonClick | Occurs after the [ContentDialogButton](# is clicked. |
| MeasureOverride | Measures the override. |
| OnLoaded | Occurs after Loaded event. |
Events¶
| Name | Summary |
|---|---|
| Opened | Occurs after the dialog is opened. |
| Closing | Occurs after the dialog starts to close, but before it is closed and before the [Closed](# event occurs. |
| Closed | Occurs after the dialog is closed. |
| ButtonClicked | Occurs after the [ContentDialogButton](# has been tapped. |