WPF MVVM Framework - Show a Confirmation Message Box Before Executing the Specified Command (a ConfirmationBehavior)
The example attaches a command to a Button and enables a confirmation message for the command. Users can confirm or cancel the operation.
Specify the behavior's Command property to set a command that shows a confirmation message and should be executed if the user confirms the operation.
Property | Desciption |
---|---|
Command | Gets or sets the command that runs if the user accepts the confirmation message. This is a dependency property. |
CommandPropertyName | Gets or sets a name of an associated control's command property. This is a dependency property. |
CommandParameter | Gets or sets parameters to pass to the Command. This is a dependency property. |
EnableConfirmationMessage | Gets or sets whether a confirmation message should be displayed. This is a dependency property. |
MessageBoxService | Gets or sets a custom message box service. You can use the WinUIMessageBox or create a custom message box that implements the IMessageBoxService interface. This is a dependency property. |
MessageDefaultResult | Gets or sets the confirmation message button that should be focused when the message appears. This is a dependency property. |
MessageButton | Gets or sets the confirmation message buttons. This is a dependency property. |
MessageIcon | Gets or sets the confirmation message icon. This is a dependency property. |
MessageText | Gets or sets the confirmation message text. This is a dependency property. |
MessageTitle | Gets or sets the confirmation message title. This is a dependency property. |
- MainView.xaml (VB: MainView.xaml)
- MainViewMode.cs (VB: MainViewMode.vb)