From c5ff7496a207d6127b97f7069f38209487f635c6 Mon Sep 17 00:00:00 2001 From: Corvin <43533385+corvinsz@users.noreply.github.com> Date: Fri, 4 Sep 2026 22:20:31 +0200 Subject: [PATCH 1/5] trying to add DialogHost.WaitFor* examples to demo apps Tried to add DialogHost.WaitFor* examples to demo apps but there seems to be a problem with ShowMeTheXaml or the demo apps setup --- src/MainDemo.Wpf/App.xaml.cs | 7 +- src/MainDemo.Wpf/Dialogs.xaml | 12 +++ src/MaterialDesign3.Demo.Wpf/Dialogs.xaml | 10 ++ .../Dialogs/DialogHostWaitForExample.xaml | 99 +++++++++++++++++++ .../Dialogs/DialogHostWaitForExample.xaml.cs | 49 +++++++++ ...IMaterialDesignDemoSharedAssemblyMarker.cs | 3 + .../MaterialDesignDemo.Shared.csproj | 4 +- 7 files changed, 181 insertions(+), 3 deletions(-) create mode 100644 src/MaterialDesignDemo.Shared/Examples/Dialogs/DialogHostWaitForExample.xaml create mode 100644 src/MaterialDesignDemo.Shared/Examples/Dialogs/DialogHostWaitForExample.xaml.cs create mode 100644 src/MaterialDesignDemo.Shared/IMaterialDesignDemoSharedAssemblyMarker.cs 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..fc3fbc8bd8 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..1971464f07 --- /dev/null +++ b/src/MaterialDesignDemo.Shared/Examples/Dialogs/DialogHostWaitForExample.xaml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + +