Add the player select applet. #537
@ -6,6 +6,7 @@ using Ryujinx.Ava.Common.Locale;
|
|||||||
using Ryujinx.Ava.UI.Controls;
|
using Ryujinx.Ava.UI.Controls;
|
||||||
using Ryujinx.Ava.UI.Helpers;
|
using Ryujinx.Ava.UI.Helpers;
|
||||||
using Ryujinx.Ava.UI.ViewModels;
|
using Ryujinx.Ava.UI.ViewModels;
|
||||||
|
using Ryujinx.Ava.UI.ViewModels.Input;
|
||||||
using Ryujinx.Ava.UI.Windows;
|
using Ryujinx.Ava.UI.Windows;
|
||||||
using Ryujinx.Ava.Utilities.Configuration;
|
using Ryujinx.Ava.Utilities.Configuration;
|
||||||
using Ryujinx.Common;
|
using Ryujinx.Common;
|
||||||
@ -278,9 +279,11 @@ namespace Ryujinx.Ava.UI.Applet
|
|||||||
.ForEach(profile => profiles.Add(new Models.UserProfile(profile, nav)));
|
.ForEach(profile => profiles.Add(new Models.UserProfile(profile, nav)));
|
||||||
|
|
||||||
profiles.Add(new Models.UserProfile(guest, nav));
|
profiles.Add(new Models.UserProfile(guest, nav));
|
||||||
|
UserSelectorDialogViewModel ViewModel = new();
|
||||||
UserSelectorDialog content = new(profiles);
|
ViewModel.Profiles = profiles;
|
||||||
(UserId id, _) = await UserSelectorDialog.ShowInputDialog(content, _parent.AccountManager.LastOpenedUser);
|
ViewModel.SelectedUserId = _parent.AccountManager.LastOpenedUser.UserId;
|
||||||
|
UserSelectorDialog content = new(ViewModel);
|
||||||
|
(UserId id, _) = await UserSelectorDialog.ShowInputDialog(content);
|
||||||
|
|
||||||
selected = id;
|
selected = id;
|
||||||
|
|
||||||
|
@ -2,27 +2,24 @@
|
|||||||
x:Class="Ryujinx.Ava.UI.Applet.UserSelectorDialog"
|
x:Class="Ryujinx.Ava.UI.Applet.UserSelectorDialog"
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:ext="clr-namespace:Ryujinx.Ava.Common.Markup"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers"
|
xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers"
|
||||||
xmlns:models="clr-namespace:Ryujinx.Ava.UI.Models"
|
xmlns:models="clr-namespace:Ryujinx.Ava.UI.Models"
|
||||||
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
|
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
|
||||||
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
|
||||||
xmlns:applet="clr-namespace:Ryujinx.Ava.UI.Applet"
|
|
||||||
d:DesignHeight="450"
|
d:DesignHeight="450"
|
||||||
MinWidth="500"
|
MinWidth="500"
|
||||||
d:DesignWidth="800"
|
d:DesignWidth="800"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Focusable="True"
|
Focusable="True"
|
||||||
x:DataType="applet:UserSelectorDialog">
|
x:DataType="viewModels:UserSelectorDialogViewModel">
|
||||||
|
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<helpers:BitmapArrayValueConverter x:Key="ByteImage" />
|
<helpers:BitmapArrayValueConverter x:Key="ByteImage" />
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
|
|
||||||
<Design.DataContext>
|
<Design.DataContext>
|
||||||
<applet:UserSelectorDialog />
|
<viewModels:UserSelectorDialogViewModel />
|
||||||
</Design.DataContext>
|
</Design.DataContext>
|
||||||
|
|
||||||
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||||
|
@ -6,6 +6,7 @@ using Ryujinx.Ava.Common.Locale;
|
|||||||
|
|||||||
using Ryujinx.Ava.UI.Controls;
|
using Ryujinx.Ava.UI.Controls;
|
||||||
using Ryujinx.Ava.UI.Helpers;
|
using Ryujinx.Ava.UI.Helpers;
|
||||||
using Ryujinx.Ava.UI.ViewModels;
|
using Ryujinx.Ava.UI.ViewModels;
|
||||||
|
using Ryujinx.Ava.UI.ViewModels.Input;
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.HLE.HOS.Services.Account.Acc;
|
using Ryujinx.HLE.HOS.Services.Account.Acc;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
@ -19,36 +20,15 @@ namespace Ryujinx.Ava.UI.Applet
|
|||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
{
|
{
|
||||||
public partial class UserSelectorDialog : UserControl, INotifyPropertyChanged
|
public partial class UserSelectorDialog : UserControl, INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
public new event PropertyChangedEventHandler PropertyChanged;
|
public UserSelectorDialogViewModel ViewModel { get; set; }
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
|
|
||||||
private UserId _selectedUserId;
|
public UserSelectorDialog(UserSelectorDialogViewModel viewModel)
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
private ObservableCollection<BaseModel> _profiles;
|
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
|
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
public ObservableCollection<BaseModel> Profiles
|
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
{
|
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
get => _profiles;
|
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
set
|
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
{
|
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
if (_profiles != value)
|
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
{
|
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
_profiles = value;
|
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
OnPropertyChanged();
|
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
}
|
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
}
|
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
}
|
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
|
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
public UserSelectorDialog(ObservableCollection<BaseModel> profiles)
|
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
Profiles = profiles;
|
ViewModel = viewModel;
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
DataContext = this;
|
DataContext = ViewModel;
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
}
|
}
|
||||||
|
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = "")
|
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
{
|
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
}
|
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
|
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
private void Grid_PointerEntered(object sender, PointerEventArgs e)
|
private void Grid_PointerEntered(object sender, PointerEventArgs e)
|
||||||
{
|
{
|
||||||
if (sender is Grid { DataContext: UserProfile profile })
|
if (sender is Grid { DataContext: UserProfile profile })
|
||||||
@ -71,22 +51,22 @@ namespace Ryujinx.Ava.UI.Applet
|
|||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
{
|
{
|
||||||
int selectedIndex = listBox.SelectedIndex;
|
int selectedIndex = listBox.SelectedIndex;
|
||||||
|
|
||||||
if (selectedIndex >= 0 && selectedIndex < Profiles.Count)
|
if (selectedIndex >= 0 && selectedIndex < ViewModel.Profiles.Count)
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
{
|
{
|
||||||
if (Profiles[selectedIndex] is UserProfile userProfile)
|
if (ViewModel.Profiles[selectedIndex] is UserProfile userProfile)
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
{
|
{
|
||||||
_selectedUserId = userProfile.UserId;
|
ViewModel.SelectedUserId = userProfile.UserId;
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
Logger.Info?.Print(LogClass.UI, $"Selected user: {userProfile.UserId}");
|
Logger.Info?.Print(LogClass.UI, $"Selected user: {userProfile.UserId}");
|
||||||
|
|
||||||
ObservableCollection<BaseModel> newProfiles = [];
|
ObservableCollection<BaseModel> newProfiles = [];
|
||||||
|
|
||||||
foreach (var item in Profiles)
|
foreach (var item in ViewModel.Profiles)
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
{
|
{
|
||||||
if (item is UserProfile originalItem)
|
if (item is UserProfile originalItem)
|
||||||
{
|
{
|
||||||
var profile = new UserProfileSft(originalItem.UserId, originalItem.Name, originalItem.Image);
|
var profile = new UserProfileSft(originalItem.UserId, originalItem.Name, originalItem.Image);
|
||||||
|
|
||||||
if (profile.UserId == _selectedUserId)
|
if (profile.UserId == ViewModel.SelectedUserId)
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
{
|
{
|
||||||
profile.AccountState = AccountState.Open;
|
profile.AccountState = AccountState.Open;
|
||||||
}
|
}
|
||||||
@ -95,16 +75,14 @@ namespace Ryujinx.Ava.UI.Applet
|
|||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Profiles = newProfiles;
|
ViewModel.Profiles = newProfiles;
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task<(UserId Id, bool Result)> ShowInputDialog(UserSelectorDialog content, UserProfileSft accountManagerLastOpenedUser)
|
public static async Task<(UserId Id, bool Result)> ShowInputDialog(UserSelectorDialog content)
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
{
|
{
|
||||||
content._selectedUserId = accountManagerLastOpenedUser.UserId;
|
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
|
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
ContentDialog contentDialog = new()
|
ContentDialog contentDialog = new()
|
||||||
{
|
{
|
||||||
Title = LocaleManager.Instance[LocaleKeys.UserProfileWindowTitle],
|
Title = LocaleManager.Instance[LocaleKeys.UserProfileWindowTitle],
|
||||||
@ -124,7 +102,7 @@ namespace Ryujinx.Ava.UI.Applet
|
|||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
{
|
{
|
||||||
if (contentDialog.Content is UserSelectorDialog view)
|
if (contentDialog.Content is UserSelectorDialog view)
|
||||||
{
|
{
|
||||||
result = view._selectedUserId;
|
result = view.ViewModel.SelectedUserId;
|
||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
|||||||
input = true;
|
input = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]()
`sender is Grid { DataContext: UserProfile profile }`
![]() Identical to above Identical to above
![]() Identical to above Identical to above
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
![]() The value names in tuples should be PascalCase; The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
|
43
src/Ryujinx/UI/ViewModels/UserSelectorDialogViewModel.cs
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
using Ryujinx.HLE.HOS.Services.Account.Acc;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
|
||||||
|
namespace Ryujinx.Ava.UI.ViewModels
|
||||||
|
{
|
||||||
|
public partial class UserSelectorDialogViewModel : BaseModel
|
||||||
|
{
|
||||||
|
private UserId _selectedUserId;
|
||||||
|
private ObservableCollection<BaseModel> _profiles;
|
||||||
|
|
||||||
|
public UserId SelectedUserId
|
||||||
|
{
|
||||||
|
get => _selectedUserId;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_selectedUserId != value)
|
||||||
|
{
|
||||||
|
_selectedUserId = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObservableCollection<BaseModel> Profiles
|
||||||
|
{
|
||||||
|
get => _profiles;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_profiles != value)
|
||||||
|
{
|
||||||
|
_profiles = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserSelectorDialogViewModel()
|
||||||
|
{
|
||||||
|
Profiles = new ObservableCollection<BaseModel>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
sender is Grid { DataContext: UserProfile profile }
sender is Grid { DataContext: UserProfile profile }
Identical to above
Identical to above
The value names in tuples should be PascalCase;
Task<(UserId Id, bool Result)>
The value names in tuples should be PascalCase;
Task<(UserId Id, bool Result)>