diff --git a/src/MainDemo.Wpf/Dialogs.xaml b/src/MainDemo.Wpf/Dialogs.xaml
index f109fca585..6ca9f5466a 100644
--- a/src/MainDemo.Wpf/Dialogs.xaml
+++ b/src/MainDemo.Wpf/Dialogs.xaml
@@ -23,350 +23,401 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1966-JUL-30
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- True
-
-
+
+
-
-
- False
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ True
+
+
+
+
+
+ False
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/MainDemo.Wpf/Dialogs.xaml.cs b/src/MainDemo.Wpf/Dialogs.xaml.cs
index f8816bb7df..5347287fc0 100644
--- a/src/MainDemo.Wpf/Dialogs.xaml.cs
+++ b/src/MainDemo.Wpf/Dialogs.xaml.cs
@@ -1,4 +1,5 @@
using System.Diagnostics;
+using System.Threading.Tasks;
using MaterialDesignDemo.Domain;
using MaterialDesignThemes.Wpf;
@@ -11,6 +12,7 @@ public Dialogs()
DataContext = new DialogsViewModel();
InitializeComponent();
BlurRadiusSlider.Value = DialogHost.DefaultBlurRadius;
+ tbBlurRadius.Text = DialogOptions.Default.BlurRadius.ToString();
}
private void Sample1_DialogHost_OnDialogClosing(object sender, DialogClosingEventArgs eventArgs)
@@ -87,4 +89,26 @@ private void Sample6_ResetBlur(object sender, RoutedEventArgs e)
{
BlurRadiusSlider.Value = DialogHost.DefaultBlurRadius;
}
+
+ private async void Sample7_OpenWithDialogOptions(object sender, RoutedEventArgs e)
+ {
+ var options = new DialogOptions()
+ {
+ OpenedEventHandler = cbOpenedEventHandler.IsChecked == true ? (_, _) => MessageBox.Show("OpenedEventHandler raised") : null,
+ ClosingEventHandler = cbClosingEventHandler.IsChecked == true ? (_, _) => MessageBox.Show("ClosingEventHandler raised") : null,
+ ClosedEventHandler = cbClosedEventHandler.IsChecked == true ? (_, _) => MessageBox.Show("ClosedEventHandler raised") : null,
+ IsFullscreen = cbIsFullscreen.IsChecked!.Value,
+ ShowCloseButton = cbShowCloseButton.IsChecked!.Value,
+ CloseOnClickAway = cbCloseOnClickAway.IsChecked!.Value,
+ ApplyBlurEffect = cbApplyBlurEffect.IsChecked!.Value,
+ BlurRadius = double.TryParse(tbBlurRadius.Text, out double parsedRadius) ? parsedRadius : 0
+ };
+
+ var dialogContent = new TextBlock()
+ {
+ Text = "Some dialog content",
+ Margin = new Thickness(32)
+ };
+ await DialogHost.Show(dialogContent, "RootDialog", options);
+ }
}
diff --git a/src/MainDemo.Wpf/MainWindow.xaml.cs b/src/MainDemo.Wpf/MainWindow.xaml.cs
index 41e24837b7..f88f2766c9 100644
--- a/src/MainDemo.Wpf/MainWindow.xaml.cs
+++ b/src/MainDemo.Wpf/MainWindow.xaml.cs
@@ -74,7 +74,6 @@ private async void MenuPopupButton_OnClick(object sender, RoutedEventArgs e)
{
Message = { Text = ((ButtonBase)sender).Content.ToString() }
};
-
await DialogHost.Show(sampleMessageDialog, "RootDialog");
}
@@ -115,5 +114,5 @@ private static void ModifyTheme(bool isDarkTheme)
private void OnSelectedItemChanged(object sender, DependencyPropertyChangedEventArgs e)
=> MainScrollViewer.ScrollToHome();
-
+
}
diff --git a/src/MaterialDesignThemes.Wpf/DialogHost.cs b/src/MaterialDesignThemes.Wpf/DialogHost.cs
index 2a3bd59f77..0937f2a4b5 100644
--- a/src/MaterialDesignThemes.Wpf/DialogHost.cs
+++ b/src/MaterialDesignThemes.Wpf/DialogHost.cs
@@ -3,10 +3,43 @@
using System.Windows.Data;
using System.Windows.Interop;
using System.Windows.Media;
+using System.Windows.Media.Effects;
using System.Windows.Threading;
namespace MaterialDesignThemes.Wpf;
+public interface IDialogService
+{
+ Task