コード例 #1
0
        public void UpdateCollections()
        {
            switch (displayMode)
            {
            case DisplayMode.ActiveUserFeed:
            {
                NewsView.Visibility = Visibility.Visible;
                UserInfo.Visibility = Visibility.Collapsed;

                NewsFeedLabel.Content = "News Feed";
                AllPosts = ActiveUser.News.Feed;
            }
            break;

            case DisplayMode.ActiveUserPosts:
            {
                NewsView.Visibility = Visibility.Visible;
                UserInfo.Visibility = Visibility.Collapsed;

                NewsFeedLabel.Content = "Your Posts";
                AllPosts = ActiveUser.News.UserPosts;
            }
            break;

            case DisplayMode.ActiveUserInfo:
            {
                ReadInfo();
                NewsView.Visibility = Visibility.Collapsed;
                UserInfo.Visibility = Visibility.Visible;

                NewsFeedLabel.Content = "Your Info";
            }
            break;

            case DisplayMode.SubscriptionPosts:
            {
                NewsView.Visibility = Visibility.Visible;
                UserInfo.Visibility = Visibility.Collapsed;

                NewsFeedLabel.Content = DisplayUser.FullName + "'s Posts";
                AllPosts = DisplayUser.News.UserPosts;
            }
            break;

            case DisplayMode.UserInfo:
            {
                ReadInfo();
                NewsView.Visibility = Visibility.Collapsed;
                UserInfo.Visibility = Visibility.Visible;

                NewsFeedLabel.Content = DisplayUser.FullName + "'s Info";
            }
            break;
            }

            UserName.Text = ActiveUser.FullName;

            NewsFeed.UpdateLayout();
        }
コード例 #2
0
        private void UpdateCollections()
        {
            ActiveUserSubscriptions = new ObservableCollection <User>(ActiveUser.Subscriptions);
            FriendsList.ItemsSource = ActiveUserSubscriptions;
            FriendsList.UpdateLayout();

            Posts = new ObservableCollection <NewsItem>(displayingUserPosts? ActiveUser.News.UserPosts: ActiveUser.News.Feed);

            NewsFeed.ItemsSource = Posts;
            NewsFeed.UpdateLayout();
        }