File size: 1,651 Bytes
fab29d7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<Window x:Class="VersOne.Epub.WpfDemo.Views.LibraryView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:controls="clr-namespace:VersOne.Epub.WpfDemo.Controls"
        Title="EpubReader demo — Library" Height="768" Width="867"
        Style="{StaticResource windowStyle}">
    <Grid Margin="4">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Border Grid.Row="0" BorderBrush="#CCCCCC" BorderThickness="0,0,0,1">
            <StackPanel Orientation="Horizontal" Margin="0,0,0,6">
                <Button Padding="8" Command="{Binding AddBookCommand}" Style="{StaticResource whiteButtonStyle}">Add book</Button>
            </StackPanel>
        </Border>
        <ScrollViewer Grid.Row="1" Margin="0,8,0,0" ScrollViewer.VerticalScrollBarVisibility="Auto">
            <ItemsControl ItemsSource="{Binding Books}">
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <WrapPanel />
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <controls:BookButton Command="{Binding DataContext.OpenBookCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}" CommandParameter="{Binding}" />
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </ScrollViewer>
    </Grid>
</Window>