I have the following excerpt from XAML:
<SplitView Name="Menu" DisplayMode="CompactOverlay" OpenPaneLength="200" CompactPaneLength="0" Grid.RowSpan="2"> <SplitView.Pane> <StackPanel> <AutoSuggestBox Margin="0,20,0,20" Width="170" PlaceholderText="Search" QueryIcon="Find"></AutoSuggestBox> <ListBox> <ListBoxItem Tapped="Projects_Tapped"> <StackPanel Orientation="Horizontal"> <SymbolIcon Symbol="Library" /> <TextBlock Margin="10,0,0,0">Projects</TextBlock> </StackPanel> </ListBoxItem> [....] </ListBox> </StackPanel> </SplitView.Pane> </SplitView>
Basically, this splitview is compacted until the user clicks a button, which then sets IsPaneOpen to true, which in turn displays my application.
The problem is that the first thing I have on the menu is the search box, and it seems to automatically focus regardless of what I do. The fact that he has focus then calls up the touch keyboard on the phones, which is very annoying and hides most of the menu on small phones.
I tried playing with the TabIndex property to give it a huge amount or even put a lower index for something else.
I also tried setting IsTabStop to false, but did nothing.
Is there a clean way to prevent auto focusing? (In addition to disabling / hiding the item and then enabling / re-displaying)
source share