mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 12:18:50 +02:00
UserControl -> ListBox
This commit is contained in:
@@ -1,13 +1,12 @@
|
|||||||
<UserControl x:Class="Wox.ResultListBox"
|
<ListBox x:Class="Wox.ResultListBox"
|
||||||
x:Name="Results"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:converters="clr-namespace:Wox.Converters"
|
xmlns:converters="clr-namespace:Wox.Converters"
|
||||||
xmlns:vm ="clr-namespace:Wox.ViewModel"
|
xmlns:vm ="clr-namespace:Wox.ViewModel"
|
||||||
mc:Ignorable="d" d:DesignWidth="100" d:DesignHeight="100" d:DataContext="{d:DesignInstance vm:ResultsViewModel}">
|
mc:Ignorable="d" d:DesignWidth="100" d:DesignHeight="100" d:DataContext="{d:DesignInstance vm:ResultsViewModel}"
|
||||||
<ListBox x:Name="lbResults" MaxHeight="{Binding MaxHeight}" SelectedItem="{Binding SelectedResult}"
|
MaxHeight="{Binding MaxHeight}" SelectedItem="{Binding SelectedResult}"
|
||||||
HorizontalContentAlignment="Stretch" ItemsSource="{Binding Results}" Margin="{Binding Margin}"
|
HorizontalContentAlignment="Stretch" ItemsSource="{Binding Results}" Margin="{Binding Margin}"
|
||||||
Style="{DynamicResource BaseListboxStyle}" SelectionChanged="lbResults_SelectionChanged" Focusable="False"
|
Style="{DynamicResource BaseListboxStyle}" SelectionChanged="lbResults_SelectionChanged" Focusable="False"
|
||||||
KeyboardNavigation.DirectionalNavigation="Cycle" SelectionMode="Single"
|
KeyboardNavigation.DirectionalNavigation="Cycle" SelectionMode="Single"
|
||||||
@@ -99,5 +98,4 @@
|
|||||||
</Setter>
|
</Setter>
|
||||||
</Style>
|
</Style>
|
||||||
</ListBox.ItemContainerStyle>
|
</ListBox.ItemContainerStyle>
|
||||||
</ListBox>
|
</ListBox>
|
||||||
</UserControl>
|
|
||||||
@@ -33,7 +33,7 @@ namespace Wox
|
|||||||
{
|
{
|
||||||
if (e.AddedItems.Count > 0 && e.AddedItems[0] != null)
|
if (e.AddedItems.Count > 0 && e.AddedItems[0] != null)
|
||||||
{
|
{
|
||||||
lbResults.ScrollIntoView(e.AddedItems[0]);
|
ScrollIntoView(e.AddedItems[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user