Skip to main content
A newer version of this page is available. .

ThemedWindow.DialogButtons Property

Gets the custom dialog button collection. This is a dependency property.

Namespace: DevExpress.Xpf.Core

Assembly: DevExpress.Xpf.Core.v22.1.dll

NuGet Package: DevExpress.Wpf.Core

Declaration

public ObservableCollection<object> DialogButtons { get; }

Property Value

Type Description
ObservableCollection<Object>

A dialog button collection.

Remarks

Create a ThemedWindowDialogButton object and add it to the DialogButtons collection to display a custom button.

You should specify the dialog button’s DialogResult property.

The following code sample shows how to add the OK and Cancel buttons to the ThemedWindow in code:

ThemedWindow themedWindow = new ThemedWindow() { Title = "Your update is ready" };
themedWindow.Content = new TextBlock() { Text = "Do you want to update now?" };

ThemedWindowDialogButton DismissDialogButton = new ThemedWindowDialogButton() { Content = "Remind Me Tomorrow", DialogResult = MessageBoxResult.No, Placement = Dock.Left };
themedWindow.DialogButtons.Add(DismissDialogButton);

MessageBoxResult result = themedWindow.ShowDialog(MessageBoxButton.OKCancel);

ThemedMessageBox.Show("Done", String.Format("'{0}' dialogButton has been pressed", result.ToString()), MessageBoxButton.OK);

The image below illustrates the result:

DialogButton - How to check the MessageBoxResult

The following code sample shows how to add the same buttons to the ThemedWindow in XAML:

<dx:ThemedWindow ...
    xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core">
    <dx:ThemedWindow.DialogButtons>
        <dx:ThemedWindowDialogButton Content="Remind Me Tomorrow" Placement="Left" DialogResult="No"/>
        <dx:ThemedWindowDialogButton DialogResult="OK" Content="OK" IsDefault="True"/>
        <dx:ThemedWindowDialogButton DialogResult="Cancel" Content="Cancel"/>
    </dx:ThemedWindow.DialogButtons>
</dx:ThemedWindow>

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DialogButtons property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also