ConfirmationBehavior.MessageDefaultResult Property
In This Article
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 |
---|---|
Message |
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