コード例 #1
0
        private void UpdatePage()
        {
            bool forceRefresh = (DateTime.UtcNow > (NextForceRefresh)) ||
                                LoggedIn != Settings.Email;

            LoggedIn = Settings.Email;
            if (forceRefresh)
            {
                RefreshCommand.Execute(null);
                FavoritesTime = Settings.LastFavoriteTime;
            }
            else
            {
                if (Tweets.Count == 0)
                {
                    LoadSocialCommand.Execute(null);
                }

                if ((_firstLoad && Sessions.Count == 0) || FavoritesTime != Settings.LastFavoriteTime)
                {
                    if (_firstLoad)
                    {
                        Settings.LastFavoriteTime = DateTime.UtcNow;
                    }

                    _firstLoad    = false;
                    FavoritesTime = Settings.LastFavoriteTime;
                    LoadSessionsCommand.Execute(null);
                }
                if ((_firstLoad && Workshops.Count == 0) || FavoritesTime != Settings.LastFavoriteTime)
                {
                    if (_firstLoad)
                    {
                        Settings.LastFavoriteTime = DateTime.UtcNow;
                    }

                    _firstLoad    = false;
                    FavoritesTime = Settings.LastFavoriteTime;
                    LoadWorkshopsCommand.Execute(null);
                }

                if (Notification == null)
                {
                    LoadNotificationsCommand.Execute(null);
                }
            }
        }
コード例 #2
0
        public FeedViewModel()
        {
            NextForceRefresh = DateTime.UtcNow.AddMinutes(45);

            MessagingService.Current.Subscribe(MessageKeys.TwitterAuthRefreshed, (msg) => LoadSocialCommand.Execute(null));
        }