ThemedWindow.DialogButtons Property

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

Namespace: DevExpress.Xpf.Core

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

Declaration

public ObservableCollection<object> DialogButtons { get; }
Public ReadOnly Property DialogButtons As ObservableCollection(Of Object)

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>
See Also