From 41e5d609d3e461b4bed27875e167b02dc8cdb0ee Mon Sep 17 00:00:00 2001 From: sabihoshi Date: Sat, 5 Jun 2021 19:17:41 +0800 Subject: [PATCH] Update Piano Sheet after changing Keyboard Layout --- .../GenshinLyreMidiPlayer.WPF.csproj | 2 +- .../ViewModels/PianoSheetViewModel.cs | 8 ++++++++ GenshinLyreMidiPlayer.WPF/Views/PianoSheetView.xaml | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/GenshinLyreMidiPlayer.WPF/GenshinLyreMidiPlayer.WPF.csproj b/GenshinLyreMidiPlayer.WPF/GenshinLyreMidiPlayer.WPF.csproj index c265461..19480df 100644 --- a/GenshinLyreMidiPlayer.WPF/GenshinLyreMidiPlayer.WPF.csproj +++ b/GenshinLyreMidiPlayer.WPF/GenshinLyreMidiPlayer.WPF.csproj @@ -6,7 +6,7 @@ true GenshinLyreMidiPlayer.WPF.App app.manifest - 2.2.0.1 + 2.2.1 item_windsong_lyre.ico enable https://github.com/sabihoshi/GenshinLyreMidiPlayer diff --git a/GenshinLyreMidiPlayer.WPF/ViewModels/PianoSheetViewModel.cs b/GenshinLyreMidiPlayer.WPF/ViewModels/PianoSheetViewModel.cs index 9a7bedc..2b8979b 100644 --- a/GenshinLyreMidiPlayer.WPF/ViewModels/PianoSheetViewModel.cs +++ b/GenshinLyreMidiPlayer.WPF/ViewModels/PianoSheetViewModel.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Linq; using System.Text; using GenshinLyreMidiPlayer.WPF.Core; @@ -50,6 +51,13 @@ public uint Shorten set => SetAndNotify(ref _shorten, Math.Max(value, 1)); } + [OnChangedMethod(nameof(Update))] + public KeyValuePair SelectedLayout + { + get => SettingsPage.SelectedLayout; + set => SettingsPage.SelectedLayout = value; + } + protected override void OnActivate() { Update(); } public void Update() diff --git a/GenshinLyreMidiPlayer.WPF/Views/PianoSheetView.xaml b/GenshinLyreMidiPlayer.WPF/Views/PianoSheetView.xaml index c739886..c0c135c 100644 --- a/GenshinLyreMidiPlayer.WPF/Views/PianoSheetView.xaml +++ b/GenshinLyreMidiPlayer.WPF/Views/PianoSheetView.xaml @@ -39,7 +39,7 @@