mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-03-19 13:20:18 +00:00
69 lines
No EOL
2 KiB
C#
69 lines
No EOL
2 KiB
C#
using Avalonia;
|
|
using Avalonia.Controls;
|
|
using Avalonia.Input;
|
|
using Avalonia.Interactivity;
|
|
using Avalonia.Styling;
|
|
using Avalonia.Threading;
|
|
using DynamicData;
|
|
using FluentAvalonia.UI.Controls;
|
|
using Ryujinx.Ava.Common.Locale;
|
|
using Ryujinx.Ava.UI.ViewModels;
|
|
using Ryujinx.Common.Utilities;
|
|
using Ryujinx.Ui.Common.Helper;
|
|
using System.Net.Http;
|
|
using System.Net.NetworkInformation;
|
|
using System.Threading.Tasks;
|
|
using Button = Avalonia.Controls.Button;
|
|
|
|
namespace Ryujinx.Ava.UI.Windows
|
|
{
|
|
public partial class AboutWindow : UserControl
|
|
{
|
|
public AboutWindow()
|
|
{
|
|
DataContext = new AboutWindowViewModel();
|
|
|
|
InitializeComponent();
|
|
}
|
|
|
|
public static async Task Show()
|
|
{
|
|
var content = new AboutWindow();
|
|
|
|
ContentDialog contentDialog = new ContentDialog
|
|
{
|
|
PrimaryButtonText = "",
|
|
SecondaryButtonText = "",
|
|
CloseButtonText = LocaleManager.Instance["UserProfilesClose"],
|
|
Content = content
|
|
};
|
|
|
|
Style closeButton = new(x => x.Name("CloseButton"));
|
|
closeButton.Setters.Add(new Setter(WidthProperty, 70d));
|
|
|
|
Style closeButtonParent = new(x => x.Name("CommandSpace"));
|
|
closeButtonParent.Setters.Add(new Setter(HorizontalAlignmentProperty, Avalonia.Layout.HorizontalAlignment.Right));
|
|
|
|
contentDialog.Styles.Add(closeButton);
|
|
contentDialog.Styles.Add(closeButtonParent);
|
|
|
|
await contentDialog.ShowAsync();
|
|
}
|
|
|
|
private void Button_OnClick(object sender, RoutedEventArgs e)
|
|
{
|
|
if (sender is Button button)
|
|
{
|
|
OpenHelper.OpenUrl(button.Tag.ToString());
|
|
}
|
|
}
|
|
|
|
private void AmiiboLabel_OnPointerPressed(object sender, PointerPressedEventArgs e)
|
|
{
|
|
if (sender is TextBlock)
|
|
{
|
|
OpenHelper.OpenUrl("https://amiiboapi.com");
|
|
}
|
|
}
|
|
}
|
|
} |