diff --git a/src/Ryujinx.Ava/UI/ViewModels/Input/ControllerInputViewModel.cs b/src/Ryujinx.Ava/UI/ViewModels/Input/ControllerInputViewModel.cs index 7a64f8206..34d7ac2cf 100644 --- a/src/Ryujinx.Ava/UI/ViewModels/Input/ControllerInputViewModel.cs +++ b/src/Ryujinx.Ava/UI/ViewModels/Input/ControllerInputViewModel.cs @@ -50,6 +50,8 @@ namespace Ryujinx.Ava.UI.ViewModels.Input } } + public InputViewModel parentModel; + public async void ShowMotionConfig() { await MotionInputView.Show(this); @@ -62,10 +64,17 @@ namespace Ryujinx.Ava.UI.ViewModels.Input public ControllerInputViewModel(InputViewModel model, ControllerInputConfig config) { - IsLeft = model.IsLeft; - IsRight = model.IsRight; - Image = model.Image; + parentModel = model; + model.NotifyChangesEvent += UpdateParentModelValues; + UpdateParentModelValues(); Config = config; } + + public void UpdateParentModelValues() + { + IsLeft = parentModel.IsLeft; + IsRight = parentModel.IsRight; + Image = parentModel.Image; + } } } \ No newline at end of file diff --git a/src/Ryujinx.Ava/UI/ViewModels/Input/InputViewModel.cs b/src/Ryujinx.Ava/UI/ViewModels/Input/InputViewModel.cs index 4b9dddae4..0c0258679 100644 --- a/src/Ryujinx.Ava/UI/ViewModels/Input/InputViewModel.cs +++ b/src/Ryujinx.Ava/UI/ViewModels/Input/InputViewModel.cs @@ -71,6 +71,7 @@ namespace Ryujinx.Ava.UI.ViewModels.Input public bool IsLeft { get; set; } public bool IsModified { get; set; } + public event Action NotifyChangesEvent; public object ConfigViewModel { @@ -873,6 +874,7 @@ namespace Ryujinx.Ava.UI.ViewModels.Input OnPropertyChanged(nameof(IsKeyboard)); OnPropertyChanged(nameof(IsRight)); OnPropertyChanged(nameof(IsLeft)); + NotifyChangesEvent?.Invoke(); } public void Dispose() diff --git a/src/Ryujinx.Ava/UI/ViewModels/Input/KeyboardInputViewModel.cs b/src/Ryujinx.Ava/UI/ViewModels/Input/KeyboardInputViewModel.cs index 4025e4a3c..6e886d0b8 100644 --- a/src/Ryujinx.Ava/UI/ViewModels/Input/KeyboardInputViewModel.cs +++ b/src/Ryujinx.Ava/UI/ViewModels/Input/KeyboardInputViewModel.cs @@ -49,12 +49,21 @@ namespace Ryujinx.Ava.UI.ViewModels.Input } } + public InputViewModel parentModel; + public KeyboardInputViewModel(InputViewModel model, KeyboardInputConfig config) { - IsLeft = model.IsLeft; - IsRight = model.IsRight; - Image = model.Image; + parentModel = model; + model.NotifyChangesEvent += UpdateParentModelValues; + UpdateParentModelValues(); Config = config; } + + public void UpdateParentModelValues() + { + IsLeft = parentModel.IsLeft; + IsRight = parentModel.IsRight; + Image = parentModel.Image; + } } } \ No newline at end of file