1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-11-09 01:51:43 +00:00
Ryujinx/Ryujinx.Ava/Ui/Windows/AmiiboWindow.axaml.cs
Nicholas Rodine 951700fdd8
Removed unused usings. (#3593)
* Removed unused usings.

* Added back using, now that it's used.

* Removed extra whitespace.
2022-08-18 18:04:54 +02:00

59 lines
No EOL
1.6 KiB
C#

using Avalonia.Interactivity;
using Ryujinx.Ava.Common.Locale;
using Ryujinx.Ava.Ui.Models;
using Ryujinx.Ava.Ui.ViewModels;
namespace Ryujinx.Ava.Ui.Windows
{
public partial class AmiiboWindow : StyleableWindow
{
public AmiiboWindow(bool showAll, string lastScannedAmiiboId, string titleId)
{
ViewModel = new AmiiboWindowViewModel(this, lastScannedAmiiboId, titleId);
ViewModel.ShowAllAmiibo = showAll;
DataContext = ViewModel;
InitializeComponent();
Title = $"Ryujinx {Program.Version} - " + LocaleManager.Instance["Amiibo"];
}
public AmiiboWindow()
{
ViewModel = new AmiiboWindowViewModel(this, string.Empty, string.Empty);
DataContext = ViewModel;
InitializeComponent();
if (Program.PreviewerDetached)
{
Title = $"Ryujinx {Program.Version} - " + LocaleManager.Instance["Amiibo"];
}
}
public bool IsScanned { get; set; }
public Amiibo.AmiiboApi ScannedAmiibo { get; set; }
public AmiiboWindowViewModel ViewModel { get; set; }
private void ScanButton_Click(object sender, RoutedEventArgs e)
{
if (ViewModel.AmiiboSelectedIndex > -1)
{
Amiibo.AmiiboApi amiibo = ViewModel.AmiiboList[ViewModel.AmiiboSelectedIndex];
ScannedAmiibo = amiibo;
IsScanned = true;
Close();
}
}
private void CancelButton_Click(object sender, RoutedEventArgs e)
{
IsScanned = false;
Close();
}
}
}