本文整理汇总了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();
});
}
示例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);
});
};
}
示例3: OnQuerySubmitted
private void OnQuerySubmitted(AutoSuggestBox box, AutoSuggestBoxQuerySubmittedEventArgs args)
{
AutoSuggestBox.Text = "";
var hamburger = box.GetVisualParentOfType<Hamburger>();
hamburger.IsPaneOpen = false;
}
示例4: Searchbox_QuerySubmitted
private void Searchbox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
{
if (!string.IsNullOrWhiteSpace(args.QueryText))
{
this.RootFrame?.NavigateAsync(typeof(Views.SearchPage), args.QueryText);
}
}
示例5: SearchBox_QuerySubmitted
private void SearchBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
{
if (sender.Text.Length > 0)
{
SearchResultPanel.StartSearch(Frame, sender.Text);
}
}
示例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;
}
}
示例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();
}
示例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;
}
示例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);
}
示例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;
}
}
示例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)
{
}
}
示例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;
}
示例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)));
}
}
示例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);
}
}
示例15: AutoSuggestBox_QuerySubmitted
private void AutoSuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
{
ForView.Unwrap<SearchViewModel>(DataContext, vm =>
{
vm.QuerySubmitted();
});
ResultsList.Focus(FocusState.Keyboard);
}