Back to Devexpress

ConfirmationBehavior.MessageTitle Property

wpf-devexpress-dot-mvvm-dot-ui-dot-confirmationbehavior-663e3c47.md

latest2.3 KB
Original Source

ConfirmationBehavior.MessageTitle Property

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

Namespace : DevExpress.Mvvm.UI

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

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public string MessageTitle { get; set; }
vb
Public Property MessageTitle As String

Property Value

TypeDefaultDescription
StringConfirmation

The confirmation message title.

|

Remarks

The following code sample attaches a ConfirmationBehavior to a button and sets a custom message title:

xaml
<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}" MessageTitle="Unsaved changes"
               MessageText="The document has unsaved changes. Do you want to close the document?"/>
            </dxmvvm:Interaction.Behaviors>
        </Button>
    </StackPanel>
</UserControl>
csharp
using DevExpress.Mvvm;
using DevExpress.Mvvm.DataAnnotations;

public class MainViewModel : ViewModelBase {
    [Command]
    public void Close() {
        // ...
    }
}
vb
Imports DevExpress.Mvvm
Imports DevExpress.Mvvm.DataAnnotations

Public Class MainViewModel
    Inherits ViewModelBase

    <Command>
    Public Sub Close()
    End Sub
End Class

See Also

ConfirmationBehavior Class

ConfirmationBehavior Members

DevExpress.Mvvm.UI Namespace