當前位置: 首頁>>代碼示例>>C#>>正文


C# AutoSuggestBox類代碼示例

本文整理匯總了C#中AutoSuggestBox的典型用法代碼示例。如果您正苦於以下問題:C# AutoSuggestBox類的具體用法?C# AutoSuggestBox怎麽用?C# AutoSuggestBox使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


AutoSuggestBox類屬於命名空間,在下文中一共展示了AutoSuggestBox類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: AutoSuggestBox_QuerySubmitted

 private void AutoSuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     ForView.Unwrap<SubscriptionViewModel>(DataContext, vm =>
     {
         vm.QuerySubmitted();
     });
 }
開發者ID:michaellperry,項目名稱:Commuter,代碼行數:7,代碼來源:SubscriptionsPage.xaml.cs

示例2: SearchHamburgerItem

        /// <summary>Initializes a new instance of the <see cref="SearchHamburgerItem"/> class.</summary>
        public SearchHamburgerItem()
        {
            AutoSuggestBox = new AutoSuggestBox();
            AutoSuggestBox.QueryIcon = new SymbolIcon { Symbol = Symbol.Find };
            AutoSuggestBox.AutoMaximizeSuggestionArea = false;
            AutoSuggestBox.Loaded += delegate { AutoSuggestBox.PlaceholderText = PlaceholderText; };
            AutoSuggestBox.QuerySubmitted += OnQuerySubmitted;
            AutoSuggestBox.GotFocus += OnGotFocus;

            Content = AutoSuggestBox;
            Icon = new SymbolIcon(Symbol.Find);

            CanBeSelected = false;
            ShowContentIcon = false;
            PlaceholderText = string.Empty;
            
            Click += (sender, args) =>
            {
                args.Hamburger.IsPaneOpen = true;
                args.Hamburger.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    AutoSuggestBox.Focus(FocusState.Programmatic);
                });
            };
        }
開發者ID:RareNCool,項目名稱:MyToolkit,代碼行數:26,代碼來源:SearchHamburgerItem.cs

示例3: OnQuerySubmitted

        private void OnQuerySubmitted(AutoSuggestBox box, AutoSuggestBoxQuerySubmittedEventArgs args)
        {
            AutoSuggestBox.Text = "";

            var hamburger = box.GetVisualParentOfType<Hamburger>();
            hamburger.IsPaneOpen = false;
        }
開發者ID:RareNCool,項目名稱:MyToolkit,代碼行數:7,代碼來源:SearchHamburgerItem.cs

示例4: Searchbox_QuerySubmitted

 private void Searchbox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     if (!string.IsNullOrWhiteSpace(args.QueryText))
     {
         this.RootFrame?.NavigateAsync(typeof(Views.SearchPage), args.QueryText);
     }
 }
開發者ID:twfx7758,項目名稱:DoubanGroup.UWP,代碼行數:7,代碼來源:HeaderBar.xaml.cs

示例5: SearchBox_QuerySubmitted

 private void SearchBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     if (sender.Text.Length > 0)
     {
         SearchResultPanel.StartSearch(Frame, sender.Text);
     }
 }
開發者ID:yszhangyh,項目名稱:KuGouMusic-UWP,代碼行數:7,代碼來源:SearchResult.xaml.cs

示例6: ui_search_autosuggestboxFrom_QuerySubmitted

        private async void ui_search_autosuggestboxFrom_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
        {
            string stationSearchedFor = args.QueryText;

            if (string.IsNullOrWhiteSpace(stationSearchedFor) || stationSearchedFor.Length <= 3)
            {
                //user did not input more than three letters
                FromStopLocations.Clear();
                _fromId = "";

                //dirty way to show error message
                const string noResults = "Skriv mer än tre bokstäver...";
                StopLocation notCorrectEntry = new StopLocation { name = noResults };
                FromStopLocations.Add(notCorrectEntry);
                IsReadyForSearch();

                //add to autosuggestionbox
                ui_search_autosuggestboxFrom.ItemsSource = FromStopLocations;

                return;
            }
            else
            {
                //user searched for new station, clear list from old stations.
                FromStopLocations.Clear();
                //call api to get stations from user inputted text
                await ApiCaller.SearchForStationAsync(FromStopLocations, stationSearchedFor);

                //populate autosuggestionbox
                ui_search_autosuggestboxFrom.ItemsSource = FromStopLocations;

            }

        }
開發者ID:diblaze,項目名稱:TravelplannerOstgota,代碼行數:34,代碼來源:SearchStation.xaml.cs

示例7: nameBox_QuerySubmitted

 /// <summary>
 /// Invoked when a custom name is entered for a list item.
 /// </summary>
 /// <param name="sender">The name entry box</param>
 /// <param name="args">Event arguments</param>
 private void nameBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     var vm = DataContext as Favourites;
     var platform = sender.DataContext as DataStorage.Favourite;
     vm.ChangeCustomName(platform.PlatformNo, sender.Text);
     this.editFlyout.Hide();
 }
開發者ID:mrattner,項目名稱:chchbus,代碼行數:12,代碼來源:FavouritesPage.xaml.cs

示例8: SearchAutoSuggestBox_QuerySubmitted

 private void SearchAutoSuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     SoundManager.GetSoundsByName(Sounds, sender.Text);
     CategoryTextBlock.Text = sender.Text;
     MenuItemsListView.SelectedItem = null;
     BackButton.Visibility = Visibility.Visible;
 }
開發者ID:Rockscar66,項目名稱:AbsoluteBeginnersWin10,代碼行數:7,代碼來源:MainPage.xaml.cs

示例9: asbox_Search_QuerySubmitted

        private async void asbox_Search_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
        {


            Func<HPUserDetail, string> f = h => h.ou;

            setWorking(true);

            string searchText = args.ChosenSuggestion == null ? args.QueryText : args.ChosenSuggestion.ToString();
            SearchInfo result = null;
            try
            {
                result = await PeopleFinderHelper.Search(searchText);
                tbl_Msg.Text = "";
            }
            catch(Exception ex)
            {
                tbl_Msg.Text = ex.Message;
            }
            
            var myResult = result?.result.GroupBy(g => new { g.co, g.c}).OrderBy(o => o.Key.co).Select(gu => new PeopleFinderViewModel() { Group = gu.Key.co,SecondGroup=gu.Key.c, Peoples = gu.ToList() });
            ViewModel = myResult;

           
            this.Bindings.Update();

            setWorking(false);




        }
開發者ID:Jason-Brody,項目名稱:HPEPeopleFinder,代碼行數:32,代碼來源:PeoplePage.xaml.cs

示例10: FromStationText_OnQuerySubmitted

        private async void FromStationText_OnQuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
        {
            string textSubmitted = args.QueryText; //query from user

            if (textSubmitted.Length > 3)
            {
                //user searched for new station, clear list from old stations.
                FromStopLocations.Clear();
                //call api to get stations from user inputted text
                Task t = ApiCaller.PopulateStopLocationsAsync(FromStopLocations, textSubmitted);
                await t;

                //populate autosuggestionbox
                fromStationText.ItemsSource = FromStopLocations;
                IsReadyForSearch();
            }
            else
            {
                //user did not input more than three letters
                FromStopLocations.Clear();

                //dirty way to show error message
                string noResults = "Skriv mer än tre bokstäver...";
                var notCorrectEntry = new StopLocation {name = noResults};
                FromStopLocations.Add(notCorrectEntry);

                //add to autosuggestionbox
                fromStationText.ItemsSource = FromStopLocations;
            }
        }
開發者ID:diblaze,項目名稱:TravelplannerOstgota,代碼行數:30,代碼來源:SearchTrip.xaml.cs

示例11: AutoSuggestBox_TextChanged

        private async void AutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
        {
            try
            {
                if (sender.Text.Length != 0)
                {
                    //ObservableCollection<String>
                    var data = new ObservableCollection<string>();
                    var httpclient = new Noear.UWP.Http.AsyncHttpClient();
                    httpclient.Url("http://mobilecdn.kugou.com/new/app/i/search.php?cmd=302&keyword="+sender.Text);
                    var httpresult = await httpclient.Get();
                    var jsondata = httpresult.GetString();
                    var obj = Windows.Data.Json.JsonObject.Parse(jsondata);
                    var arryobj = obj.GetNamedArray("data");
                    foreach (var item in arryobj)
                    {
                        data.Add(item.GetObject().GetNamedString("keyword"));
                    }
                    sender.ItemsSource = data;
                    //sender.IsSuggestionListOpen = true;
                }
                else
                {
                    sender.IsSuggestionListOpen = false;
                }
            }
            catch (Exception)
            {

            }
        }
開發者ID:yszhangyh,項目名稱:KuGouMusic-UWP,代碼行數:31,代碼來源:Search.xaml.cs

示例12: searchAutoSuggestBox_TextChanged

 private void searchAutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
 {
     if (string.IsNullOrEmpty(sender.Text)) goBack();
     SoundManger.GetAllSounds(Sounds);
     Suggestions = Sounds.Where(p => p.Name.StartsWith(sender.Text)).Select(p=>p.Name).ToList();
     searchAutoSuggestBox.ItemsSource = Suggestions; 
 }
開發者ID:underSeriousConstruction,項目名稱:UWPSoundBoard,代碼行數:7,代碼來源:MainPage.xaml.cs

示例13: XmppDomainSuggest_TextChanged

 private void XmppDomainSuggest_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
 {
     if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
     {
         viewModel.XmppDomainSuggestions =
             new ObservableCollection<string>(viewModel.baseDomainSuggestions.Where(p => p.Contains(XmppDomainSuggest.Text)));
     }
 }
開發者ID:charla-n,項目名稱:FTR,代碼行數:8,代碼來源:AccountSettingsUserControl.xaml.cs

示例14: MyComment_QuerySubmitted

 /// <summary>
 /// 發表回應
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="args"></param>
 private void MyComment_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     if (!MyComment.Text.Equals(""))
     {
         _totalHtml = _totalHtml.Replace("<a id='ok'></a>", "") + ChatBoxTool.Send("http://pic.cnblogs.com/avatar/624159/20150505133758.png", "青檸檬", MyComment.Text, DateTime.Now.ToString()) + "<a id='ok'></a>";
         FlashComment.NavigateToString(_totalHtml);
     }
 }
開發者ID:BourbonShi,項目名稱:CNBlogs.UWP,代碼行數:13,代碼來源:FlashCommentPage.xaml.cs

示例15: AutoSuggestBox_QuerySubmitted

 private void AutoSuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     ForView.Unwrap<SearchViewModel>(DataContext, vm =>
     {
         vm.QuerySubmitted();
     });
     ResultsList.Focus(FocusState.Keyboard);
 }
開發者ID:michaellperry,項目名稱:Commuter,代碼行數:8,代碼來源:SearchPage.xaml.cs


注:本文中的AutoSuggestBox類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。