public void ResetUserStatus() { IsLogined = false; LoginStatus = new LoginStatusBag(); LoginUserBlock.Text = GetUIString("LoginPanelCode"); LoginUserText.SetVisibility(true); LoginUserIcon.Fill = new SolidColorBrush(Windows.UI.Colors.Gray); }
private void ReadMessageFromAPIInfos(LoginStatusBag bag) { var status = bag.APIUserinfos; try { BroadcastNumber.Text = status.StatusesCount.ToString(); PhotosNumber.Text = status.PhotoAlbumsCount.ToString(); DiaryNumber.Text = status.NotesCount.ToString(); GroupsNumber.Text = status.JoinedGroupCount.ToString(); BookMovieNumber.Text = status.CollectedSubjectsCount.ToString(); FollowingNumber.Text = status.FollowingCount.ToString(); FollowersNumber.Text = status.FollowersCount.ToString(); GenderBlock.Foreground = status.Gender == "M" ? new SolidColorBrush(Windows.UI.Color.FromArgb(255, 69, 90, 172)) : new SolidColorBrush(Windows.UI.Color.FromArgb(255, 217, 6, 94)); if (status.ProfileBannerLarge != null) { BackgroundImage.Source = new Windows.UI.Xaml.Media.Imaging.BitmapImage(new Uri(bag.APIUserinfos.ProfileBannerLarge)); } else if (status.ProfileBannerNormal != null) { BackgroundImage.Source = new Windows.UI.Xaml.Media.Imaging.BitmapImage(new Uri(bag.APIUserinfos.ProfileBannerNormal)); } Uri.TryCreate(bag.BigHeadUrl, UriKind.Absolute, out var head_uri); if (head_uri == null) { Uri.TryCreate(bag.ImageUrl, UriKind.Absolute, out head_uri); } HeadUserImage.Fill = new ImageBrush { ImageSource = new Windows.UI.Xaml.Media.Imaging.BitmapImage(head_uri ?? new Uri(NoPictureUrl)), Stretch = Stretch.UniformToFill }; UserId = status.ID; } catch (Exception e) { Debug.WriteLine(e.StackTrace + "\n" + e.Message); } finally { ListResources.Source = listSource = new DoubanLazyLoadContext <LifeStreamItem>(FetchMoreResourcesAsync); } }
private void SetStateByLoginStatus(LoginStatusBag bag) { ReadMessageFromAPIInfos(bag); }