mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-04-22 06:32:56 +00:00
feature: .NET 10 (ryubing/ryujinx!214)
See merge request ryubing/ryujinx!214
This commit is contained in:
@@ -25,14 +25,15 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
{
|
||||
private static readonly Dictionary<string, byte[]> _avatarStore = new();
|
||||
|
||||
[ObservableProperty] private ObservableCollection<ProfileImageModel> _images;
|
||||
[ObservableProperty] private Color _backgroundColor = Colors.White;
|
||||
[ObservableProperty]
|
||||
public partial ObservableCollection<ProfileImageModel> Images { get; set; }
|
||||
|
||||
private int _selectedIndex;
|
||||
[ObservableProperty]
|
||||
public partial Color BackgroundColor { get; set; } = Colors.White;
|
||||
|
||||
public UserFirmwareAvatarSelectorViewModel()
|
||||
{
|
||||
_images = [];
|
||||
Images = [];
|
||||
|
||||
LoadImagesFromStore();
|
||||
PropertyChanged += (_, args) =>
|
||||
@@ -44,21 +45,17 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
|
||||
public int SelectedIndex
|
||||
{
|
||||
get => _selectedIndex;
|
||||
get;
|
||||
set
|
||||
{
|
||||
_selectedIndex = value;
|
||||
field = value;
|
||||
|
||||
if (_selectedIndex == -1)
|
||||
{
|
||||
SelectedImage = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectedImage = Images[_selectedIndex].Data;
|
||||
}
|
||||
SelectedImage = field == -1
|
||||
? null
|
||||
: Images[field].Data;
|
||||
|
||||
OnPropertyChanged();
|
||||
OnPropertyChanged(nameof(SelectedImage));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user