2020-04-20 19:53:20 -07:00
|
|
|
<UserControl
|
|
|
|
|
x:Class="PowerLauncher.UI.ResultList"
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
|
|
mc:Ignorable="d"
|
|
|
|
|
xmlns:ToolkitBehaviors="using:Microsoft.Toolkit.Uwp.UI.Animations.Behaviors"
|
|
|
|
|
xmlns:Core="using:Microsoft.Xaml.Interactions.Core"
|
|
|
|
|
xmlns:Interactivity="using:Microsoft.Xaml.Interactivity"
|
|
|
|
|
d:DesignHeight="300"
|
|
|
|
|
d:DesignWidth="720">
|
|
|
|
|
<Grid
|
|
|
|
|
x:Name="PowerBar"
|
|
|
|
|
Background="{ThemeResource BackdropAcrylicBrush}"
|
|
|
|
|
Translation="0,0,16"
|
|
|
|
|
VerticalAlignment="Top">
|
|
|
|
|
<ListView
|
|
|
|
|
x:Name="SuggestionsList"
|
|
|
|
|
x:FieldModifier="public"
|
|
|
|
|
MaxHeight="{Binding Results.MaxHeight}"
|
|
|
|
|
MinHeight="{Binding Results.MaxHeight}"
|
|
|
|
|
AllowFocusOnInteraction="False"
|
|
|
|
|
IsItemClickEnabled="True"
|
|
|
|
|
Margin="{ThemeResource AutoSuggestListMargin}"
|
|
|
|
|
Padding="{ThemeResource AutoSuggestListPadding}"
|
|
|
|
|
ItemsSource="{Binding Results.Results, Mode=OneWay}"
|
|
|
|
|
SelectionMode="Single"
|
|
|
|
|
SelectedIndex="{Binding Results.SelectedIndex, Mode=TwoWay}"
|
2020-04-20 22:44:31 -07:00
|
|
|
Style="{StaticResource ListViewNoAnimations}"
|
2020-04-20 19:53:20 -07:00
|
|
|
>
|
|
|
|
|
<ListView.ItemTemplate>
|
|
|
|
|
<DataTemplate >
|
|
|
|
|
<Grid Height="72" Width="690" Background="Transparent" RowSpacing="0">
|
|
|
|
|
<Interactivity:Interaction.Behaviors>
|
|
|
|
|
<Core:DataTriggerBehavior Binding="{Binding IsSelected}" ComparisonCondition="Equal" Value="true" >
|
|
|
|
|
<Core:CallMethodAction TargetObject="{Binding ElementName=ShowActionButtons}" MethodName="StartAnimation"/>
|
|
|
|
|
</Core:DataTriggerBehavior>
|
|
|
|
|
<Core:DataTriggerBehavior Binding="{Binding IsSelected}" ComparisonCondition="Equal" Value="false">
|
|
|
|
|
<Core:CallMethodAction TargetObject="{Binding ElementName=HideActionsButtons}" MethodName="StartAnimation"/>
|
|
|
|
|
</Core:DataTriggerBehavior>
|
|
|
|
|
<Core:EventTriggerBehavior EventName="PointerEntered">
|
|
|
|
|
<Core:CallMethodAction TargetObject="{Binding ElementName=ShowActionButtons}" MethodName="StartAnimation"/>
|
|
|
|
|
<Core:InvokeCommandAction Command="{Binding LoadContextMenuCommand}"/>
|
|
|
|
|
</Core:EventTriggerBehavior>
|
|
|
|
|
<Core:EventTriggerBehavior EventName="PointerExited">
|
|
|
|
|
<Core:CallMethodAction TargetObject="{Binding ElementName=HideActionsButtons}" MethodName="StartAnimation"/>
|
|
|
|
|
</Core:EventTriggerBehavior>
|
|
|
|
|
</Interactivity:Interaction.Behaviors>
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="64" />
|
|
|
|
|
<ColumnDefinition Width="*" />
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<Grid.RowDefinitions >
|
|
|
|
|
<RowDefinition Height="*"/>
|
|
|
|
|
<RowDefinition Height="*"/>
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
<Image x:Name="AppIcon" Height="36" Margin="8,0,0,0" Grid.RowSpan="2" HorizontalAlignment="Left" Source="{Binding Image}" />
|
|
|
|
|
<TextBlock x:Name="Title" Grid.Column="1" Text="{Binding Result.Title}" FontWeight="SemiBold" FontSize="20" VerticalAlignment="Bottom"/>
|
|
|
|
|
<TextBlock x:Name="Path" Grid.Column="1" Text= "{Binding Result.SubTitle}" Grid.Row="1" Opacity="0.6" VerticalAlignment="Top"/>
|
2020-04-21 09:13:56 -07:00
|
|
|
<GridView
|
2020-04-20 19:53:20 -07:00
|
|
|
HorizontalAlignment="Right"
|
2020-04-21 09:13:56 -07:00
|
|
|
VerticalAlignment="Center"
|
|
|
|
|
CornerRadius="4"
|
2020-04-20 19:53:20 -07:00
|
|
|
Grid.RowSpan="2"
|
2020-04-21 09:13:56 -07:00
|
|
|
Grid.Column="1"
|
|
|
|
|
Margin="0,0,42,0"
|
|
|
|
|
Height="46"
|
2020-04-21 10:30:25 -07:00
|
|
|
ScrollViewer.VerticalScrollBarVisibility="Disabled"
|
|
|
|
|
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
2020-04-20 19:53:20 -07:00
|
|
|
ItemsSource="{Binding ContextMenuItems}"
|
|
|
|
|
SelectionMode="Single"
|
|
|
|
|
SelectedIndex="{Binding ContextMenuSelectedIndex}">
|
2020-04-21 09:13:56 -07:00
|
|
|
|
2020-04-20 19:53:20 -07:00
|
|
|
<Interactivity:Interaction.Behaviors>
|
|
|
|
|
<ToolkitBehaviors:Fade x:Name="ShowActionButtons" Duration="250" Delay="0" AutomaticallyStart="False" Value="1" />
|
|
|
|
|
<ToolkitBehaviors:Fade x:Name="HideActionsButtons" Duration="250" Delay="0" AutomaticallyStart="False" Value="0" />
|
|
|
|
|
</Interactivity:Interaction.Behaviors>
|
2020-04-21 09:13:56 -07:00
|
|
|
<GridView.ItemTemplate>
|
2020-04-20 19:53:20 -07:00
|
|
|
<DataTemplate>
|
2020-04-21 09:13:56 -07:00
|
|
|
<Button Command="{Binding Command}" VerticalAlignment="Center" CornerRadius="4" Height="42" Width="42" BorderThickness="1" Style="{ThemeResource ButtonRevealStyle}">
|
2020-04-20 19:53:20 -07:00
|
|
|
<ToolTipService.ToolTip>
|
|
|
|
|
<TextBlock Text="{Binding Title}"/>
|
|
|
|
|
</ToolTipService.ToolTip>
|
|
|
|
|
<Button.Content>
|
|
|
|
|
<FontIcon FontFamily="{Binding FontFamily}" FontSize="16" Glyph="{Binding Glyph}"/>
|
|
|
|
|
</Button.Content>
|
|
|
|
|
<Button.KeyboardAccelerators>
|
|
|
|
|
<KeyboardAccelerator
|
|
|
|
|
Key="{Binding AcceleratorKey}"
|
|
|
|
|
Modifiers="{Binding AcceleratorModifiers}"
|
|
|
|
|
IsEnabled="{Binding IsEnabled}"
|
|
|
|
|
/>
|
|
|
|
|
</Button.KeyboardAccelerators>
|
|
|
|
|
</Button>
|
|
|
|
|
</DataTemplate>
|
2020-04-21 09:13:56 -07:00
|
|
|
</GridView.ItemTemplate>
|
|
|
|
|
</GridView>
|
2020-04-20 19:53:20 -07:00
|
|
|
</Grid>
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
</ListView.ItemTemplate>
|
|
|
|
|
</ListView>
|
|
|
|
|
</Grid>
|
|
|
|
|
</UserControl>
|