diff --git a/DomainModel/Profile/FloatingPanel.cs b/DomainModel/Profile/FloatingPanel.cs index e0e04e0..13c57b5 100644 --- a/DomainModel/Profile/FloatingPanel.cs +++ b/DomainModel/Profile/FloatingPanel.cs @@ -1,4 +1,5 @@ using MSFSPopoutPanelManager.Shared; +using Newtonsoft.Json; namespace MSFSPopoutPanelManager.DomainModel.Profile { @@ -6,6 +7,9 @@ namespace MSFSPopoutPanelManager.DomainModel.Profile { public bool IsEnabled { get; set; } - public string KeyBinding { get; set; } + public string Binding { get; set; } + + [JsonIgnore] + public bool IsDetectingKeystroke { get; set; } } } diff --git a/DomainModel/Profile/PanelConfig.cs b/DomainModel/Profile/PanelConfig.cs index 7e0c33e..7a315e6 100644 --- a/DomainModel/Profile/PanelConfig.cs +++ b/DomainModel/Profile/PanelConfig.cs @@ -18,19 +18,22 @@ namespace MSFSPopoutPanelManager.DomainModel.Profile private void PanelConfig_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { - if (e.PropertyName == nameof(FullScreen) && FullScreen) + var arg = e as PropertyChangedExtendedEventArgs; + + if (arg.PropertyName == nameof(FullScreen) && FullScreen) { AlwaysOnTop = false; HideTitlebar = false; } - else if (e.PropertyName == nameof(TouchEnabled) && TouchEnabled) + else if (arg.PropertyName == nameof(TouchEnabled) && TouchEnabled) { AutoGameRefocus = true; } - else if (e.PropertyName == nameof(FloatingPanel)) + else if (arg.ObjectName == QualifyFullName.Of(nameof(MSFSPopoutPanelManager.DomainModel.Profile.FloatingPanel)) && + arg.PropertyName == nameof(FloatingPanel.IsEnabled)) { - if(!FloatingPanel.IsEnabled) - FloatingPanel.KeyBinding = null; + if (!FloatingPanel.IsEnabled) + FloatingPanel.Binding = null; } } diff --git a/DomainModel/Profile/UserProfile.cs b/DomainModel/Profile/UserProfile.cs index 8ae1c27..a3ff16f 100644 --- a/DomainModel/Profile/UserProfile.cs +++ b/DomainModel/Profile/UserProfile.cs @@ -46,8 +46,6 @@ namespace MSFSPopoutPanelManager.DomainModel.Profile } } - - OnPanelConfigChanged(); }; OnProfileChanged?.Invoke(this, EventArgs.Empty); diff --git a/MainApp/App.xaml.cs b/MainApp/App.xaml.cs index 1c8c945..576e45b 100644 --- a/MainApp/App.xaml.cs +++ b/MainApp/App.xaml.cs @@ -55,9 +55,9 @@ namespace MSFSPopoutPanelManager.MainApp services.AddSingleton(s => new ProfileOrchestrator(SharedStorage)); services.AddSingleton(s => new PanelSourceOrchestrator(SharedStorage, s.GetRequiredService())); services.AddSingleton(s => new PanelPopOutOrchestrator(SharedStorage, s.GetRequiredService(), s.GetRequiredService(), s.GetRequiredService())); - services.AddSingleton(s => new PanelConfigurationOrchestrator(SharedStorage, s.GetRequiredService())); + services.AddSingleton(s => new PanelConfigurationOrchestrator(SharedStorage, s.GetRequiredService(), s.GetRequiredService())); services.AddSingleton(s => new FlightSimOrchestrator(SharedStorage)); - services.AddSingleton(s => new KeyboardOrchestrator(SharedStorage, s.GetRequiredService(), s.GetRequiredService())); + services.AddSingleton(s => new KeyboardOrchestrator(SharedStorage)); services.AddSingleton(s => new HelpOrchestrator()); services.AddSingleton(s => new OrchestratorUiHelper(SharedStorage, s.GetRequiredService(), s.GetRequiredService())); diff --git a/MainApp/AppUserControl/PopOutPanelConfigCard.xaml b/MainApp/AppUserControl/PopOutPanelConfigCard.xaml index 46720a3..f797150 100644 --- a/MainApp/AppUserControl/PopOutPanelConfigCard.xaml +++ b/MainApp/AppUserControl/PopOutPanelConfigCard.xaml @@ -3,6 +3,7 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:c="clr-namespace:CalcBinding;assembly=CalcBinding" + xmlns:converter="clr-namespace:MSFSPopoutPanelManager.MainApp.Converter" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" @@ -16,6 +17,7 @@ 22 28 + - +