/// <summary>
        /// Load the ChallengeViewModels' data.
        /// </summary>
        /// <returns>An awaitable task.</returns>
        protected async override Task LoadDataImpl(bool forceReload = false)
        {
            IsDataLoading = true;

            User = new UserViewModel(_challengeObject.Get<ParseUser>("user") as ParseUser);
            await User.LoadData();//true);
            SolvedCount = await (from challenge in ParseObject.GetQuery("UserChallengesSolved")
                                   where challenge.Get<ParseUser>("user") == _challengeObject.Get<ParseUser>("user")
                                   select challenge).CountAsync();

            NotifyPropertyChanged("User");
            NotifyPropertyChanged("SolvedCount");

            IsDataLoading = false;
            IsDataLoaded = true;
        }
Example #2
0
 public MainViewModel()
 {
     User = new UserViewModel(ParseUser.CurrentUser);
     ChallengeListViewModel = new ChallengeListViewModel();
 }