2022-08-18 12:04:54 -04:00
|
|
|
|
using Avalonia.Controls;
|
2022-05-15 07:30:15 -04:00
|
|
|
|
using Avalonia.Input;
|
|
|
|
|
using Avalonia.Interactivity;
|
2023-01-06 19:29:18 -05:00
|
|
|
|
using Avalonia.Styling;
|
|
|
|
|
using FluentAvalonia.UI.Controls;
|
2022-05-15 07:30:15 -04:00
|
|
|
|
using Ryujinx.Ava.Common.Locale;
|
2023-01-08 22:37:20 -05:00
|
|
|
|
using Ryujinx.Ava.UI.Helpers;
|
2023-01-06 19:29:18 -05:00
|
|
|
|
using Ryujinx.Ava.UI.ViewModels;
|
2022-05-15 07:30:15 -04:00
|
|
|
|
using Ryujinx.Ui.Common.Helper;
|
|
|
|
|
using System.Threading.Tasks;
|
2023-01-06 19:29:18 -05:00
|
|
|
|
using Button = Avalonia.Controls.Button;
|
2022-05-15 07:30:15 -04:00
|
|
|
|
|
2022-12-29 09:24:05 -05:00
|
|
|
|
namespace Ryujinx.Ava.UI.Windows
|
2022-05-15 07:30:15 -04:00
|
|
|
|
{
|
2023-01-06 19:29:18 -05:00
|
|
|
|
public partial class AboutWindow : UserControl
|
2022-05-15 07:30:15 -04:00
|
|
|
|
{
|
|
|
|
|
public AboutWindow()
|
|
|
|
|
{
|
2023-01-06 19:29:18 -05:00
|
|
|
|
DataContext = new AboutWindowViewModel();
|
2022-05-15 07:30:15 -04:00
|
|
|
|
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-06 19:29:18 -05:00
|
|
|
|
public static async Task Show()
|
2022-05-15 07:30:15 -04:00
|
|
|
|
{
|
2023-01-06 19:29:18 -05:00
|
|
|
|
ContentDialog contentDialog = new()
|
2022-05-15 07:30:15 -04:00
|
|
|
|
{
|
2023-01-08 22:37:20 -05:00
|
|
|
|
PrimaryButtonText = "",
|
2023-01-06 19:29:18 -05:00
|
|
|
|
SecondaryButtonText = "",
|
2023-01-08 22:37:20 -05:00
|
|
|
|
CloseButtonText = LocaleManager.Instance[LocaleKeys.UserProfilesClose],
|
|
|
|
|
Content = new AboutWindow()
|
2023-01-06 19:29:18 -05:00
|
|
|
|
};
|
2022-05-15 07:30:15 -04:00
|
|
|
|
|
2023-01-06 19:29:18 -05:00
|
|
|
|
Style closeButton = new(x => x.Name("CloseButton"));
|
|
|
|
|
closeButton.Setters.Add(new Setter(WidthProperty, 80d));
|
2022-05-15 07:30:15 -04:00
|
|
|
|
|
2023-01-06 19:29:18 -05:00
|
|
|
|
Style closeButtonParent = new(x => x.Name("CommandSpace"));
|
|
|
|
|
closeButtonParent.Setters.Add(new Setter(HorizontalAlignmentProperty, Avalonia.Layout.HorizontalAlignment.Right));
|
2022-05-15 07:30:15 -04:00
|
|
|
|
|
2023-01-06 19:29:18 -05:00
|
|
|
|
contentDialog.Styles.Add(closeButton);
|
|
|
|
|
contentDialog.Styles.Add(closeButtonParent);
|
2022-05-15 07:30:15 -04:00
|
|
|
|
|
2023-01-08 22:37:20 -05:00
|
|
|
|
await ContentDialogHelper.ShowAsync(contentDialog);
|
2023-01-06 19:29:18 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Button_OnClick(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (sender is Button button)
|
2022-05-15 07:30:15 -04:00
|
|
|
|
{
|
2023-01-06 19:29:18 -05:00
|
|
|
|
OpenHelper.OpenUrl(button.Tag.ToString());
|
2022-05-15 07:30:15 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void AmiiboLabel_OnPointerPressed(object sender, PointerPressedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (sender is TextBlock)
|
|
|
|
|
{
|
|
|
|
|
OpenHelper.OpenUrl("https://amiiboapi.com");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|