using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace F4SDicons.User_Controls
{
    public partial class SearchBar : UserControl
    {
        public SearchBar()
        {
            InitializeComponent();
        }

        #region Default Suchtext

        private void TextBoxGotFocus(object sender, EventArgs e)
        {
            //previewTextBlock.Text = "";
            previewTextBlock.Visibility = Visibility.Hidden;
        }

        private void TextBoxLostFocus(object sender, EventArgs e)
        {
            if (bindingTextBox.Text == "")
            {
                //previewTextBlock.Text = "Suchbegriff eingeben...";
                previewTextBlock.Visibility = Visibility.Visible;
            }
        }

        #endregion

        #region TextBox

        private void ClearSearchButtonUp(object sender, MouseButtonEventArgs e)
        {
            bindingTextBox.Text = String.Empty;
            FocusManager.SetFocusedElement(FocusManager.GetFocusScope(bindingTextBox), null);
            Keyboard.ClearFocus();
            TextBoxLostFocus(null, null);
        }

        #endregion

    }
}
