Ejemplo n.º 1
0
        private void UpdatePage()
        {
            bool forceRefresh = (DateTime.UtcNow > (ViewModel?.NextForceRefresh ?? DateTime.UtcNow));

            vm.EvaluateVisualState();

            if (forceRefresh)
            {
                ViewModel.RefreshCommand.Execute(null);
            }
            else
            {
                if (ViewModel.Tweets.Count == 0)
                {
                    ViewModel.LoadSocialCommand.Execute(null);
                }

                if ((firstLoad && ViewModel.Sessions.Count == 0))
                {
                    firstLoad = false;
                    ViewModel.LoadSessionsCommand.Execute(null);
                }

                if (ViewModel.Notification == null)
                {
                    ViewModel.LoadNotificationsCommand.Execute(null);
                }
            }
        }
Ejemplo n.º 2
0
        private void UpdatePage()
        {
            bool forceRefresh = (DateTime.UtcNow > (ViewModel?.NextForceRefresh ?? DateTime.UtcNow)) ||
                                loggedIn != Settings.Current.UserIdentifier;

            loggedIn = Settings.Current.UserIdentifier;

            vm.EvaluateVisualState();

            if (forceRefresh)
            {
                ViewModel.RefreshCommand.Execute(null);
                favoritesTime = Settings.Current.LastFavoriteTime;
            }
            else
            {
                if (ViewModel.Tweets.Count == 0)
                {
                    ViewModel.LoadSocialCommand.Execute(null);
                }

                if ((firstLoad && ViewModel.Sessions.Count == 0) || favoritesTime != Settings.Current.LastFavoriteTime)
                {
                    if (firstLoad)
                    {
                        Settings.Current.LastFavoriteTime = DateTime.UtcNow;
                    }

                    firstLoad     = false;
                    favoritesTime = Settings.Current.LastFavoriteTime;
                    ViewModel.LoadSessionsCommand.Execute(null);
                }

                if (ViewModel.Notification == null)
                {
                    ViewModel.LoadNotificationsCommand.Execute(null);
                }
            }
        }