简体   繁体   English

AutoSuggestBox异步搜索

[英]AutoSuggestBox Async search

Is there anyway to have an awaitable search inside the TextChanged method 无论如何,在TextChanged方法内是否有一个等待的搜索

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

For example search in ContactStore to show matching emails, names, ... 例如,在ContactStore中搜索以显示匹配的电子邮件,姓名,...

If you want to write an await statement, you need to make the method async like 如果要编写await语句,则需要使方法像

    private async Task AutoSuggestBox_TextChanged()
    {
         await task1();
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM