public ProfileViewModel() { navManager = PageNavigationManager.Instance; ProfileMockService _service = new ProfileMockService(); EditClickedCommand = new Command(EditClicked); LogoutClickedCommand = new Command(Logout); Task.Run(async() => { try { ProfileModel GetDetails = await _service.GetLoggedInProfileAsync("abs"); Username = GetDetails.Username; Email = GetDetails.Email; Location = GetDetails.Location; Rating = GetDetails.Rating; AvatarUri = GetDetails.AvatarUri; } catch (System.OperationCanceledException ex) { Console.WriteLine($"Text load cancelled: {ex.Message}"); } catch (Exception ex) { Console.WriteLine(ex.Message); } }); }
public EditProfileviewModel(ProfileModel profileModel) { ProfileMockService _service = new ProfileMockService(); AvatarUri = profileModel.AvatarUri; ID = profileModel.ID; Email = profileModel.Email; Rating = profileModel.Rating; Location = profileModel.Location; }