Class CloseDialogBehavior
This behavior allows the designer to close a dialog using a true/false DialogResult through a button. This is already supported if the IsCancel property is true, but the IsDefault does not auto-dismiss the dialog without some code behind. This alleviates that requirement for the very simple dialogs that are completely VM driven.
public class CloseDialogBehavior : Behavior<ButtonBase>, IAnimatable, IAttachedObject
- Inheritance
-
CloseDialogBehavior
- Implements
- Inherited Members
- Extension Methods
Fields
DialogResultProperty
DialogResult dependency property
public static readonly DependencyProperty DialogResultProperty
Field Value
Properties
DialogResult
Dismiss dialog result value - this is assigned to the window.DialogResult to close the window.
public bool DialogResult { get; set; }
Property Value
Methods
OnAttached()
Called after the behavior is attached to an AssociatedObject.
protected override void OnAttached()
Remarks
Override this to hook up functionality to the AssociatedObject.
OnDetaching()
Called when the behavior is being detached from its AssociatedObject, but before it has actually occurred.
protected override void OnDetaching()
Remarks
Override this to unhook functionality from the AssociatedObject.