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.MessageBoxService Property

Gets or sets a custom message box service. You can use the WinUIMessageBox or create a custom message box that implements the IMessageBoxService interface. This is a dependency property.

Namespace: DevExpress.Mvvm.UI

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

NuGet Package: DevExpress.Wpf.Core

#Declaration

public IMessageBoxService MessageBoxService { get; set; }

#Property Value

Type Description
IMessageBoxService

A custom message box service.

#Remarks

The following code sample enables a WinUIMessageBox in a ConfirmationBehavior:

<UserControl ... 
    xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
    xmlns:dxwui="http://schemas.devexpress.com/winfx/2008/xaml/windowsui">
    <Grid>
        <Button Content="Close">
            <dxmvvm:Interaction.Behaviors>
                <dxwui:WinUIMessageBoxService x:Name="winUIMessageBoxService"/>
                <dxmvvm:ConfirmationBehavior Command="{Binding CloseCommand}" 
                MessageText="Do you want to close the document and lose unsaved changes?"
                MessageBoxService="{Binding ElementName=winUIMessageBoxService}">
                </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