Exemplo n.º 1
0
        private async void txtbox_Search_SearchButtonPressed(object sender, EventArgs e)
        {
            try
            {
                //Set search or selection string
                vSearchTerm        = txtbox_Search.Text;
                vSearchTerm        = AVFunctions.StringRemoveEnd(vSearchTerm, " ");
                txtbox_Search.Text = vSearchTerm;

                //Check searchbox input
                if (string.IsNullOrWhiteSpace(vSearchTerm))
                {
                    if (!List_SearchItems.Any())
                    {
                        txt_NewsScrollInfo.Text      = "Please select a feed to search in and enter a search term to look for...";
                        txt_NewsScrollInfo.IsVisible = true;
                    }

                    //Focus on the text box to open keyboard
                    txtbox_Search.IsEnabled = false;
                    txtbox_Search.IsEnabled = true;
                    txtbox_Search.Focus();
                    return;
                }

                //Search for the items
                await LoadItems();
            }
            catch { }
        }
Exemplo n.º 2
0
        async void txtbox_Search_QuerySubmitted(object sender, AutoSuggestBoxQuerySubmittedEventArgs e)
        {
            try
            {
                //Set search or selection string
                if (e.ChosenSuggestion != null)
                {
                    vSearchTerm = e.ChosenSuggestion.ToString();
                }
                else
                {
                    vSearchTerm = txtbox_Search.Text;
                }
                vSearchTerm        = AVFunctions.StringRemoveEnd(vSearchTerm, " ");
                txtbox_Search.Text = vSearchTerm;

                //Check searchbox input
                if (String.IsNullOrWhiteSpace(vSearchTerm))
                {
                    if (!List_SearchItems.Any())
                    {
                        txt_NewsScrollInfo.Text       = "Please select a feed to search in and enter a search term to look for above...";
                        txt_NewsScrollInfo.Visibility = Visibility.Visible;
                    }

                    //Focus on the text box to open keyboard
                    txtbox_Search.IsEnabled = false;
                    txtbox_Search.IsEnabled = true;
                    txtbox_Search.Focus(FocusState.Programmatic);
                    return;
                }

                //Initialize the search
                txtbox_Search.IsEnabled = false;

                //Hide the suggestion list
                txtbox_Search.IsSuggestionListOpen = false;

                //Hide the keyboard
                InputPane.GetForCurrentView().TryHide();

                txtbox_Search.IsEnabled = true;

                //Search for the items
                await LoadItems();
            }
            catch { }
        }
Exemplo n.º 3
0
        private async Task HideShowHeader(bool ForceClose)
        {
            try
            {
                if (ForceClose || stackpanel_Header.Visibility == Visibility.Visible)
                {
                    //Check if there are any search results
                    if (!List_SearchItems.Any())
                    {
                        System.Diagnostics.Debug.WriteLine("There are no search results, not closing the header...");
                        return;
                    }

                    stackpanel_Header.Visibility = Visibility.Collapsed;
                    await HideShowMenu(true);

                    if (!AVFunctions.DevMobile())
                    {
                        iconMenu.Margin = new Thickness(0, 0, 16, 0);
                    }

                    image_iconMenu.Source = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconMenu-Dark.png", false);

                    image_iconMenu.Opacity = 0.60;

                    grid_StatusApplication.Margin     = new Thickness(0, 0, 0, 0);
                    grid_StatusApplication.Background = new SolidColorBrush(Color.FromArgb(255, 88, 88, 88))
                    {
                        Opacity = 0.60
                    };
                    border_StatusCurrentItem.Background = new SolidColorBrush(Color.FromArgb(255, 88, 88, 88))
                    {
                        Opacity = 0.50
                    };

                    //Update the current item status text
                    if (AppVariables.CurrentTotalItemsCount == 0)
                    {
                        textblock_StatusCurrentItem.Text = AppVariables.CurrentShownItemCount.ToString();
                    }
                    else
                    {
                        textblock_StatusCurrentItem.Text = AppVariables.CurrentShownItemCount + "/" + AppVariables.CurrentTotalItemsCount;
                    }

                    AppVariables.HeaderHidden = true;
                }
                else
                {
                    stackpanel_Header.Visibility = Visibility.Visible;

                    iconMenu.Margin = new Thickness(0, 0, 0, 0);

                    image_iconMenu.Source = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconMenu.png", false);

                    image_iconMenu.Opacity = 1;

                    grid_StatusApplication.Margin     = new Thickness(0, 65, 0, 0);
                    grid_StatusApplication.Background = new SolidColorBrush((Color)Application.Current.Resources["ApplicationAccentLightColor"])
                    {
                        Opacity = 0.60
                    };
                    border_StatusCurrentItem.Background = new SolidColorBrush((Color)Application.Current.Resources["ApplicationAccentLightColor"])
                    {
                        Opacity = 0.50
                    };

                    //Update the current item status text
                    textblock_StatusCurrentItem.Text = AppVariables.CurrentShownItemCount.ToString();

                    AppVariables.HeaderHidden = false;
                }
            }
            catch { }
        }
Exemplo n.º 4
0
        private async Task HideShowHeader(bool ForceClose)
        {
            try
            {
                Int32 HeaderTargetSize  = Convert.ToInt32(stackpanel_Header.Tag);
                Int32 HeaderCurrentSize = Convert.ToInt32(stackpanel_Header.Height);
                if (ForceClose || HeaderCurrentSize == HeaderTargetSize)
                {
                    //Check if there are any search results
                    if (!List_SearchItems.Any())
                    {
                        Debug.WriteLine("There are no search results, not closing the header...");
                        return;
                    }

                    AVAnimations.Ani_Height(stackpanel_Header, 0, false, 0.075);
                    await HideShowMenu(true);

                    if (!AVFunctions.DevMobile())
                    {
                        iconMenu.Margin = new Thickness(0, 0, 16, 0);
                    }

                    image_iconMenu.Source = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconMenu-Dark.png", false);

                    image_iconMenu.Opacity = 0.60;

                    grid_StatusApplication.Margin     = new Thickness(0, 0, 0, 0);
                    grid_StatusApplication.Background = new SolidColorBrush(Color.FromArgb(255, 88, 88, 88))
                    {
                        Opacity = 0.60
                    };
                    border_StatusCurrentItem.Background = new SolidColorBrush(Color.FromArgb(255, 88, 88, 88))
                    {
                        Opacity = 0.50
                    };

                    //Update the current item status text
                    if (AppVariables.CurrentTotalItemsCount == 0)
                    {
                        textblock_StatusCurrentItem.Text = textblock_StatusCurrentItem.Tag.ToString();
                    }
                    else
                    {
                        textblock_StatusCurrentItem.Text = textblock_StatusCurrentItem.Tag.ToString() + "/" + AppVariables.CurrentTotalItemsCount;
                    }

                    //Adjust the title bar color
                    await AppAdjust.AdjustTitleBarColor(this.RequestedTheme, false, false);

                    AppVariables.HeaderHidden = true;
                }
                else
                {
                    AVAnimations.Ani_Height(stackpanel_Header, HeaderTargetSize, true, 0.075);

                    iconMenu.Margin = new Thickness(0, 0, 0, 0);

                    image_iconMenu.Source = await AVImage.LoadBitmapImage("ms-appx:///Assets/iconMenu.png", false);

                    image_iconMenu.Opacity = 1;

                    grid_StatusApplication.Margin     = new Thickness(0, 65, 0, 0);
                    grid_StatusApplication.Background = new SolidColorBrush((Color)Resources["SystemAccentColor"])
                    {
                        Opacity = 0.60
                    };
                    border_StatusCurrentItem.Background = new SolidColorBrush((Color)Resources["SystemAccentColor"])
                    {
                        Opacity = 0.50
                    };

                    //Update the current item status text
                    textblock_StatusCurrentItem.Text = textblock_StatusCurrentItem.Tag.ToString();

                    //Adjust the title bar color
                    await AppAdjust.AdjustTitleBarColor(this.RequestedTheme, true, false);

                    AppVariables.HeaderHidden = false;
                }
            }
            catch { }
        }