当前位置: 首页>>代码示例>>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;未经允许,请勿转载。