AutoSuggestBox异步搜索

时间:2016-06-17 16:57:44

标签: c# uwp

无论如何都要在TextChanged方法中进行等待搜索

private void AutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
    {
        if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
        {
            Async Search ????!!!! 
            sender.ItemsSource = dataset;
        }
    }

例如在ContactStore中搜索以显示匹配的电子邮件,姓名,......

1 个答案:

答案 0 :(得分:0)

如果要编写await语句,则需要使方法像

一样异步
    private async Task AutoSuggestBox_TextChanged()
    {
         await task1();
    }