From 05b404d504ea01072b95477867f9ee32cc43c588 Mon Sep 17 00:00:00 2001 From: TheXamlGuy Date: Tue, 9 Jan 2024 20:32:07 +0000 Subject: [PATCH] Rip out Microsoft's configuration and replace because it simply doesn't support polymorphism.... we are getting advanced boys!!! --- .../DesktopFlyout/DesktopFlyoutHost.cs | 5 +- .../DesktopFlyout/DesktopFlyoutPresenter.cs | 2 +- .../DesktopFlyout/DesktopFlyoutPresenter.xaml | 28 +-- Hyperbar.Windows.Interop/VirtualKeyboard.cs | 3 +- .../IPrimaryCommandConfiguration.cs | 9 +- .../KeyAcceleratorCommandConfiguration.cs | 10 +- .../PrimaryWidgetConfiguration.cs | 4 +- .../PrimaryWidgetProvider.cs | 2 +- .../ProcessCommandConfiguration.cs | 7 + .../WidgetComponentMapping.cs | 17 +- Hyperbar.Windows/App.xaml.cs | 5 +- .../IServiceCollectionExtensions.cs | 2 +- .../Mediators/KeyAcceleratorHandler.cs | 20 +- Hyperbar.Windows/Views/WidgetButtonView.xaml | 7 +- Hyperbar.Windows/Views/WidgetView.xaml.cs | 11 +- ...torCommand.cs => KeyAcceleratorRequest.cs} | 2 +- Hyperbar/Commands/ProcessRequest.cs | 3 + Hyperbar/Configuration/ConfigurationWriter.cs | 57 +++++- .../IServiceCollectionExtensions.cs | 188 ++++++++++-------- 19 files changed, 247 insertions(+), 135 deletions(-) create mode 100644 Hyperbar.Windows.Primary/ProcessCommandConfiguration.cs rename Hyperbar/Commands/{KeyAcceleratorCommand.cs => KeyAcceleratorRequest.cs} (59%) create mode 100644 Hyperbar/Commands/ProcessRequest.cs diff --git a/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyoutHost.cs b/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyoutHost.cs index cab0abd..aa180e6 100644 --- a/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyoutHost.cs +++ b/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyoutHost.cs @@ -3,6 +3,7 @@ using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Controls.Primitives; using Hyperbar.Windows.UI; using Hyperbar.Windows.Interop; +using Windows.Foundation; namespace Hyperbar.Windows.Controls; @@ -37,8 +38,8 @@ internal class DesktopFlyoutHost : Window { return; } - - // presenter.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity)); + + presenter.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity)); double height = presenter.DesiredSize.Height; double width = presenter.DesiredSize.Width; diff --git a/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyoutPresenter.cs b/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyoutPresenter.cs index 4dd59b0..cdfb884 100644 --- a/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyoutPresenter.cs +++ b/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyoutPresenter.cs @@ -12,7 +12,7 @@ public class DesktopFlyoutPresenter : typeof(DesktopFlyoutPresenterTemplateSettings), typeof(DesktopFlyoutPresenter), new PropertyMetadata(null)); - internal new DesktopFlyout Parent; + internal new DesktopFlyout? Parent; public DesktopFlyoutPresenter() { diff --git a/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyoutPresenter.xaml b/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyoutPresenter.xaml index 40676c4..e6cc739 100644 --- a/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyoutPresenter.xaml +++ b/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyoutPresenter.xaml @@ -5,21 +5,22 @@ xmlns:controls="using:Hyperbar.Windows.Controls"> - - - + + + - - - + + + + 1