diff --git a/src/MainDemo.Wpf/App.xaml.cs b/src/MainDemo.Wpf/App.xaml.cs
index baf62ae0e4..bfe9a86b75 100644
--- a/src/MainDemo.Wpf/App.xaml.cs
+++ b/src/MainDemo.Wpf/App.xaml.cs
@@ -1,4 +1,5 @@
-using MaterialDesign.Shared;
+using System.Reflection;
+using MaterialDesign.Shared;
using MaterialDesignThemes.Wpf;
using ShowMeTheXAML;
@@ -32,7 +33,9 @@ protected override void OnStartup(StartupEventArgs e)
XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag)));
*/
- XamlDisplay.Init();
+ var sharedAssembly
+ = Assembly.GetAssembly(typeof(MaterialDesignDemo.Shared.IMaterialDesignDemoSharedAssemblyMarker));
+ XamlDisplay.Init(sharedAssembly);
// test setup for Persian culture settings
/*System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("fa-Ir");
diff --git a/src/MainDemo.Wpf/Dialogs.xaml b/src/MainDemo.Wpf/Dialogs.xaml
index f109fca585..efd15fe467 100644
--- a/src/MainDemo.Wpf/Dialogs.xaml
+++ b/src/MainDemo.Wpf/Dialogs.xaml
@@ -6,6 +6,7 @@
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:smtx="clr-namespace:ShowMeTheXAML;assembly=ShowMeTheXAML"
+ xmlns:shared="clr-namespace:MaterialDesignDemo.Shared.Examples.Dialogs;assembly=MaterialDesignDemo.Shared"
xmlns:system="clr-namespace:System;assembly=mscorlib"
d:DataContext="{d:DesignInstance domain:DialogsViewModel}"
d:DesignHeight="1080"
@@ -368,5 +369,16 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/MaterialDesign3.Demo.Wpf/Dialogs.xaml b/src/MaterialDesign3.Demo.Wpf/Dialogs.xaml
index 29e1d24f03..fe6975b178 100644
--- a/src/MaterialDesign3.Demo.Wpf/Dialogs.xaml
+++ b/src/MaterialDesign3.Demo.Wpf/Dialogs.xaml
@@ -5,6 +5,7 @@
xmlns:domain="clr-namespace:MaterialDesign3Demo.Domain"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:shared="clr-namespace:MaterialDesignDemo.Shared.Examples.Dialogs;assembly=MaterialDesignDemo.Shared"
xmlns:smtx="clr-namespace:ShowMeTheXAML;assembly=ShowMeTheXAML"
xmlns:system="clr-namespace:System;assembly=mscorlib"
d:DataContext="{d:DesignInstance domain:DialogsViewModel}"
@@ -46,6 +47,7 @@
+
@@ -325,6 +327,14 @@
+
+
+
+
+
+
+
+
diff --git a/src/MaterialDesignDemo.Shared/Examples/Dialogs/DialogHostWaitForExample.xaml b/src/MaterialDesignDemo.Shared/Examples/Dialogs/DialogHostWaitForExample.xaml
new file mode 100644
index 0000000000..5f7f5885f8
--- /dev/null
+++ b/src/MaterialDesignDemo.Shared/Examples/Dialogs/DialogHostWaitForExample.xaml
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/MaterialDesignDemo.Shared/Examples/Dialogs/DialogHostWaitForExample.xaml.cs b/src/MaterialDesignDemo.Shared/Examples/Dialogs/DialogHostWaitForExample.xaml.cs
new file mode 100644
index 0000000000..fe4d9c2c15
--- /dev/null
+++ b/src/MaterialDesignDemo.Shared/Examples/Dialogs/DialogHostWaitForExample.xaml.cs
@@ -0,0 +1,49 @@
+using ShowMeTheXAML;
+
+namespace MaterialDesignDemo.Shared.Examples.Dialogs;
+
+///
+/// Interaction logic for DialogHostWaitForExample.xaml
+///
+public partial class DialogHostWaitForExample : UserControl
+{
+ private DateTime? _sampleOpenClicked;
+ private DateTime? _sampleCloseClicked;
+
+ public DialogHostWaitForExample()
+ {
+ InitializeComponent();
+ }
+
+ private async void Sample_OpenButton_Click(object sender, RoutedEventArgs e)
+ {
+ _sampleOpenClicked = DateTime.Now;
+ Sample_OpenClicked.Text = _sampleOpenClicked.Value.TimeOfDay.ToString(@"hh\:mm\:ss\.fff");
+
+ await SampleDialogHost.WaitForOpened();
+ var openedFinished = DateTime.Now;
+ Sample_OpenedFinished.Text = openedFinished.TimeOfDay.ToString(@"hh\:mm\:ss\.fff");
+
+ if (_sampleOpenClicked.HasValue)
+ {
+ var diff = openedFinished - _sampleOpenClicked.Value;
+ Sample_OpenTimeDifference.Text = ((long)diff.TotalMilliseconds).ToString() + " ms";
+ }
+
+ await SampleDialogHost.WaitForClosed();
+ var closedFinished = DateTime.Now;
+ Sample_ClosedFinished.Text = closedFinished.TimeOfDay.ToString(@"hh\:mm\:ss\.fff");
+
+ if (_sampleCloseClicked.HasValue)
+ {
+ var closeDiff = closedFinished - _sampleCloseClicked.Value;
+ Sample_CloseTimeDifference.Text = ((long)closeDiff.TotalMilliseconds).ToString() + " ms";
+ }
+ }
+
+ private void Sample_CloseButton_Click(object sender, RoutedEventArgs e)
+ {
+ _sampleCloseClicked = DateTime.Now;
+ Sample_CloseClicked.Text = _sampleCloseClicked.Value.TimeOfDay.ToString(@"hh\:mm\:ss\.fff");
+ }
+}
diff --git a/src/MaterialDesignDemo.Shared/IMaterialDesignDemoSharedAssemblyMarker.cs b/src/MaterialDesignDemo.Shared/IMaterialDesignDemoSharedAssemblyMarker.cs
new file mode 100644
index 0000000000..f3e9f00dae
--- /dev/null
+++ b/src/MaterialDesignDemo.Shared/IMaterialDesignDemoSharedAssemblyMarker.cs
@@ -0,0 +1,3 @@
+namespace MaterialDesignDemo.Shared;
+
+public interface IMaterialDesignDemoSharedAssemblyMarker;
diff --git a/src/MaterialDesignDemo.Shared/MaterialDesignDemo.Shared.csproj b/src/MaterialDesignDemo.Shared/MaterialDesignDemo.Shared.csproj
index 65688d2960..39c17d2a44 100644
--- a/src/MaterialDesignDemo.Shared/MaterialDesignDemo.Shared.csproj
+++ b/src/MaterialDesignDemo.Shared/MaterialDesignDemo.Shared.csproj
@@ -1,13 +1,16 @@
-
+
net472;net8.0-windows
true
enable
+ false
+
+