|
|
@@ -1,10 +1,13 @@
|
|
|
using Avalonia.Controls;
|
|
|
+using Avalonia.Controls.Notifications;
|
|
|
using Avalonia.Input;
|
|
|
using Avalonia.Interactivity;
|
|
|
+using FluentAvalonia.UI.Controls;
|
|
|
using Ryujinx.Ava.UI.Helpers;
|
|
|
using Ryujinx.Ava.UI.ViewModels;
|
|
|
using Ryujinx.UI.App.Common;
|
|
|
using System;
|
|
|
+using System.Linq;
|
|
|
|
|
|
namespace Ryujinx.Ava.UI.Controls
|
|
|
{
|
|
|
@@ -32,5 +35,25 @@ namespace Ryujinx.Ava.UI.Controls
|
|
|
if (DataContext is MainWindowViewModel viewModel && sender is ListBox { SelectedItem: ApplicationData selected })
|
|
|
viewModel.ListSelectedApplication = selected;
|
|
|
}
|
|
|
+
|
|
|
+ private async void IdString_OnClick(object sender, RoutedEventArgs e)
|
|
|
+ {
|
|
|
+ if (DataContext is not MainWindowViewModel mwvm)
|
|
|
+ return;
|
|
|
+
|
|
|
+ if (sender is not Button { Content: TextBlock idText })
|
|
|
+ return;
|
|
|
+
|
|
|
+ if (App.MainWindow.Clipboard is { } clipboard)
|
|
|
+ {
|
|
|
+ var appData = mwvm.Applications.FirstOrDefault(it => it.IdString == idText.Text);
|
|
|
+ if (appData is null)
|
|
|
+ return;
|
|
|
+
|
|
|
+ await clipboard.SetTextAsync(appData.IdString);
|
|
|
+
|
|
|
+ NotificationHelper.Show("Copied Title ID", $"{appData.Name} ({appData.IdString})", NotificationType.Information);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|