wpf-devexpress-dot-xpf-dot-core-dot-themedwindow-dot-showdialog-x28-system-dot-collections-dot-generic-dot-ienumerable-devexpress-dot-mvvm-dot-uicommand-x29.md
Displays the ThemedWindowDialog. A result returned when the window is closed.
Namespace : DevExpress.Xpf.Core
Assembly : DevExpress.Xpf.Core.v25.2.dll
NuGet Package : DevExpress.Wpf.Core
public UICommand ShowDialog(
IEnumerable<UICommand> dialogButtons = null
)
Public Function ShowDialog(
dialogButtons As IEnumerable(Of UICommand) = Nothing
) As UICommand
| Name | Type | Default | Description |
|---|---|---|---|
| dialogButtons | IEnumerable<UICommand> | null |
A UICommand collection.
|
| Type | Description |
|---|---|
| UICommand |
A clicked button’s UICommand value.
|
The following code snippet shows how to display the ThemedWindow with a UICommand list and check the pressed button:
ThemedWindow themedWindow = new ThemedWindow() { Title = "ThemedWindowDialog" };
List<UICommand> buttons = new List<UICommand>();
buttons.Add(new UICommand() { Id = MessageBoxResult.Cancel, Caption = "Custom_Cancel", IsCancel = true });
buttons.Add(new UICommand() { Id = MessageBoxResult.OK, Caption = "Custom_Ok", IsDefault = true });
buttons.Add(new UICommand() { Id = MessageBoxResult.Yes, Caption = "Apply", Placement = Dock.Left });
buttons.Add(new UICommand() { Id = MessageBoxResult.No, Caption = "Dismiss", Placement = Dock.Left });
UICommand result = themedWindow.ShowDialog(buttons);
ThemedMessageBox.Show("Done", String.Format("'{0}' dialogButton has been pressed", result.Id.ToString()), MessageBoxButton.OK);
Dim themedWindow As ThemedWindow = New ThemedWindow() With {
.Title = "ThemedWindowDialog" }
Dim buttons As List(Of UICommand) = New List(Of UICommand)()
buttons.Add(New UICommand() With{
.Id = MessageBoxResult.Cancel,
.Caption = "Custom_Cancel",
.IsCancel = true })
buttons.Add(New UICommand() With{
.Id = MessageBoxResult.OK,
.Caption = "Custom_Ok",
.IsDefault = true })
buttons.Add(New UICommand() With{
.Id = MessageBoxResult.OK,
.Caption = "Apply",
.Placement = Dock.Left })
buttons.Add(New UICommand() With{
.Id = MessageBoxResult.Cancel,
.Caption = "Dismiss",
.Placement = Dock.Left })
Dim result As UICommand = themedWindow.ShowDialog(buttons)
ThemedMessageBox.Show("Done", String.Format("'{0}' dialogButton has been pressed", result.Id.ToString()), MessageBoxButton.OK)
See Also