wpf-devexpress-dot-mvvm-dot-ui-dot-confirmationbehavior-29738b6f.md
Gets or sets the confirmation message text. This is a dependency property.
Namespace : DevExpress.Mvvm.UI
Assembly : DevExpress.Xpf.Core.v25.2.dll
NuGet Package : DevExpress.Wpf.Core
public string MessageText { get; set; }
Public Property MessageText As String
| Type | Default | Description |
|---|---|---|
| String | Do you want to perform this action? |
The confirmation message text.
|
The following code sample attaches a command to a Button and enables a confirmation message for this command:
<UserControl ...
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm">
<UserControl.DataContext>
<ViewModels:MainViewModel/>
</UserControl.DataContext>
<StackPanel>
<Button Content="Close">
<dxmvvm:Interaction.Behaviors>
<dxmvvm:ConfirmationBehavior Command="{Binding CloseCommand}"
MessageText="The document has unsaved changes. Do you want to close the document?"/>
</dxmvvm:Interaction.Behaviors>
</Button>
</StackPanel>
</UserControl>
using DevExpress.Mvvm;
using DevExpress.Mvvm.DataAnnotations;
public class MainViewModel : ViewModelBase {
[Command]
public void Close() {
// ...
}
}
Imports DevExpress.Mvvm
Imports DevExpress.Mvvm.DataAnnotations
Public Class MainViewModel
Inherits ViewModelBase
<Command>
Public Sub Close()
End Sub
End Class
See Also