mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-01-10 12:49:13 +00:00
Move viewModel cast up
This commit is contained in:
parent
03083e72be
commit
7416aeee30
2 changed files with 6 additions and 4 deletions
|
@ -61,14 +61,15 @@ namespace Ryujinx.Ava.UI.Views.Input
|
||||||
|
|
||||||
PointerPressed += MouseClick;
|
PointerPressed += MouseClick;
|
||||||
|
|
||||||
IKeyboard keyboard = (IKeyboard)(DataContext as ControllerInputViewModel).parentModel.AvaloniaKeyboardDriver.GetGamepad("0"); // Open Avalonia keyboard for cancel operations.
|
var viewModel = (DataContext as ControllerInputViewModel);
|
||||||
|
|
||||||
|
IKeyboard keyboard = (IKeyboard)viewModel.parentModel.AvaloniaKeyboardDriver.GetGamepad("0"); // Open Avalonia keyboard for cancel operations.
|
||||||
IButtonAssigner assigner = CreateButtonAssigner(isStick);
|
IButtonAssigner assigner = CreateButtonAssigner(isStick);
|
||||||
|
|
||||||
_currentAssigner.ButtonAssigned += (sender, e) =>
|
_currentAssigner.ButtonAssigned += (sender, e) =>
|
||||||
{
|
{
|
||||||
if (e.ButtonValue.HasValue)
|
if (e.ButtonValue.HasValue)
|
||||||
{
|
{
|
||||||
var viewModel = (DataContext as ControllerInputViewModel);
|
|
||||||
var buttonValue = e.ButtonValue.Value;
|
var buttonValue = e.ButtonValue.Value;
|
||||||
viewModel.parentModel.IsModified = true;
|
viewModel.parentModel.IsModified = true;
|
||||||
|
|
||||||
|
|
|
@ -58,14 +58,15 @@ namespace Ryujinx.Ava.UI.Views.Input
|
||||||
|
|
||||||
PointerPressed += MouseClick;
|
PointerPressed += MouseClick;
|
||||||
|
|
||||||
IKeyboard keyboard = (IKeyboard)(DataContext as KeyboardInputViewModel).parentModel.AvaloniaKeyboardDriver.GetGamepad("0"); // Open Avalonia keyboard for cancel operations.
|
var viewModel = (DataContext as KeyboardInputViewModel);
|
||||||
|
|
||||||
|
IKeyboard keyboard = (IKeyboard)viewModel.parentModel.AvaloniaKeyboardDriver.GetGamepad("0"); // Open Avalonia keyboard for cancel operations.
|
||||||
IButtonAssigner assigner = CreateButtonAssigner();
|
IButtonAssigner assigner = CreateButtonAssigner();
|
||||||
|
|
||||||
_currentAssigner.ButtonAssigned += (sender, e) =>
|
_currentAssigner.ButtonAssigned += (sender, e) =>
|
||||||
{
|
{
|
||||||
if (e.ButtonValue.HasValue)
|
if (e.ButtonValue.HasValue)
|
||||||
{
|
{
|
||||||
var viewModel = (DataContext as KeyboardInputViewModel);
|
|
||||||
var buttonValue = e.ButtonValue.Value;
|
var buttonValue = e.ButtonValue.Value;
|
||||||
viewModel.parentModel.IsModified = true;
|
viewModel.parentModel.IsModified = true;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue