Disabling IsRightTapEnabled on all UI Elements that steal focus from the text box. (#3349)

This commit is contained in:
ryanbodrug-microsoft
2020-05-20 11:38:14 -07:00
committed by GitHub
parent f89ab74b29
commit c606e3db43
3 changed files with 198 additions and 12 deletions

View File

@@ -20,7 +20,7 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="GridViewItem">
<ListViewItemPresenter x:Name="Root" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}">
<ListViewItemPresenter x:Name="Root" IsRightTapEnabled="False" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
@@ -46,6 +46,7 @@
<Grid
x:Name="PowerBar"
Background="{ThemeResource BackdropAcrylicBrush}"
IsRightTapEnabled="False"
VerticalAlignment="Top">
<ListView
@@ -55,15 +56,18 @@
MinHeight="{Binding Results.MaxHeight}"
AllowFocusOnInteraction="False"
IsItemClickEnabled="True"
IsRightTapEnabled="False"
RightTapped="SuggestionsList_RightTapped"
Margin="0"
Padding="{ThemeResource AutoSuggestListPadding}"
ItemsSource="{Binding Results.Results, Mode=OneWay}"
SelectionMode="Single"
SelectedIndex="{Binding Results.SelectedIndex, Mode=TwoWay}"
Style="{StaticResource ListViewNoAnimations}">
Style="{StaticResource ListViewNoAnimations}"
ItemContainerStyle="{StaticResource ListViewItemNoRightTap}">
<ListView.ItemTemplate>
<DataTemplate >
<Grid Height="72" Width="642" Background="Transparent" RowSpacing="0">
<Grid IsRightTapEnabled ="False" Height="72" Width="642" Background="Transparent" RowSpacing="0">
<Interactivity:Interaction.Behaviors>
<Core:EventTriggerBehavior EventName="PointerEntered">
<Core:InvokeCommandAction Command="{Binding ActivateContextButtonsHoverCommand}"/>
@@ -81,9 +85,9 @@
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Image x:Name="AppIcon" Height="36" MaxWidth="56" Grid.RowSpan="2" Margin="-8,0,0,0" HorizontalAlignment="Center" Source="{Binding Image}" />
<TextBlock x:Name="Title" Grid.Column="1" Text="{Binding Result.Title}" FontWeight="SemiBold" FontSize="20" Margin="0,0,0,-2" VerticalAlignment="Bottom"/>
<TextBlock x:Name="Path" Grid.Column="1" Text= "{Binding Result.SubTitle}" Grid.Row="1" Opacity="0.6" Margin="0,2,0,0" VerticalAlignment="Top"/>
<Image x:Name="AppIcon" IsRightTapEnabled ="False" Height="36" MaxWidth="56" Grid.RowSpan="2" Margin="-8,0,0,0" HorizontalAlignment="Center" Source="{Binding Image}" />
<TextBlock x:Name="Title" IsRightTapEnabled ="False" Grid.Column="1" Text="{Binding Result.Title}" FontWeight="SemiBold" FontSize="20" Margin="0,0,0,-2" VerticalAlignment="Bottom"/>
<TextBlock x:Name="Path" IsRightTapEnabled ="False" Grid.Column="1" Text= "{Binding Result.SubTitle}" Grid.Row="1" Opacity="0.6" Margin="0,2,0,0" VerticalAlignment="Top"/>
<GridView
ItemContainerStyle="{StaticResource CommandButtonGridViewItemContainerStyle}"
HorizontalAlignment="Right"
@@ -97,15 +101,17 @@
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ItemsSource="{Binding ContextMenuItems}"
SelectionMode="Single"
SelectedIndex="{Binding ContextMenuSelectedIndex}">
SelectedIndex="{Binding ContextMenuSelectedIndex}"
ContainerContentChanging="GridView_ContainerContentChanging"
IsRightTapEnabled ="False">
<GridView.ItemTemplate>
<DataTemplate>
<Button Command="{Binding Command}" VerticalAlignment="Center" CornerRadius="4" Height="42" Width="42" BorderThickness="1" Style="{ThemeResource IconOnlyButton}" Click="ContextButton_OnClick">
<Button IsRightTapEnabled ="False" Command="{Binding Command}" VerticalAlignment="Center" CornerRadius="4" Height="42" Width="42" BorderThickness="1" Style="{ThemeResource IconOnlyButton}" Click="ContextButton_OnClick">
<ToolTipService.ToolTip>
<TextBlock Text="{Binding Title}"/>
<TextBlock x:Name="ToolTip" Loaded="ToolTip_Loaded" IsRightTapEnabled="False" Text="{Binding Title}"/>
</ToolTipService.ToolTip>
<Button.Content>
<FontIcon FontFamily="{Binding FontFamily}" FontSize="16" Glyph="{Binding Glyph}"/>
<FontIcon x:Name="FontIcon" Loaded="FontIcon_Loaded" IsRightTapEnabled="False" FontFamily="{Binding FontFamily}" FontSize="16" Glyph="{Binding Glyph}"/>
</Button.Content>
<Button.KeyboardAccelerators>
<KeyboardAccelerator