This commit is contained in:
Isaac Marovitz 2023-05-18 14:36:01 -04:00 committed by Isaac Marovitz
parent d224996c15
commit d738da55a7
3 changed files with 26 additions and 6 deletions

View file

@ -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;
}
}
}

View file

@ -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()

View file

@ -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;
}
}
}