• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# AutoSuggestBox类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中AutoSuggestBox的典型用法代码示例。如果您正苦于以下问题:C# AutoSuggestBox类的具体用法?C# AutoSuggestBox怎么用?C# AutoSuggestBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AutoSuggestBox类属于命名空间,在下文中一共展示了AutoSuggestBox类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: StationsBox_TextChanged

 private void StationsBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
 {
     if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
     {
         sender.ItemsSource = (sender.Text.Length > 0) ?
             stationsData.Where(x => x.StartsWith(sender.Text, StringComparison.OrdinalIgnoreCase)) :
             new string[] { };
     }
 }
开发者ID:Aleyenda,项目名称:RejseBand,代码行数:9,代码来源:MainPage.xaml.cs


示例17: suggestBox_TextChanged

 private void suggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
 {
     if (args.CheckCurrent())
     {
         var term = suggestBox.Text.ToLower();
         var results = news.Where(i => i.Title.Contains(term)).ToList();
         suggestBox.ItemsSource = results;
     }
 }
开发者ID:Romaxaqaz,项目名称:Onliner,代码行数:9,代码来源:FavoriteNewsView.xaml.cs


示例18: AutoSuggestBox_OnTextChanged

 private void AutoSuggestBox_OnTextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
 {
     myManaApartmentManger.GetAllApartments(apartments);
     Suggestions = apartments
         .Where(p => p.ApartmentCity.ToString().ToLower().StartsWith(sender.Text))
         .Select(p => p.ApartmentCity.ToString()).Distinct()
         .ToList();
     AutoSuggestBox.ItemsSource = Suggestions;
 }
开发者ID:CasperGuldbechNielsen,项目名称:FranceVacancesProject,代码行数:9,代码来源:Home.xaml.cs


示例19: OnQuerySubmitted

 private async void OnQuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     string message = $"query: {args.QueryText}";
     if (args.ChosenSuggestion != null)
     {
         message += $" suggestion: {args.ChosenSuggestion}";
     }
     var dlg = new MessageDialog(message);
     await dlg.ShowAsync();
 }
开发者ID:ProfessionalCSharp,项目名称:ProfessionalCSharp6,代码行数:10,代码来源:AutoSuggestSample.xaml.cs


示例20: AutoSuggestBox_TextChanged

        private void AutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
        {
            var txt = ((AutoSuggestBox)sender).Text;
            if (txt != " " && txt != "")
            {
                App.CurrentSearchWord = txt;
                searchDocListView.ItemsSource = new IncrementalLoadingCollection<SearchDocSource, Document>(10);

            }
        }
开发者ID:BigDaddy1337,项目名称:DocsReader,代码行数:10,代码来源:SearchPage.xaml.cs



注:本文中的AutoSuggestBox类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Autodesk类代码示例发布时间:2022-05-24
下一篇:
C# AutoResetEvent类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap