wpf-devexpress-dot-xpf-dot-core-dot-themedwindow-461e7bfd.md
Gets the custom dialog button collection. This is a dependency property.
Namespace : DevExpress.Xpf.Core
Assembly : DevExpress.Xpf.Core.v25.2.dll
NuGet Package : DevExpress.Wpf.Core
public ObservableCollection<object> DialogButtons { get; }
Public ReadOnly Property DialogButtons As ObservableCollection(Of Object)
| Type | Description |
|---|---|
| ObservableCollection<Object> |
A dialog button collection.
|
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);
Private Sub SurroundingSub()
Dim themedWindow As ThemedWindow = New ThemedWindow() With {
.Title = "Your update is ready"
}
Dim themedWindow.Content = New TextBlock() With {
.Text = "Do you want to update now?"
}
Dim DismissDialogButton As ThemedWindowDialogButton = New ThemedWindowDialogButton() With {
.Content = "Remind Me Tomorrow",
.DialogResult = MessageBoxResult.No,
.Placement = Dock.Left
}
themedWindow.DialogButtons.Add(DismissDialogButton)
Dim result As MessageBoxResult = themedWindow.ShowDialog(MessageBoxButton.OKCancel)
ThemedMessageBox.Show("Done", String.Format("'{0}' dialogButton has been pressed", result.ToString()), MessageBoxButton.OK)
End Sub
The image below illustrates the result:
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.
</Grid>
<dx:ThemedWindow.DialogButtons>
<dx:ThemedWindowDialogButton Content="{dxsch:SchedulerLocalizer StringId=ButtonCaption_OK}" Command="{Binding SaveCommand}" IsDefault="True" MinWidth="65" DialogResult="OK"/>
See Also