Esempio n. 1
0
 public static ProfileMainViewModel MapProfileFromDb(User user)
 {
     if (user != null)
     {
         var profileVm = new ProfileMainViewModel
         {
             Id          = user.Id,
             UserName    = user.UserName,
             FirstName   = user.FirstName,
             LastName    = user.LastName,
             Avatar      = user.Avatar,
             Hometown    = user.PlaceOfBirth,
             WorkPlace   = user.WorkPlace,
             DateOfBirth = user.DateOfBirth?.Date ?? user.DateOfBirth,
             Gender      = (Genders)user.Gender.Id
         };
         return(profileVm);
     }
     return(null);
 }
Esempio n. 2
0
 public ProfileMainPage()
 {
     this.InitializeComponent();
     _viewModel = DataContext as ProfileMainViewModel;
 }