Example #1
0
        // Load data
        private void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            // Checks if there was an exception during previous run
            LittleWatson.CheckForPreviousException(true);

            if (PopularPictures.ItemsSource == null)
            {
                GlobalLoading.Instance.IsLoading = true;
                Dispatcher.BeginInvoke(() =>
                                       PopularPictures.DataContext = App.PopularPictures);
            }

            if (recentPictures.ItemsSource == null)
            {
                Dispatcher.BeginInvoke(() =>
                                       recentPictures.ItemsSource = App.RecentPictures);
            }

            if (FavoritePictures.ItemsSource == null)
            {
                Dispatcher.BeginInvoke(() =>
                                       FavoritePictures.DataContext = App.FavoritedUserPictures);
            }
        }