BaseMetroDialog Class

Summary

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 "/api/MahApps.Metro.Controls.Dialogs/InputDialog" Derived1["CustomDialog"]-->Type click Derived1 "/api/MahApps.Metro.Controls.Dialogs/CustomDialog" Derived2["LoginDialog"]-->Type click Derived2 "/api/MahApps.Metro.Controls.Dialogs/LoginDialog" Derived3["MessageDialog"]-->Type click Derived3 "/api/MahApps.Metro.Controls.Dialogs/MessageDialog" Derived4["ProgressDialog"]-->Type click Derived4 "/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 Constant Value Summary
DialogBottomProperty
Identifies the DialogBottom dependency property.
static
DialogButtonFontSizeProperty
Identifies the DialogButtonFontSize dependency property.
static
DialogContentMarginProperty
Identifies the DialogContentMargin dependency property.
static
DialogContentWidthProperty
Identifies the DialogContentWidth dependency property.
static
DialogMessageFontSizeProperty
Identifies the DialogMessageFontSize dependency property.
static
DialogTitleFontSizeProperty
Identifies the DialogTitleFontSize dependency property.
static
DialogTopProperty
Identifies the DialogTop dependency property.
static
TitleProperty
Identifies the Title dependency property.
static

Properties

Name Value 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 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.