private void onKeyUp(object sender, KeyEventArgs e) { Console.WriteLine("Keyup"); if (e.Key == Key.LeftAlt) { this.Hide(); if (lbTodoList.SelectedItem != null) { var proc = (lbTodoList.SelectedItem as DesktopWindow); WinAPI.SetForegroundWindow(proc.ProcessId); lbTodoList.ItemsSource = DesktopWindow.Promote(proc); var view = CollectionViewSource.GetDefaultView(lbTodoList.ItemsSource); view.Refresh(); } } }