コード例 #1
0
        async void Handle_TextChanged(object sender, TextChangedEventArgs e)
        {
            if (vm.IsBusy)
            {
                return;
            }
            var keyword = IngredientSearch.Text;

            if (keyword.Length > 1)
            {
                vm.IsBusy = true;
                var suggestionList = await vm.SearchIngredientAsync(keyword);

                SuggestionListView.ItemsSource = suggestionList;
                SuggestionListView.IsVisible   = true;
                IngredientsListView.IsVisible  = false;
                vm.IsBusy = false;
            }
            else
            {
                IngredientsListView.IsVisible = true;
                SuggestionListView.IsVisible  = false;
            }
        }