You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
2.3 KiB
66 lines
2.3 KiB
<UserControl |
|
x:Class="ICSharpCode.AddInManager2.View.PagedResultsView" |
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
|
xmlns:aim="clr-namespace:ICSharpCode.AddInManager2" |
|
mc:Ignorable="d"> |
|
|
|
<UserControl.Resources> |
|
<BitmapImage x:Key="PreviousPageIcon" |
|
UriSource="pack://application:,,,/ICSharpCode.AddInManager2;component/Resources/resultset_previous.png"/> |
|
<BitmapImage x:Key="NextPageIcon" |
|
UriSource="pack://application:,,,/ICSharpCode.AddInManager2;component/Resources/resultset_next.png"/> |
|
<BooleanToVisibilityConverter x:Key="BoolToVisibility"/> |
|
<aim:BooleanToFontWeightConverter x:Key="BoolToFontWeight"/> |
|
|
|
<DataTemplate x:Key="PagedListTemplate"> |
|
<Button |
|
Background="Transparent" |
|
BorderBrush="Transparent" |
|
Padding="4,0,4,0" |
|
MinWidth="0" |
|
Content="{Binding Path=Number}" |
|
Command="{Binding Path=DataContext.ShowPageCommand, RelativeSource={RelativeSource AncestorType={x:Type ListBox}}}" |
|
CommandParameter="{Binding Path=Number}" |
|
FontWeight="{Binding Path=IsSelected, Converter={StaticResource BoolToFontWeight}}"/> |
|
</DataTemplate> |
|
</UserControl.Resources> |
|
|
|
<StackPanel Orientation="Horizontal"> |
|
<Button |
|
Visibility="{Binding Path=HasPreviousPage, Converter={StaticResource BoolToVisibility}}" |
|
Command="{Binding Path=ShowPreviousPageCommand}" |
|
MinWidth="0" |
|
Padding="0,2" |
|
VerticalAlignment="Top"> |
|
<Image Source="{StaticResource PreviousPageIcon}" |
|
Height="16" |
|
Width="16"/> |
|
</Button> |
|
<ListBox |
|
VerticalAlignment="Top" |
|
HorizontalAlignment="Center" |
|
ItemTemplate="{StaticResource PagedListTemplate}" |
|
ItemsSource="{Binding Path=Pages}"> |
|
<ListBox.ItemsPanel> |
|
<ItemsPanelTemplate> |
|
<StackPanel Orientation="Horizontal"/> |
|
</ItemsPanelTemplate> |
|
</ListBox.ItemsPanel> |
|
</ListBox> |
|
<Button |
|
Visibility="{Binding Path=HasNextPage, Converter={StaticResource BoolToVisibility}}" |
|
Command="{Binding Path=ShowNextPageCommand}" |
|
BorderThickness="0" |
|
MinWidth="0" |
|
Padding="0,2" |
|
VerticalAlignment="Top"> |
|
<Image |
|
Source="{StaticResource NextPageIcon}" |
|
Height="16" |
|
Width="16"/> |
|
</Button> |
|
</StackPanel> |
|
</UserControl> |