using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Collections.ObjectModel; namespace Task1.ViewModel { class UserWindowVM : BaseViewModel { private ObservableCollection _users; private User _user; private string _fio; private string _phone; private string _login; private RelayCommand _listTask; private RelayCommand _exit; public RelayCommand Exit { get { return _exit ?? (_exit = new RelayCommand((x) => { new MainWindow().Show(); Helper.CloseWindowsAtType(); })); } } public RelayCommand ListTask { get { return _listTask?? (_listTask = new RelayCommand((x) => { new TaskWindow().Show(); Helper.CloseWindowsAtType(); })); } } public ObservableCollection Users { get => _users; set { _users = value; OnPropertyChanged(); } } public User User { get => _user; set { _user = value; OnPropertyChanged(); } } public string FIO { get => _fio = User.AUser.Surname + " " + User.AUser.Name + " " + User.AUser.Patronimyc; } public string Phone { get => _phone = User.AUser.Phone; } public string Login { get => _login = User.AUser.Login; } public UserWindowVM() { TaskContext taskContext = new TaskContext(); _users = new ObservableCollection(taskContext.Users); _user = new User(); } } }