diff --git a/src/Ryujinx/UI/Controls/ApplicationGridView.axaml b/src/Ryujinx/UI/Controls/ApplicationGridView.axaml index 3bcb468ae..629bdebbf 100644 --- a/src/Ryujinx/UI/Controls/ApplicationGridView.axaml +++ b/src/Ryujinx/UI/Controls/ApplicationGridView.axaml @@ -15,7 +15,6 @@ x:DataType="viewModels:MainWindowViewModel"> - @@ -26,10 +25,10 @@ Padding="8" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" - ContextFlyout="{StaticResource ApplicationContextMenu}" + SelectedItem="{Binding GridSelectedApplication}" + ContextFlyout="{Binding GridAppContextMenu}" DoubleTapped="GameList_DoubleTapped" - ItemsSource="{Binding AppsObservableList}" - SelectionChanged="GameList_SelectionChanged"> + ItemsSource="{Binding AppsObservableList}"> - @@ -28,10 +26,10 @@ Padding="8" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" - ContextFlyout="{StaticResource ApplicationContextMenu}" + SelectedItem="{Binding ListSelectedApplication}" + ContextFlyout="{Binding ListAppContextMenu}" DoubleTapped="GameList_DoubleTapped" - ItemsSource="{Binding AppsObservableList}" - SelectionChanged="GameList_SelectionChanged"> + ItemsSource="{Binding AppsObservableList}"> _listSelectedApplication; + set + { + _listSelectedApplication = value; + + if (_listSelectedApplication != null && _listAppContextMenu == null) + ListAppContextMenu = new ApplicationContextMenu(); + else if (_listSelectedApplication == null && _listAppContextMenu != null) + ListAppContextMenu = null; + + OnPropertyChanged(); + } + } + + public ApplicationData GridSelectedApplication + { + get => _gridSelectedApplication; + set + { + _gridSelectedApplication = value; + + if (_gridSelectedApplication != null && _gridAppContextMenu == null) + GridAppContextMenu = new ApplicationContextMenu(); + else if (_gridSelectedApplication == null && _gridAppContextMenu != null) + GridAppContextMenu = null; + + OnPropertyChanged(); + } + } // Key is Title ID public SafeDictionary LdnData = []; @@ -218,7 +252,7 @@ namespace Ryujinx.Ava.UI.ViewModels public bool CanUpdate { - get => _canUpdate && EnableNonGameRunningControls && Updater.CanUpdate(false); + get => _canUpdate && EnableNonGameRunningControls && Updater.CanUpdate(); set { _canUpdate = value; @@ -247,6 +281,28 @@ namespace Ryujinx.Ava.UI.ViewModels } } + public ApplicationContextMenu ListAppContextMenu + { + get => _listAppContextMenu; + set + { + _listAppContextMenu = value; + + OnPropertyChanged(); + } + } + + public ApplicationContextMenu GridAppContextMenu + { + get => _gridAppContextMenu; + set + { + _gridAppContextMenu = value; + + OnPropertyChanged(); + } + } + public bool IsPaused { get => _isPaused;