Пример #1
0
        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);
                }
            });
        }
Пример #2
0
        public EditProfileviewModel(ProfileModel profileModel)
        {
            ProfileMockService _service = new ProfileMockService();

            AvatarUri = profileModel.AvatarUri;
            ID        = profileModel.ID;
            Email     = profileModel.Email;
            Rating    = profileModel.Rating;
            Location  = profileModel.Location;
        }