Back to Devexpress

ConfirmationBehavior.EnableConfirmationMessage Property

wpf-devexpress-dot-mvvm-dot-ui-dot-confirmationbehavior-34debee2.md

latest1.9 KB
Original Source

ConfirmationBehavior.EnableConfirmationMessage Property

Gets or sets whether a confirmation message should be displayed. This is a dependency property.

Namespace : DevExpress.Mvvm.UI

Assembly : DevExpress.Xpf.Core.v25.2.dll

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public bool EnableConfirmationMessage { get; set; }
vb
Public Property EnableConfirmationMessage As Boolean

Property Value

TypeDefaultDescription
Booleantrue

true if a confirmation message should be displayed; otherwise, false.

|

Remarks

The following code specifies the Button’s command and enables a confirmation message for it. The message only appears if the ViewModel’s IsSaved property is false:

xaml
<Button Content="Close">
    <dxmvvm:Interaction.Behaviors>
        <dxmvvm:ConfirmationBehavior EnableConfirmationMessage="{Binding IsSaved, Converter={StaticResource BooleanNegationConverter}}" 
                                     Command="{Binding CloseCommand}" MessageText="The document has unsaved changes. Do you want to close the document?"/>
    </dxmvvm:Interaction.Behaviors>
</Button>

View Example

See Also

ConfirmationBehavior Class

ConfirmationBehavior Members

DevExpress.Mvvm.UI Namespace