Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 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.MessageDefaultResult Property

Gets or sets the confirmation message button that should be focused when the message appears. This is a dependency property.

Namespace: DevExpress.Mvvm.UI

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

NuGet Package: DevExpress.Wpf.Core

#Declaration

public MessageBoxResult MessageDefaultResult { get; set; }

#Property Value

Type Description
MessageBoxResult

The confirmation message button that should be focused when the message appears.

#Remarks

The following code sample specifies that the Cancel button is focused in the confirmation message:

<UserControl ... 
    xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm">
    <UserControl.DataContext>
        <ViewModels:MainViewModel/>
    </UserControl.DataContext>
    <Grid>
        <Button Content="Close">
            <dxmvvm:Interaction.Behaviors>
                <dxmvvm:ConfirmationBehavior Command="{Binding CloseCommand}" MessageButton="YesNoCancel"
                MessageText="Are you sure to close the unsaved document?" MessageDefaultResult="Cancel" >
                </dxmvvm:ConfirmationBehavior>
            </dxmvvm:Interaction.Behaviors>
        </Button>
    </Grid>
</UserControl>
using DevExpress.Mvvm;
using DevExpress.Mvvm.DataAnnotations;

public class MainViewModel : ViewModelBase {
    [Command]
    public void Close() {
        // ...
    }
}
See Also