UserViewModel.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using Microsoft.Toolkit.Mvvm.Input;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using MyMoviesWPF.MVVM.View;
  7. using MyMoviesWPF.MVVM.View.UserInit;
  8. namespace MyMoviesWPF.MVVM.ViewModel
  9. {
  10. public class UserViewModel : BaseViewModel
  11. {
  12. public RelayCommand<object> OpenLogInWindow
  13. {
  14. get => new RelayCommand<object>(o =>
  15. {
  16. LogInView view = new LogInView();
  17. view.Show();
  18. }
  19. );
  20. }
  21. public RelayCommand<object> OpenSignUpWindow
  22. {
  23. get => new RelayCommand<object>(o =>
  24. {
  25. SignUpView view = new SignUpView();
  26. view.Show();
  27. }
  28. );
  29. }
  30. //foreach (Window item in Application.Current.Windows)
  31. // {
  32. // if (item.DataContext == this) item.Close();
  33. // }
  34. //public RelayCommand LogInCommand
  35. //{
  36. // get { return _view; }
  37. // set
  38. // {
  39. // _view = value;
  40. // OnPropertyChanged();
  41. // }
  42. //}
  43. }
  44. }