Back to Devexpress

ThemedWindow.ShowDialog() Method

wpf-devexpress-dot-xpf-dot-core-dot-themedwindow-5a510a44.md

latest3.8 KB
Original Source

ThemedWindow.ShowDialog() Method

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

Declaration

csharp
public bool? ShowDialog()
vb
Public Function ShowDialog As Boolean?

Returns

TypeDescription
Nullable<Boolean>

true , if an end user clicks OK ( Yes ) in the dialog box; false , if an end user clicks No ( Cancel ), presses the Esc or the WindowCloseButton [x]; otherwise, null.

|

Remarks

The following code snippet demonstrates how to display the ThemedWindowDialog without dialog buttons on the button click:

csharp
void Button_Click(object sender, RoutedEventArgs e) {
    ThemedWindow themedWindow = new ThemedWindow() { Title = "ThemedWindowDialog" };
    themedWindow.ShowDialog();
  }
vb
Private Sub Button_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
  Dim themedWindow As ThemedWindow = New ThemedWindow() With {
      .Title = "ThemedWindowDialog" }
  themedWindow.ShowDialog()
End Sub

The following code snippet shows how to display the ThemedWindowDialog with the OK and Cancel dialog buttons on the button click:

csharp
void Button_Click(object sender, RoutedEventArgs e) {
      ThemedWindow themedWindow = new ThemedWindow() { Title = "ThemedWindowDialog" };
      themedWindow.ShowDialog(MessageBoxButton.OKCancel);
    }
vb
Private Sub Button_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
    Dim themedWindow As ThemedWindow = New ThemedWindow() With {
        .Title = "ThemedWindowDialog" }
    themedWindow.ShowDialog(MessageBoxButton.OKCancel)
  End Sub

Note

You should specify the dialog button’s DialogResult property. Refer to Dialog Boxes Overview for more information on the Microsoft dialog boxes.

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

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.

reporting-wpf-print-listview-data/CS/Window1.xaml.cs#L25

csharp
link.CreateDocument(true);
    preview.ShowDialog();
}

reporting-wpf-print-listview-data/VB/Window1.xaml.vb#L27

vb
link.CreateDocument(True)
    preview.ShowDialog()
End Sub

See Also

ThemedWindow Class

ThemedWindow Members

DevExpress.Xpf.Core Namespace