コード例 #1
0
        private void Window_KeyDown(object sender, KeyEventArgs e)
        {
            if (isSearchPalleteOpen == false)
            {
                //Check whether the search may start or not
                if (e.Key != Key.Escape && e.Key != Key.F1)
                {
                    //Start the Search Pallete
                    SearchPallete.IsEnabled        = true;
                    SearchPallete.IsHitTestVisible = true;

                    //Reset the Search Query Text
                    SearchQueryText.Text = "";

                    //Animate the Search Pallete
                    DoubleAnimation da = new DoubleAnimation(0, 1d, TimeSpan.FromMilliseconds(500));
                    da.EasingFunction = new QuinticEase();
                    SearchPallete.BeginAnimation(OpacityProperty, da);

                    //Focus to the SearchQueryText to input the text
                    SearchQueryText.Focus();

                    isSearchPalleteOpen = true;
                }
                else
                {
                    if (e.Key == Key.F1)
                    {
                        //Help is requested, Load the local / server help documentation.
                        //TODO:Create help docs and link it here
                    }
                }
            }
        }
コード例 #2
0
 private void SearchPallete_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Escape)
     {
         //Exit the SearchPallete
         DoubleAnimation da = new DoubleAnimation(0, TimeSpan.FromMilliseconds(400));
         da.EasingFunction = new QuinticEase();
         SearchPallete.BeginAnimation(OpacityProperty, da);
         SearchPallete.IsHitTestVisible = false; SearchPallete.IsEnabled = false;
         isSearchPalleteOpen            = false;
     }
 }
コード例 #3
0
        private void Search_Button_MouseUp(object sender, MouseButtonEventArgs e)
        {
            //Start the Search Pallete
            SearchPallete.IsEnabled        = true;
            SearchPallete.IsHitTestVisible = true;

            //Reset the Search Query Text
            SearchQueryText.Text = "";

            //Animate the Search Pallete
            DoubleAnimation da = new DoubleAnimation(0, 1d, TimeSpan.FromMilliseconds(500));

            da.EasingFunction = new QuinticEase();
            SearchPallete.BeginAnimation(OpacityProperty, da);

            //Focus to the SearchQueryText to input the text
            SearchQueryText.Focus();

            isSearchPalleteOpen = true;
        }