UI - Avalonia Part 3 (#3441)
* 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
This commit is contained in:
parent
bccf5e8b5a
commit
3af42d6c7e
26 changed files with 2901 additions and 23 deletions
71
Ryujinx.Ava/Ui/Windows/AvatarWindow.axaml.cs
Normal file
71
Ryujinx.Ava/Ui/Windows/AvatarWindow.axaml.cs
Normal file
|
@ -0,0 +1,71 @@
|
|||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue