Skip to main content
All docs
V25.1
  • DevExpress v25.1 Update — Your Feedback Matters

    Our What's New in v25.1 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

    Take the survey Not interested

    ConfirmationBehavior.MessageText Property

    Gets or sets the confirmation message text. This is a dependency property.

    Namespace: DevExpress.Mvvm.UI

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

    NuGet Package: DevExpress.Wpf.Core

    #Declaration

    public string MessageText { get; set; }

    #Property Value

    Type Default Description
    String Do you want to perform this action?

    The confirmation message text.

    #Remarks

    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() {
            // ...
        }
    }
    
    See Also