Skip to main content
A newer version of this page is available. .
All docs
V20.2

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.v20.2.dll

NuGet Packages: DevExpress.WindowsDesktop.Wpf.Core, 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