Files
Ryubing/src/Ryujinx/UI/Views/Misc/ApplicationListView.axaml.cs
GreemDev 6e47d8548c feature: UI: LDN Games Viewer
This window can be accessed via "Help" menu in the title bar.
This menu's data is synced with the in-app-list LDN game data, and that has been modified to hide unjoinable games (in-progress and/or private (needing a passphrase)). You can still see these games in the list.
2025-08-30 19:54:00 -05:00

70 lines
2.4 KiB
C#

using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Input.Platform;
using Avalonia.Interactivity;
using Ryujinx.Ava.Systems.AppLibrary;
using Ryujinx.Ava.UI.Controls;
using Ryujinx.Ava.UI.Helpers;
using Ryujinx.Ava.UI.ViewModels;
using Ryujinx.Ava.UI.Windows;
using System;
using System.Linq;
namespace Ryujinx.Ava.UI.Views.Misc
{
public partial class ApplicationListView : RyujinxControl<MainWindowViewModel>
{
public static readonly RoutedEvent<ApplicationOpenedEventArgs> ApplicationOpenedEvent =
RoutedEvent.Register<ApplicationListView, ApplicationOpenedEventArgs>(nameof(ApplicationOpened), RoutingStrategies.Bubble);
public event EventHandler<ApplicationOpenedEventArgs> ApplicationOpened
{
add => AddHandler(ApplicationOpenedEvent, value);
remove => RemoveHandler(ApplicationOpenedEvent, value);
}
public ApplicationListView() => InitializeComponent();
public void GameList_DoubleTapped(object sender, TappedEventArgs args)
{
if (sender is ListBox { SelectedItem: ApplicationData selected })
RaiseEvent(new ApplicationOpenedEventArgs(selected, ApplicationOpenedEvent));
}
private async void PlayabilityStatus_OnClick(object sender, RoutedEventArgs e)
{
if (sender is not Button { Content: TextBlock playabilityLabel })
return;
await CompatibilityListWindow.Show((string)playabilityLabel.Tag);
}
private async void LdnGames_OnClick(object sender, RoutedEventArgs e)
{
if (sender is not Button { Content: TextBlock ldnGamesLabel })
return;
await LdnGamesListWindow.Show((string)ldnGamesLabel.Tag);
}
private async void IdString_OnClick(object sender, RoutedEventArgs e)
{
if (sender is not Button { Content: TextBlock idText })
return;
if (!RyujinxApp.IsClipboardAvailable(out IClipboard clipboard))
return;
ApplicationData appData = ViewModel.Applications.FirstOrDefault(it => it.IdString == idText.Text);
if (appData is null)
return;
await clipboard.SetTextAsync(appData.IdString);
NotificationHelper.ShowInformation(
"Copied Title ID",
$"{appData.Name} ({appData.IdString})");
}
}
}