一個簡單的事情,一個按鈕,當你點擊它時會打開一個autosuggestbox並讓我專注於它並在移動設備上打開鍵盤,或者只需點擊我自己就可以在「文本區」AutoSuggestBox.focus不能正常工作
Boolean AutoSuggestBoxRicercaOn = true;
public MainPage()
{
this.InitializeComponent();
AutoSuggestion.Visibility = Visibility.Collapsed;
}
private void Button_Click(object sender, RoutedEventArgs e)
{
if (AutoSuggestBoxRicercaOn)
{
AutoSuggestion.Visibility = Visibility.Visible;
AutoSuggestBoxRicercaOn = false;
AutoSuggestion.Focus(FocusState.Programmatic);
}
else
{
AutoSuggestion.Visibility = Visibility.Collapsed;
AutoSuggestBoxRicercaOn = true;
}
}
[XML是一種autosuggestbox和按鈕移到]
它從第二次工作當我點擊鏈接,使ASbox可見,不是第一次 - 爲什麼?我怎麼能強迫它能夠第一次做到這一點?
感謝所有:}