private void SuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
{
if(args.QueryText!=null)
{
...
}
}
Pivot_SelectionChanged
private void privotContent_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
SuggestBox.QuerySubmitted += SuggestBox_QuerySubmitted;
}
不要在privotContent中调用SuggestBox.QuerySumitted。但我想这样做。
答案 0 :(得分:1)
我想您要在QuerySubmitted
控件的AutoSuggestBox
事件内触发SelectionChanged
的{{1}}事件。例如,您可以使用以下代码:
Pivot
此代码中的private void Pivot_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
var ee = new AutoSuggestBoxQuerySubmittedEventArgs();
AutoSuggestBox_QuerySubmitted(autoSuggestBox, ee);
}
private void AutoSuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
{
if (args.QueryText != null)
{
}
}
是autoSuggestBox
控件的Name
。