Ejemplo n.º 1
0
        protected override void OnKeyDown(KeyEventArgs e)
        {
            base.OnKeyDown(e);

            TextBoxSearchBar.Focus();
            Keyboard.Focus(TextBoxSearchBar);

            if (e.Key == Key.Enter)
            {
                bool shouldHide = false;
                if (_activeQueryHandler != null)
                {
                    shouldHide = _activeQueryHandler.Confirm();
                }
                if (shouldHide)
                {
                    Hide();
                }
            }

#if DEBUG
            if (e.Key == Key.Escape)
            {
                Application.Current.Shutdown();
            }
#else
            if (e.Key == Key.Escape)
            {
                Hide();
            }
#endif
        }
Ejemplo n.º 2
0
 private void RectangleSearchIcon_OnPreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     SearchBarVisibile = true;
     if (PropertyChanged != null)
     {
         PropertyChanged(this, new PropertyChangedEventArgs("VisibilitySearchBar"));
         PropertyChanged(this, new PropertyChangedEventArgs("VisibilitySearchIcon"));
     }
     TextBoxSearchBar.Focus();
 }
Ejemplo n.º 3
0
        private void CloseSearchField()
        {
            var updateDecks = !string.IsNullOrEmpty(DeckNameFilter);

            TextBoxSearchBar.Clear();
            DeckNameFilter    = null;
            SearchBarVisibile = false;
            if (updateDecks)
            {
                UpdateDecks();
            }
        }
Ejemplo n.º 4
0
        private void CloseSearchField()
        {
            bool updateDecks = !string.IsNullOrEmpty(DeckNameFilter);

            TextBoxSearchBar.Clear();
            DeckNameFilter    = null;
            SearchBarVisibile = false;
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs("VisibilitySearchBar"));
                PropertyChanged(this, new PropertyChangedEventArgs("VisibilitySearchIcon"));
            }
            if (updateDecks)
            {
                UpdateDecks();
            }
        }
Ejemplo n.º 5
0
 protected override void OnActivated(EventArgs e)
 {
     base.OnActivated(e);
     Log.Message(string.Format("{0} activated", GetType().Name));
     ResetLocation();
     TextBoxSearchBar.Clear();
     TextBoxSearchBar.Focus();
     _canTypeActivationKey        = false;
     _activationKeyTimer          = new DispatcherTimer();
     _activationKeyTimer.Interval = new TimeSpan(0, 0, 0, 0, ACTIVATION_KEY_TIMER_INTERVAL_MS);
     _activationKeyTimer.Tick    += (sender, ev) =>
     {
         _activationKeyTimer.Stop();
         _canTypeActivationKey = true;
     };
     _activationKeyTimer.Start();
     TextBoxSearchBar.TextChanged += OnTextChanged;
     Win32.SetForegroundWindow(new WindowInteropHelper(this).Handle);
 }
Ejemplo n.º 6
0
 private void RectangleSearchIcon_OnPreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     SearchBarVisibile = true;
     TextBoxSearchBar.Focus();
 }
Ejemplo n.º 7
0
        private void ListViewMenu_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            int index = ListViewMenu.SelectedIndex;

            ChangeCursorGrid(index);
            switch (index)
            {
            case 0:
                MainGrid.Children.Clear();
                TextBoxSearchBar.IsEnabled        = false;
                ButtonShowPreviousPage.Visibility = Visibility.Collapsed;
                ButtonShowNextPage.Visibility     = Visibility.Collapsed;
                //MainGrid.Children.Add(new UserControlHome() { HorizontalAlignment= HorizontalAlignment.Left});
                MainGrid.Children.Add(new UserControlHome());
                break;

            case 1:
                MainGrid.Children.Clear();
                startingItemsindex = 0;
                ShowItems(startingItemsindex);
                TextBoxSearchBar.IsEnabled = true;
                TextBoxSearchBar.Clear();
                ButtonShowPreviousPage.Visibility = Visibility.Collapsed;
                ButtonShowNextPage.Visibility     = Visibility.Visible;
                ButtonShowNextPage.IsEnabled      = true;

                break;

            case 2:
                MainGrid.Children.Clear();
                startingItemsindex = 0;
                ShowItems(startingItemsindex);
                TextBoxSearchBar.IsEnabled = true;
                TextBoxSearchBar.Clear();
                ButtonShowPreviousPage.Visibility = Visibility.Collapsed;
                ButtonShowNextPage.Visibility     = Visibility.Visible;
                ButtonShowNextPage.IsEnabled      = true;

                break;

            case 3:
                MainGrid.Children.Clear();
                startingItemsindex = 0;
                ShowItems(startingItemsindex);
                TextBoxSearchBar.IsEnabled = true;
                TextBoxSearchBar.Clear();
                ButtonShowPreviousPage.Visibility = Visibility.Collapsed;
                ButtonShowNextPage.Visibility     = Visibility.Visible;
                ButtonShowNextPage.IsEnabled      = true;

                break;

            case 4:
                MainGrid.Children.Clear();
                MainGrid.Children.Add(new UserControlBook());
                TextBoxSearchBar.IsEnabled        = false;
                ButtonShowPreviousPage.Visibility = Visibility.Collapsed;
                ButtonShowNextPage.Visibility     = Visibility.Collapsed;


                break;

            case 5:
                MainGrid.Children.Clear();
                MainGrid.Children.Add(new UserControlAboutUs());
                TextBoxSearchBar.IsEnabled        = false;
                ButtonShowPreviousPage.Visibility = Visibility.Collapsed;
                ButtonShowNextPage.Visibility     = Visibility.Collapsed;


                break;

            default:
                MainGrid.Children.Clear();
                break;
            }
        }
Ejemplo n.º 8
0
 protected override void OnDeactivated(EventArgs e)
 {
     base.OnDeactivated(e);
     Log.Message("BarWindow deactivated");
     TextBoxSearchBar.Clear();
 }