Class Dialog
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
IDialogCoordinatorCoordinator for dialogs.
dialogViewModel
DialogViewModelView 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
IDialogCoordinatorCoordinator for dialogs.
dialogViewModel
DialogViewModelView model of the dialog.
settings
MetroDialogSettingsOptional metro dialog settings.
Exceptions
- ArgumentNullException
Thrown when
dialogCoordinator
ordialogViewModel
is null.
Properties
CancellationTokenSource
Gets or sets the cancellation token source.
public CancellationTokenSource CancellationTokenSource { get; set; }
Property Value
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
IsFullScreen
Gets or sets a value indicating whether the dialog should be in full screen mode.
public bool IsFullScreen { get; set; }
Property Value
ThrowExceptionOnCancel
Gets or sets a value indicating whether a exception should be thrown at cancellation.
public bool ThrowExceptionOnCancel { get; set; }
Property Value
Methods
Close(string)
Closes the dialog.
public virtual DialogResult Close(string key)
Parameters
key
stringThe 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.