mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
[PTRun]Integrated lock mechanism for thread-safe Results updates. (#26104)
This commit is contained in:
@@ -606,14 +606,17 @@ namespace PowerLauncher
|
||||
|
||||
private void ClearResults()
|
||||
{
|
||||
_viewModel.Results.SelectedItem = null;
|
||||
System.Threading.Tasks.Task.Run(() =>
|
||||
MainViewModel.PerformSafeAction(() =>
|
||||
{
|
||||
Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(() =>
|
||||
_viewModel.Results.SelectedItem = null;
|
||||
System.Threading.Tasks.Task.Run(() =>
|
||||
{
|
||||
_viewModel.Results.Clear();
|
||||
_viewModel.Results.Results.NotifyChanges();
|
||||
}));
|
||||
Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(() =>
|
||||
{
|
||||
_viewModel.Results.Clear();
|
||||
_viewModel.Results.Results.NotifyChanges();
|
||||
}));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user