So i am build simple Clipboard
manager.
Every ListViewItem
come from Clipboard.GetText
and my application minimize to Tray
and when double click on its Icon
the application jump and i want to focus become on the first ListViewItem
in order to be able to navigate with Up & Down
arrows.
This is my ListView
:
ListView myListView;
Model List:
public ObservableCollection<string> Clipboards
Window Loaded event:
private void Window_Loaded(object sender, RoutedEventArgs e)
{
if (viewModel.Clipboards.Count != 0)
myListView.ScrollIntoView(myListView.Items[0]);
myListView.Focus();
}
So currently when i open int the first time the application, the Focus
is not on any ListViewItem
and in the next time the focus is on the last selected/click ListViewItem
and not on the first one.