mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 18:57:19 +02:00
This stops us from raising a PropChanged(SearchText) in DynamicListPage when we're the ones to set it. When we'd raise the PropChanged in response to a `set`, it could cause a race between CmdPal and the extension. It was totally possible that CmdPal could call ``` SearchText="foo"; SearchText="fool"; ``` and in the extension, we'd raise the PropChanged for each of those, but then have CmdPal handle those events out-of-order. This seems to entirely remove all the "jiggling" that I'd notice in the evil samples from #41158 Closes #38190
22 lines
639 B
C#
22 lines
639 B
C#
// Copyright (c) Microsoft Corporation
|
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
namespace Microsoft.CommandPalette.Extensions.Toolkit;
|
|
|
|
public abstract class DynamicListPage : ListPage, IDynamicListPage
|
|
{
|
|
public override string SearchText
|
|
{
|
|
get => base.SearchText;
|
|
set
|
|
{
|
|
var oldSearch = base.SearchText;
|
|
SetSearchNoUpdate(value);
|
|
UpdateSearchText(oldSearch, value);
|
|
}
|
|
}
|
|
|
|
public abstract void UpdateSearchText(string oldSearch, string newSearch);
|
|
}
|