RegistrationViewModel.cs 729 B

123456789101112131415161718192021222324252627
  1. using System;
  2. using System.Collections.Generic;
  3. using ReactiveUI;
  4. using YtYtAvalonia.Models;
  5. using YtYtAvalonia.ViewModels;
  6. namespace YtYtAvalonia.ViewModels
  7. {
  8. public class RegistrationViewModel : ReactiveObject
  9. {
  10. SuharevaContext myConnection;
  11. User currentUser;
  12. public RegistrationViewModel(SuharevaContext myConnection)
  13. {
  14. this.myConnection = myConnection;
  15. CurrentUser = new User();
  16. myConnection.Add(currentUser);
  17. }
  18. public string Birthday { get => currentUser.Bithday.ToString(); set => currentUser.Bithday = Convert.ToDateTime(value); }
  19. public User CurrentUser { get => currentUser; set => currentUser = value; }
  20. }
  21. }