我有一個簡單的xaml頁面,其中包含一個TextBox和一個RichTextBlock。 RichTextBlock裏面有一些InlineUIContainers。文本框獲取不需要的焦點
但是,當用戶按下一個按鈕,我通過代碼刪除一個InlineUIContainer。這很順利,但每次完成後,頁面上的TextBox就會得到重點關注! 導致觸摸鍵盤彈出。任何人都知道爲什麼發生這種情況?或者我可以如何防止這種情況? 我無法設置IsTabStop,因爲如果需要,用戶仍然必須能夠填充內容。
我工作的一個WinRT的通用應用
一些代碼的Windows Phone的一部分,但實際的去除是在附加依賴項屬性 完成它的KeywordsInput文本框是獲得的每次刪除後的焦點
<TextBox x:Uid="Search_KeywordsInput" x:Name="SearchKeywordsInput"
Text="{Binding KeywordsInput, Mode=TwoWay}" />
<RichTextBlock Grid.Row="4"
Margin="0,9.5,0,0"
IsTextSelectionEnabled="False"
dependencyProperties:RichTextBlockTagCloud.Command="{Binding SelectedTagFilterCommand}"
dependencyProperties:RichTextBlockTagCloud.TagItems="{Binding SelectedFilters, Mode=TwoWay}">
<Paragraph x:Name="TagsFilters" />
foreach (InlineUIContainer container in buttonsToRemove)
tagParagraph.Inlines.Remove(container);
你應該粘貼你的頁面的代碼,以便我們可以看看它:) – Sergio0694