using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Rkis29.ViewModel; using Rkis29.Windows; using Rkis29.Command; using System.Collections.ObjectModel; namespace Rkis29.Command { internal class YourProfileCod : BaseViewModel { private RelayCommand _totasks; private ObservableCollection _users; private User _user; public string _YourFCs; private string _YourLogin; private string _YourPhon; public RelayCommand ToTasks { get { return _totasks ?? (_totasks = new RelayCommand((x) => { Tasks taskWindow = new Tasks(); taskWindow.Show(); foreach (var window in App.Current.Windows) { if (window is YourProfile mainWindow) { mainWindow.Close(); } } })); } } public string YourFCs { get => _YourFCs = User.AutoUser.FirstName + " " + User.AutoUser.Name + " " + User.AutoUser.LastName; } public string YourLogin { get => _YourLogin = User.AutoUser.Login;//AutoUser - переменная, которая хранит значения авторизованного пользователя } public string YourPhon { get => _YourPhon = User.AutoUser.PhonNum; } public ObservableCollection Users { get => _users; set { _users = value; OnPropertyChanged(); } } public User User { get => _user; set { _user = value; OnPropertyChanged(); } } public YourProfileCod() { loferlContext loferlcontext = new loferlContext(); _users = new ObservableCollection(loferlcontext.Users); _user = new User(); } } }