BaseMetroDialog Class
The base class for dialogs. You probably don't want to use this class, if you want to add arbitrary content to your dialog, use the CustomDialog class.
graph BT Type-->Base0["ContentControl"] Type["BaseMetroDialog"] class Type type-node Derived0["InputDialog"]-->Type click Derived0 "/mahapps.com/api/MahApps.Metro.Controls.Dialogs/InputDialog" Derived1["LoginDialog"]-->Type click Derived1 "/mahapps.com/api/MahApps.Metro.Controls.Dialogs/LoginDialog" Derived2["MessageDialog"]-->Type click Derived2 "/mahapps.com/api/MahApps.Metro.Controls.Dialogs/MessageDialog" Derived3["CustomDialog"]-->Type click Derived3 "/mahapps.com/api/MahApps.Metro.Controls.Dialogs/CustomDialog" Derived4["ProgressDialog"]-->Type click Derived4 "/mahapps.com/api/MahApps.Metro.Controls.Dialogs/ProgressDialog"

Syntax

[TemplatePart(Name = PART_Top, Type = typeof(ContentPresenter))]
[TemplatePart(Name = PART_Content, Type = typeof(ContentPresenter))]
[TemplatePart(Name = PART_Bottom, Type = typeof(ContentPresenter))]
public abstract class BaseMetroDialog : ContentControl

Attributes

Type Description
TemplatePart
TemplatePart
TemplatePart

Constructors

Fields

Name Field Type Constant Value Summary
DialogBottomProperty DependencyProperty
Identifies the DialogBottom dependency property.
static
DialogButtonFontSizeProperty DependencyProperty
Identifies the DialogButtonFontSize dependency property.
static
DialogContentMarginProperty DependencyProperty
Identifies the DialogContentMargin dependency property.
static
DialogContentWidthProperty DependencyProperty
Identifies the DialogContentWidth dependency property.
static
DialogMessageFontSizeProperty DependencyProperty
Identifies the DialogMessageFontSize dependency property.
static
DialogTitleFontSizeProperty DependencyProperty
Identifies the DialogTitleFontSize dependency property.
static
DialogTopProperty DependencyProperty
Identifies the DialogTop dependency property.
static
TitleProperty DependencyProperty
Identifies the Title dependency property.
static

Properties

Name Property Type Summary
DialogBottom object
Gets or sets the content below the dialog.
DialogButtonFontSize double
Gets or sets the font size of any dialog buttons.
DialogContentMargin GridLength
Gets or sets the left and right margin for the dialog content.
DialogContentWidth GridLength
Gets or sets the width for the dialog content.
DialogMessageFontSize double
Gets or sets the font size of the dialog message text.
DialogSettings MetroDialogSettings
DialogTitleFontSize double
Gets or sets the font size of the dialog title.
DialogTop object
Gets or sets the content above the dialog.
LogicalChildren IEnumerator
Title string
Gets or sets the title of the dialog.

Methods

Name Return Value Summary
ConfigureSettings(MetroDialogSettings) MetroDialogSettings
With this method it's possible to return your own settings in a custom dialog.
OnCreateAutomationPeer() AutomationPeer
OnLoaded() void
This is called in the loaded event.
RequestCloseAsync() Task
Requests an externally shown Dialog to close. Will throw an exception if the Dialog is inside of a MetroWindow.
WaitForCloseAsync() Task
WaitForLoadAsync() Task
Waits for the dialog to become ready for interaction.
WaitUntilUnloadedAsync() Task
Waits until this dialog gets unloaded.

Extension Methods

Name Value Summary
ShowDialogExternally<BaseMetroDialog>(Window, Action<Window>) TDialog
Create and show an external dialog.
ShowModalDialogExternally<BaseMetroDialog>(Window, Action<Window>) TDialog
Create and show an external modal dialog.