mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-11-08 18:58:40 +00:00
3af42d6c7e
* Add all other windows * addreesed review * Prevent "No Update" option from being deleted * Select no update is the current update is removed from the title update window * fix amiibo crash
71 lines
1.8 KiB
C#
71 lines
1.8 KiB
C#
using Avalonia;
|
|
using Avalonia.Interactivity;
|
|
using Avalonia.Markup.Xaml;
|
|
using Ryujinx.Ava.Common.Locale;
|
|
using Ryujinx.Ava.Ui.ViewModels;
|
|
using Ryujinx.HLE.FileSystem;
|
|
using System;
|
|
|
|
namespace Ryujinx.Ava.Ui.Windows
|
|
{
|
|
public class AvatarWindow : StyleableWindow
|
|
{
|
|
public AvatarWindow(ContentManager contentManager)
|
|
{
|
|
ContentManager = contentManager;
|
|
ViewModel = new AvatarProfileViewModel(() => ViewModel.ReloadImages());
|
|
|
|
DataContext = ViewModel;
|
|
|
|
InitializeComponent();
|
|
#if DEBUG
|
|
this.AttachDevTools();
|
|
#endif
|
|
Title = $"Ryujinx {Program.Version} - " + LocaleManager.Instance["AvatarWindowTitle"];
|
|
}
|
|
|
|
public AvatarWindow()
|
|
{
|
|
InitializeComponent();
|
|
#if DEBUG
|
|
this.AttachDevTools();
|
|
#endif
|
|
if (Program.PreviewerDetached)
|
|
{
|
|
Title = $"Ryujinx {Program.Version} - " + LocaleManager.Instance["AvatarWindowTitle"];
|
|
}
|
|
}
|
|
|
|
public ContentManager ContentManager { get; }
|
|
|
|
public byte[] SelectedImage { get; set; }
|
|
|
|
internal AvatarProfileViewModel ViewModel { get; set; }
|
|
|
|
private void InitializeComponent()
|
|
{
|
|
AvaloniaXamlLoader.Load(this);
|
|
}
|
|
|
|
protected override void OnClosed(EventArgs e)
|
|
{
|
|
ViewModel.Dispose();
|
|
base.OnClosed(e);
|
|
}
|
|
|
|
private void CloseButton_OnClick(object sender, RoutedEventArgs e)
|
|
{
|
|
Close();
|
|
}
|
|
|
|
private void ChooseButton_OnClick(object sender, RoutedEventArgs e)
|
|
{
|
|
if (ViewModel.SelectedIndex > -1)
|
|
{
|
|
SelectedImage = ViewModel.SelectedImage;
|
|
|
|
Close();
|
|
}
|
|
}
|
|
}
|
|
} |