Ejemplo n.º 1
0
        private async void LoadCategoryList(int SelectedIndex)
        {
            Categories = await GifologyDatabase.GetCategories();

            CategoryBox.ItemsSource   = Categories;
            CategoryBox.SelectedIndex = SelectedIndex;
        }
Ejemplo n.º 2
0
        private async void Pivot_NavSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            EditCategoryAppButton.Visibility   = Visibility.Collapsed;
            DeleteCategoryAppButton.Visibility = Visibility.Collapsed;

            if (!InternetStatus())
            {
                return;
            }

            switch (NavDictionary[PivotNavigation.SelectedIndex])
            {
            case "Search":
                this.PreviousAppButton.IsEnabled = Search.PreviousEnabled;
                this.NextAppButton.IsEnabled     = Search.NextEnabled;
                break;

            case "Trending":
                if (Trending.ColumnOneList.Count == 0 && Trending.ColumnTwoList.Count == 0)
                {
                    GetTrending();
                }
                this.PreviousAppButton.IsEnabled = Trending.PreviousEnabled;
                this.NextAppButton.IsEnabled     = Trending.NextEnabled;
                break;

            case "MyGifs":
                Categories = await GifologyDatabase.GetCategories();

                CategoryBox.ItemsSource = Categories;

                if (ViewBox.SelectedValue == null)
                {
                    ViewBox.SelectedValue = "Favorite";
                }
                else if (((ComboBoxItem)ViewBox.SelectedItem).Tag.ToString() == "Favorite")
                {
                    MyGifs.Offset = MyGifs.PreviousOffset;
                    GetFavorites();
                }
                else if (((ComboBoxItem)ViewBox.SelectedItem).Tag.ToString() == "Recent")
                {
                    MyGifs.Offset = MyGifs.PreviousOffset;
                    GetRecents();
                }
                else if (((ComboBoxItem)ViewBox.SelectedItem).Tag.ToString() == "Category")
                {
                    CategoryBox.SelectedIndex = 0;
                    if (((Categories)CategoryBox.SelectedValue).Id != 1)
                    {
                        EditCategoryAppButton.Visibility   = Visibility.Visible;
                        DeleteCategoryAppButton.Visibility = Visibility.Visible;
                    }
                }

                this.PreviousAppButton.IsEnabled = MyGifs.PreviousEnabled;
                this.NextAppButton.IsEnabled     = MyGifs.NextEnabled;
                break;
            }

            if (GetSelectedImage() == null)
            {
                ShowFullListIcons();
            }
            else
            {
                ShowSingleImageIcons();
            }
        }