From e956864697f2fed9591bb34dcf80f55afcfd0beb Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Wed, 1 Jan 2025 02:26:01 -0600 Subject: [PATCH] misc: Remove needless AsObservableList --- .../UI/ViewModels/MainWindowViewModel.cs | 77 +++++++++---------- 1 file changed, 38 insertions(+), 39 deletions(-) diff --git a/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs b/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs index b7a43ccaf..1e2a29d21 100644 --- a/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs @@ -125,43 +125,6 @@ namespace Ryujinx.Ava.UI.ViewModels private ApplicationData _listSelectedApplication; private ApplicationData _gridSelectedApplication; - public ApplicationData ListSelectedApplication - { - get => _listSelectedApplication; - set - { - _listSelectedApplication = value; - -#pragma warning disable MVVMTK0034 - if (_listSelectedApplication != null && _listAppContextMenu == null) - - ListAppContextMenu = new ApplicationContextMenu(); - else if (_listSelectedApplication == null && _listAppContextMenu != null) - ListAppContextMenu = null!; -#pragma warning restore MVVMTK0034 - - OnPropertyChanged(); - } - } - - public ApplicationData GridSelectedApplication - { - get => _gridSelectedApplication; - set - { - _gridSelectedApplication = value; - -#pragma warning disable MVVMTK0034 - if (_gridSelectedApplication != null && _gridAppContextMenu == null) - GridAppContextMenu = new ApplicationContextMenu(); - else if (_gridSelectedApplication == null && _gridAppContextMenu != null) - GridAppContextMenu = null!; -#pragma warning restore MVVMTK0034 - - OnPropertyChanged(); - } - } - // Key is Title ID public SafeDictionary LdnData = []; @@ -185,9 +148,8 @@ namespace Ryujinx.Ava.UI.ViewModels .OnItemAdded(_ => OnPropertyChanged(nameof(AppsObservableList))) .OnItemRemoved(_ => OnPropertyChanged(nameof(AppsObservableList))) #pragma warning disable MVVMTK0034 // Event to update is fired below - .Bind(out _appsObservableList) + .Bind(out _appsObservableList); #pragma warning restore MVVMTK0034 - .AsObservableList(); _rendererWaitEvent = new AutoResetEvent(false); @@ -335,6 +297,43 @@ namespace Ryujinx.Ava.UI.ViewModels OnPropertyChanged(nameof(ShowFirmwareStatus)); } } + + public ApplicationData ListSelectedApplication + { + get => _listSelectedApplication; + set + { + _listSelectedApplication = value; + +#pragma warning disable MVVMTK0034 + if (_listSelectedApplication != null && _listAppContextMenu == null) + + ListAppContextMenu = new ApplicationContextMenu(); + else if (_listSelectedApplication == null && _listAppContextMenu != null) + ListAppContextMenu = null!; +#pragma warning restore MVVMTK0034 + + OnPropertyChanged(); + } + } + + public ApplicationData GridSelectedApplication + { + get => _gridSelectedApplication; + set + { + _gridSelectedApplication = value; + +#pragma warning disable MVVMTK0034 + if (_gridSelectedApplication != null && _gridAppContextMenu == null) + GridAppContextMenu = new ApplicationContextMenu(); + else if (_gridSelectedApplication == null && _gridAppContextMenu != null) + GridAppContextMenu = null!; +#pragma warning restore MVVMTK0034 + + OnPropertyChanged(); + } + } public ApplicationData SelectedApplication {