public async void LoadProfileData(ProfilePageNavigationArgs args, bool force = false) { if (CurrentUser == null || CurrentUser != args?.TargetUser || force) { LoadingVisibility = Visibility.Visible; await Task.Run( async() => CurrentData = await new ProfileQuery(false, args?.TargetUser ?? "").GetProfileData(force)); CurrentUser = args?.TargetUser ?? Credentials.UserName; } _authenticatedUser = args == null || args.TargetUser == Credentials.UserName; ViewModelLocator.Main.CurrentStatus = $"{CurrentUser} - Profile"; _loadedFavManga = false; _loadedFavAnime = false; _loadedRecent = false; _loadedStats = false; FavAnime = new List <AnimeItemViewModel>(); FavManga = new List <AnimeItemViewModel>(); RecentAnime = new List <AnimeItemViewModel>(); RecentManga = new List <AnimeItemViewModel>(); EmptyFavCharactersNoticeVisibility = CurrentData.FavouriteCharacters.Count == 0 ? Visibility.Visible : Visibility.Collapsed; EmptyFavPeopleNoticeVisibility = CurrentData.FavouritePeople.Count == 0 ? Visibility.Visible : Visibility.Collapsed; RaisePropertyChanged(() => CurrentData); LoadingVisibility = Visibility.Collapsed; _initialized = true; }
public async void LoadProfileData(ProfilePageNavigationArgs args, bool force = false) { if (!_dataLoaded || force) { LoadingVisibility = Visibility.Visible; Cleanup(); await Task.Run(async() => CurrentData = await new ProfileQuery().GetProfileData(force)); _dataLoaded = true; } RaisePropertyChanged(() => CurrentData); _initialized = true; CurrentlySelectedInnerPivotIndex = args?.InnerPivotSelectedIndex ?? 0; CurrentlySelectedOuterPivotIndex = args?.OuterPivotSelectedIndex ?? 1; OuterPivotItemChanged(CurrentlySelectedOuterPivotItem.Tag as string); LoadingVisibility = Visibility.Collapsed; }