Fixed an issue where empty listview drags focus to search bar automatically.

This commit is contained in:
Burak Kaan Köse
2024-06-22 00:43:48 +02:00
parent 82ae13ba3e
commit 3397845ccc

View File

@@ -379,31 +379,42 @@
</Page.Resources> </Page.Resources>
<wino:BasePage.ShellContent> <wino:BasePage.ShellContent>
<AutoSuggestBox <Grid>
x:Name="SearchBar" <!-- Hidden focus receiver... -->
Margin="0,0,8,0" <TextBox
VerticalAlignment="Center" Visibility="Collapsed"
BorderBrush="Transparent" Opacity="0"
GotFocus="SearchBoxFocused" Grid.Column="1"
IsFocusEngagementEnabled="False" VerticalAlignment="Bottom"
IsTabStop="False" HorizontalAlignment="Right" />
LostFocus="SearchBarUnfocused"
PlaceholderText="{x:Bind domain:Translator.SearchBarPlaceholder}" <AutoSuggestBox
QueryIcon="Find" x:Name="SearchBar"
TabIndex="1000" Margin="0,0,8,0"
TextChanged="SearchBar_TextChanged" VerticalAlignment="Center"
Text="{x:Bind ViewModel.SearchQuery, Mode=TwoWay}"> BorderBrush="Transparent"
<i:Interaction.Behaviors> GotFocus="SearchBoxFocused"
<ic:EventTriggerBehavior EventName="QuerySubmitted"> LostFocus="SearchBarUnfocused"
<ic:InvokeCommandAction Command="{x:Bind ViewModel.PerformSearchCommand}" /> PlaceholderText="{x:Bind domain:Translator.SearchBarPlaceholder}"
</ic:EventTriggerBehavior> QueryIcon="Find"
</i:Interaction.Behaviors> TextChanged="SearchBar_TextChanged"
</AutoSuggestBox> Text="{x:Bind ViewModel.SearchQuery, Mode=TwoWay}">
<i:Interaction.Behaviors>
<ic:EventTriggerBehavior EventName="QuerySubmitted">
<ic:InvokeCommandAction Command="{x:Bind ViewModel.PerformSearchCommand}" />
</ic:EventTriggerBehavior>
</i:Interaction.Behaviors>
</AutoSuggestBox>
</Grid>
</wino:BasePage.ShellContent> </wino:BasePage.ShellContent>
<Grid x:Name="RootGrid"> <Grid x:Name="RootGrid">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition x:Name="ReaderColumn" Width="*" MaxWidth="{x:Bind ViewModel.StatePersistanceService.MailListPaneLength, Mode=OneWay}"/> <ColumnDefinition
x:Name="ReaderColumn"
Width="*"
MaxWidth="{x:Bind ViewModel.StatePersistanceService.MailListPaneLength, Mode=OneWay}" />
<ColumnDefinition x:Name="RendererColumn" Width="*" /> <ColumnDefinition x:Name="RendererColumn" Width="*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
@@ -801,6 +812,9 @@
Grid.Column="1" Grid.Column="1"
IsNavigationStackEnabled="False" /> IsNavigationStackEnabled="False" />
<VisualStateManager.VisualStateGroups> <VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="AdaptiveStates" CurrentStateChanged="AdaptivenessChanged"> <VisualStateGroup x:Name="AdaptiveStates" CurrentStateChanged="AdaptivenessChanged">
<VisualState x:Name="NormalState"> <VisualState x:Name="NormalState">