protected async override void OnAppearing() { base.OnAppearing(); if (MyProfileViewModel.Instance.IsBusy) { return; } MyProfileViewModel.Instance.ErrorMessage = ""; MyProfileViewModel.Instance.IsBusy = true; GetPhoto(); GetProfile(); if (MyProfileViewModel.Instance.List == null || MyProfileViewModel.Instance.List.Count == 0) { var contributions = await MvpHelper.MvpService.GetContributions(-5, 10, LogOnViewModel.StoredToken); MvpHelper.SetContributionInfoToProfileViewModel(contributions); } if (string.Compare(CommonConstants.DefaultNetworkErrorString, MyProfileViewModel.Instance.ErrorMessage, StringComparison.OrdinalIgnoreCase) == 0) { MyProfileViewModel.Instance.StoreImageBase64Str = CommonConstants.DefaultPhoto; MyProfileViewModel.Instance.ErrorMessage = CommonConstants.DefaultNetworkErrorString; } MyProfileViewModel.Instance.IsBusy = false; }
protected async override void OnAppearing() { listView.SelectedItem = null; MyProfileViewModel.Instance.ErrorMessage = ""; stkOveryLay.IsVisible = true; base.OnAppearing(); GetPhoto(); GetProfile(); if (MyProfileViewModel.Instance.List == null || MyProfileViewModel.Instance.List.Count == 0) { var contributions = await MvpService.GetContributions(-5, 10, LogOnViewModel.StoredToken); MvpHelper.SetContributionInfoToProfileViewModel(contributions); listView.HeightRequest = MyProfileViewModel.Instance.List.Count * 50; } if (string.Compare(CommonConstants.DefaultNetworkErrorString, MyProfileViewModel.Instance.ErrorMessage, StringComparison.OrdinalIgnoreCase) == 0) { MyProfileViewModel.Instance.StoreImageBase64Str = CommonConstants.DefaultPhoto; MyProfileViewModel.Instance.ErrorMessage = CommonConstants.DefaultNetworkErrorString; } stkOveryLay.IsVisible = false; }