Listviews of Products and users

This commit is contained in:
2025-08-21 17:18:35 +02:00
parent 1649eaa992
commit 543b9c2aaf
13 changed files with 358 additions and 41 deletions

View File

@ -25,6 +25,7 @@ public class UserViewModel : ViewModelBase
#region Private Variables
private User? _UserObject = new();
private ObservableCollection<User> _UserList = new();
private readonly IRepository<User>? Repository;
private readonly IRepository<PhoneType>? _PhoneTypeRepository;
private ObservableCollection<string> _PhoneTypesList = new();
@ -43,6 +44,16 @@ public class UserViewModel : ViewModelBase
}
public ObservableCollection<User> UserList
{
get { return _UserList; }
set
{
_UserList = value;
RaisePropertyChanged(nameof(UserList));
}
}
public ObservableCollection<string> PhoneTypesList
{
get { return _PhoneTypesList; }
@ -59,6 +70,11 @@ public class UserViewModel : ViewModelBase
#region Get Method
public ObservableCollection<User> Get()
{
if (Repository != null)
{
UserList = new ObservableCollection<User>(Repository.Get());
}
return new();
}