UserWindowViewModel.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. using MVVM;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Collections.ObjectModel;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.Windows;
  9. namespace Work29.ViewModels
  10. {
  11. public class UserWindowViewModel : BaseViewModel
  12. {
  13. private string _userSurnameNamePatonymic;
  14. private string _userLogin;
  15. private string _userPhone;
  16. private RelayCommand _usersLoginWindow;
  17. private RelayCommand _tasksWindow;
  18. public RelayCommand UsersLoginWindow
  19. {
  20. get
  21. {
  22. return _usersLoginWindow ??
  23. (_usersLoginWindow = new RelayCommand(x =>
  24. {
  25. ViewUsersWindow viewUsersWindow = new ViewUsersWindow();
  26. viewUsersWindow.Show();
  27. }
  28. ));
  29. }
  30. }
  31. public RelayCommand TasksWindow
  32. {
  33. get
  34. {
  35. return _tasksWindow ??
  36. (_tasksWindow = new RelayCommand(x =>
  37. {
  38. ViewTasksWindow viewTasksWindow = new ViewTasksWindow();
  39. viewTasksWindow.Show();
  40. }
  41. ));
  42. }
  43. }
  44. public string UserSurnameNamePatonymic
  45. {
  46. get => _userSurnameNamePatonymic = User.a_user.Surname + " " + User.a_user.Name + " " + User.a_user.Patronimyc;
  47. }
  48. public string UserLogin
  49. {
  50. get => _userLogin = User.a_user.Login;
  51. }
  52. public string UserPhone
  53. {
  54. get => _userPhone = User.a_user.Phone;
  55. }
  56. public UserWindowViewModel()
  57. {
  58. Work29Context context = new Work29Context();
  59. }
  60. }
  61. }