PowerToys/Wox/ResultPanel.xaml

51 lines
3.2 KiB
Plaintext
Raw Normal View History

2014-01-29 18:33:24 +08:00
<UserControl x:Class="Wox.ResultPanel"
2013-12-22 19:35:21 +08:00
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
2014-01-26 17:47:58 +08:00
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:wox="clr-namespace:Wox"
2014-01-26 17:47:58 +08:00
mc:Ignorable="d"
2013-12-22 19:35:21 +08:00
d:DesignHeight="300" d:DesignWidth="300">
<UserControl.Resources>
<wox:ImagePathConverter x:Key="ImagePathConverter"/>
</UserControl.Resources>
<Grid>
2014-02-20 18:26:01 +08:00
<ListBox x:Name="lbResults" ScrollViewer.CanContentScroll="False" ScrollViewer.HorizontalScrollBarVisibility="Hidden" SelectionChanged ="lbResults_SelectionChanged" Focusable="False" KeyboardNavigation.DirectionalNavigation="Cycle" SelectionMode="Single" BorderBrush="Transparent" Background="Transparent" VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Recycling">
<ListBox.Resources>
<!--SelectedItem with focus-->
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#4F6180"/>
<!--SelectedItem without focus-->
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="#4F6180"/>
</ListBox.Resources>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="5" Cursor="Hand">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="32"></ColumnDefinition>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Image x:Name="imgIco" Width="32" Height="32" HorizontalAlignment="Left" >
<Image.Source>
<MultiBinding Converter="{StaticResource ImagePathConverter}">
<MultiBinding.Bindings>
<Binding Path="IcoPath" />
<Binding Path="PluginDirectory" />
</MultiBinding.Bindings>
</MultiBinding>
</Image.Source>
</Image>
<Grid Margin="5 0 5 0" Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition Height="Auto" x:Name="SubTitleRowDefinition"></RowDefinition>
</Grid.RowDefinitions>
<TextBlock Style="{DynamicResource ItemTitleStyle}" VerticalAlignment="Center" x:Name="tbTitle" Text="{Binding Title}"></TextBlock>
<TextBlock Style="{DynamicResource ItemSubTitleStyle}" Visibility="{Binding SubTitle, Converter={wox:StringNullOrEmptyToVisibilityConverter}}" Grid.Row="1" x:Name="tbSubTitle" Text="{Binding SubTitle}"></TextBlock>
</Grid>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
2014-01-26 17:47:58 +08:00
</UserControl>