Пример #1
0
        /// <summary>
        /// Promotes keyboard foucs to the <see cref="PART_FilterText"/>.
        /// </summary>
        /// <param name="e">The <see cref="KeyboardFocusChangedEventArgs"/>.</param>
        protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
        {
            if (e.Source == this && _skipFocusHandler)
            {
                _skipFocusHandler = false;
                return;
            }

            PART_FilterText.Focus();
            e.Handled = true;
        }
Пример #2
0
        /// <summary>
        /// Handles the mouse down event, to hide the view, select an item or focus the filter text<see cref="PART_FilterText"/>.
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="MouseButtonEventArgs"/>.</param>
        protected void OnMouseUp(object sender, MouseButtonEventArgs e)
        {
            if (!IsMouseOver)
            {
                IsOpen = IsPinned;
                return;
            }

            if ((PART_List.IsMouseOver && !IsMouseOverSpareListViewSpace()) || PART_Toolbar.IsMouseOver)
            {
                return;
            }

            PART_FilterText.Focus();
            e.Handled = true;
        }
Пример #3
0
        private void OnListSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (_skipSelectionChanged)
            {
                _skipSelectionChanged = false;
                return;
            }

            if (PART_List.SelectedItem is null)
            {
                return;
            }

            SetSelectedItem(PART_List.SelectedItem);
            PART_List.SelectedItem = null;
            _skipFocusHandler      = false;
            PART_FilterText.Focus();
            e.Handled = true;
        }