Exemple #1
0
        private void UserCommand_OnPreviewKeyUp(object sender, KeyEventArgs e)
        {
            if (e.Key != Key.Down || ProcessNames.Items.Count <= 0)
            {
                return;
            }

            ProcessNames.Focus();
            ProcessNames.SelectedIndex = 0;

            ProcessNames.UpdateLayout();
            var matchedItem = (ListBoxItem)ProcessNames.ItemContainerGenerator.ContainerFromItem(ProcessNames.SelectedItem);

            matchedItem.Focus();
        }