예제 #1
0
파일: Initialize.cs 프로젝트: basyura/Eleve
        /// <summary>
        ///
        /// </summary>
        /// <param name="param"></param>
        private void ChangeTab(NavigateParam param)
        {
            IEnumerable <ITweet> tweets = new List <ITweet>();

            if (param.Tab.Key == "HOME")
            {
                if (!ViewModel.HomeTweets.Any())
                {
                    ViewModel.HomeTweets = new List <ITweet>(Timeline.GetHomeTimeline());
                }

                tweets = ViewModel.HomeTweets;
            }
            else if (param.Tab.Key == "MENTION")
            {
                if (!ViewModel.MentionTweets.Any())
                {
                    ViewModel.MentionTweets = new List <ITweet>(Timeline.GetMentionsTimeline());
                }

                tweets = ViewModel.MentionTweets;
            }

            ViewModel.Tweets.Clear();
            tweets.ToList().ForEach(v => ViewModel.Tweets.Add(v));
        }
예제 #2
0
파일: ChangeTab.cs 프로젝트: basyura/Eleve
        public override Task <ActionResult> Execute(object sender, EventArgs args, object obj)
        {
            if (!ViewModel.IsInitialized)
            {
                return(OK);
            }

            NavigateParam param = CreateParam();

            NavigateToCacheOrDefault <TweetlineView>("Container", param);

            return(OK);
        }
예제 #3
0
파일: Initialize.cs 프로젝트: basyura/Eleve
        public override Task <ActionResult> Execute(object sender, EventArgs args, object obj)
        {
            NavigateParam param = obj as NavigateParam;

            if (param.Mode == NavigateMode.ChangeTab)
            {
                ChangeTab(param);
            }

            // todo
            BeginInvoke(() => ((TweetWPFViewModel)(ViewModel.View.DataContext)).IsInitialized = true);

            return(OK);
        }