-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
79 lines (78 loc) · 4.3 KB
/
MainWindow.xaml
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<Window x:Class="SwitchSpineBuilder.MainWindow"
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"
xmlns:local="clr-namespace:SwitchSpineBuilder"
mc:Ignorable="d"
Title="Switch Spine Builder" Height="450" Width="800">
<Grid local:ScrollViewerHelper.ShiftWheelScrollsHorizontally="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<ScrollViewer VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Auto">
<ItemsControl ItemsSource="{Binding Path=Spines}">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="local:SpineViewModel">
<Grid x:Name="gridElement">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Image Source="{Binding FullPath}" Margin="6" />
<Button Grid.RowSpan="2" Command="{Binding ClickCommand}" Opacity="0"/>
<CheckBox Grid.Row="1" IsChecked="{Binding Selected, Mode=TwoWay}" HorizontalAlignment="Center" Margin="0,10"/>
</Grid>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding Selected}" Value="True">
<Setter TargetName="gridElement" Property="Background" Value="LightBlue"/>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</ItemsControl.ItemTemplate>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel></WrapPanel>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
</ScrollViewer>
<StackPanel Grid.Column="1" Orientation="Vertical" Margin="8">
<StackPanel Orientation="Horizontal" Margin="10">
<TextBlock Text="Search:" Margin="0,0,4,0"/>
<TextBox Text="{Binding SearchQuery, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="150"/>
</StackPanel>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button Margin="10,10,5,5" Content="Select All" Command="{Binding SelectAll}"/>
<Button Margin="5,10,10,5" Grid.Column="1" Content="Clear Selected" Command="{Binding ClearAll}"/>
</Grid>
<ListView ItemsSource="{Binding SelectedSpines}" Height="200" Margin="10">
<ListView.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Filename}" Margin="2,2"/>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button Margin="10,10,5,5" Content="Save Selection" Command="{Binding SaveSelect}"/>
<Button Margin="5,10,10,5" Grid.Column="1" Content="Load Selection" Command="{Binding LoadSelect}"/>
</Grid>
<StackPanel Orientation="Horizontal" Margin="10,6,0,0">
<TextBlock Text="Pixel Gap:" Margin="0,0,4,0"/>
<TextBox Text="{Binding PixelGap, Mode=TwoWay}" Width="40" />
<TextBlock Foreground="Gray" Text="Represents the pixel gap between each spine." Margin="10,0"/>
</StackPanel>
<Button Content="Build Images + PDF" Command="{Binding BuildImage}" Margin="10"/>
<TextBlock Text="{Binding Status}" Margin="10,0" TextWrapping="Wrap"/>
</StackPanel>
</Grid>
</Window>