Table of Contents

Class Dialog

Namespace
Loehnert.Controls.Dialogs
Assembly
Loehnert.Controls.dll

Represents a dialog.

public class Dialog
Inheritance
Dialog
Inherited Members

Constructors

Dialog(IDialogCoordinator, DialogViewModel)

Initializes a new instance of the Dialog class.

public Dialog(IDialogCoordinator dialogCoordinator, DialogViewModel dialogViewModel)

Parameters

dialogCoordinator IDialogCoordinator

Coordinator for dialogs.

dialogViewModel DialogViewModel

View model of the dialog.

Exceptions

ArgumentNullException

Thrown when an argument is null.

Dialog(IDialogCoordinator, DialogViewModel, MetroDialogSettings)

Initializes a new instance of the Dialog class.

public Dialog(IDialogCoordinator dialogCoordinator, DialogViewModel dialogViewModel, MetroDialogSettings settings)

Parameters

dialogCoordinator IDialogCoordinator

Coordinator for dialogs.

dialogViewModel DialogViewModel

View model of the dialog.

settings MetroDialogSettings

Optional metro dialog settings.

Exceptions

ArgumentNullException

Thrown when dialogCoordinator or dialogViewModel is null.

Properties

CancellationTokenSource

Gets or sets the cancellation token source.

public CancellationTokenSource CancellationTokenSource { get; set; }

Property Value

CancellationTokenSource

Context

Gets or sets the context in which the dialog is shown, this is required for external windows, for example in dialog windows. By default, the IMainWindow view model is used.

public object Context { get; set; }

Property Value

object

IsFullScreen

Gets or sets a value indicating whether the dialog should be in full screen mode.

public bool IsFullScreen { get; set; }

Property Value

bool

ThrowExceptionOnCancel

Gets or sets a value indicating whether a exception should be thrown at cancellation.

public bool ThrowExceptionOnCancel { get; set; }

Property Value

bool

Methods

Close(string)

Closes the dialog.

public virtual DialogResult Close(string key)

Parameters

key string

The close reason key, see CloseReasonKey.

Returns

DialogResult

A dialog result.

Show()

Shows the dialog on the Context.

public virtual DialogResult Show()

Returns

DialogResult

The result of the dialog.

Exceptions

InvalidOperationException

Thrown when the dialog has already been closed.

OperationCanceledException

Thrown when user the cancel button presses while ThrowExceptionOnCancel is.

ShowAsync()

Shows the dialog on the Context.

public virtual Task<DialogResult> ShowAsync()

Returns

Task<DialogResult>

The task with dialog result.

Exceptions

InvalidOperationException

Thrown when the dialog has already been closed.