Back to Devexpress

ThemedWindowDialogButton.DialogResult Property

wpf-devexpress-dot-xpf-dot-core-dot-themedwindowdialogbutton-7efc8451.md

latest4.9 KB
Original Source

ThemedWindowDialogButton.DialogResult Property

Gets or sets the dialog’s result when the UICommand is not specified.

Namespace : DevExpress.Xpf.Core

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

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public MessageBoxResult DialogResult { get; set; }
vb
Public Property DialogResult As MessageBoxResult

Property Value

TypeDescription
MessageBoxResult

The dialog result value.

|

Remarks

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

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

ThemedWindowDialogButton CancelDialogButton = new ThemedWindowDialogButton() { Content = "Don't Remind Me", IsCancel = true, DialogResult = MessageBoxResult.Cancel };
themedWindow.DialogButtons.Add(CancelDialogButton);

ThemedWindowDialogButton OKDialogButton = new ThemedWindowDialogButton() { Content = "Install Update", IsDefault = true, DialogResult = MessageBoxResult.OK };
themedWindow.DialogButtons.Add(OKDialogButton);

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

themedWindow.ShowDialog();
vb
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 CancelDialogButton As ThemedWindowDialogButton = New ThemedWindowDialogButton() With {
      .Content = "Don't Remind Me",
      .IsCancel = True,
      .DialogResult = MessageBoxResult.Cancel
  }
  themedWindow.DialogButtons.Add(CancelDialogButton)

  Dim OKDialogButton As ThemedWindowDialogButton = New ThemedWindowDialogButton() With {
      .Content = "Install Update",
      .IsDefault = True,
      .DialogResult = MessageBoxResult.OK
  }
  themedWindow.DialogButtons.Add(OKDialogButton)

  Dim DismissDialogButton As ThemedWindowDialogButton = New ThemedWindowDialogButton() With {
      .Content = "Remind Me Tomorrow",
      .DialogResult = MessageBoxResult.No,
      .Placement = Dock.Left
  }
  themedWindow.DialogButtons.Add(DismissDialogButton)

  themedWindow.ShowDialog()
End Sub

The following code snippets (auto-collected from DevExpress Examples) contain references to the DialogResult 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.

wpf-scheduler-specify-custom-edit-and-recurrence-dialogs/CS/CustomMvvmFormWithRecurrenceExample/HospitalRecurrenceWindow.xaml#L56

xml
<dx:ThemedWindow.DialogButtons>
    <dx:ThemedWindowDialogButton Content="{dxsch:SchedulerLocalizer StringId=ButtonCaption_OK}" Command="{Binding SaveCommand}" IsDefault="True" MinWidth="65" DialogResult="OK"/>
    <dx:ThemedWindowDialogButton Content="{dxsch:SchedulerLocalizer StringId=ButtonCaption_Cancel}" IsCancel="True" MinWidth="65" DialogResult="Cancel"/>

wpf-imageedit-edit-images-in-separate-window/CS/ImageEditToEditModeBehavior/EditImageWindow.xaml#L73

xml
IsEnabled="{DXBinding '@e(editBehavior).HasChanges'}"
                             DialogResult="OK"/>
<dx:ThemedWindowDialogButton Content="Cancel"

See Also

ThemedWindowDialogButton Class

ThemedWindowDialogButton Members

DevExpress.Xpf.Core Namespace