-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
128 lines (124 loc) · 6.91 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<Window x:Class="ThreeByTwoPrints.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:ThreeByTwoPrints"
mc:Ignorable="d"
Title="3x2 Prints" Height="700" Width="1024"
WindowState="Maximized"
d:DataContext="{d:DesignInstance local:PrintsViewModel}">
<Window.Resources>
<Style x:Key="LargeStepNumber" TargetType="TextBlock">
<Setter Property="FontSize" Value="24pt"/>
<Setter Property="Foreground" Value="#999"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="Margin" Value="0,-8,8,0"/>
</Style>
</Window.Resources>
<Grid x:Name="backgroundGrid" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="420"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0" Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0">
<TextBlock FontFamily="Segoe UI" FontSize="18pt" Foreground="Navy" Margin="0,0,0,5">
Create 3x2 prints
</TextBlock>
<Grid SnapsToDevicePixels="True" Height="1" Background="Navy" Margin="0,0,0,5"/>
<TextBlock TextWrapping="Wrap" Margin="0,0,0,11">
This app will help you create 3x2 prints by tiling 4 separate photos per 6x4 print.
</TextBlock>
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Style="{StaticResource LargeStepNumber}">1</TextBlock>
<StackPanel Grid.Row="0" Grid.Column="1" Margin="0,0,0,7">
<TextBlock FontWeight="Bold" Margin="0,0,0,2">
Import your photos
</TextBlock>
<TextBlock TextWrapping="Wrap" Margin="0,0,0,5">
Click the button below to import the photos you want to consider printing.
</TextBlock>
<Button MinWidth="75" Height="23" Padding="5,3" Command="{Binding OpenPhotosCommand}" HorizontalAlignment="Right">
Import your photos...
</Button>
</StackPanel>
<TextBlock Grid.Row="1" Grid.Column="0" Style="{StaticResource LargeStepNumber}">2</TextBlock>
<StackPanel Grid.Row="1" Grid.Column="1" Margin="0,0,0,7">
<TextBlock FontWeight="Bold" Margin="0,0,0,2">
Prepare your favourites
</TextBlock>
<TextBlock TextWrapping="Wrap" Margin="0,0,0,5">
Select each image below to review it. Remove any you don't want. Crop the rest to the 3x2 aspect ratio. Set the number of copies to print.
</TextBlock>
</StackPanel>
<TextBlock Grid.Row="2" Grid.Column="0" Style="{StaticResource LargeStepNumber}">3</TextBlock>
<StackPanel Grid.Row="2" Grid.Column="1" Margin="0,0,0,7">
<TextBlock FontWeight="Bold" Margin="0,0,0,2">
Export the composite images
</TextBlock>
<TextBlock TextWrapping="Wrap" Margin="0,0,0,5">
Click the button below to save your favourites for printing as 6x4 montages.
</TextBlock>
<Button MinWidth="75" Height="23" Padding="5,3" Command="{Binding ExportMontagesCommand}" HorizontalAlignment="Right">
Export for printing...
</Button>
</StackPanel>
</Grid>
</StackPanel>
<ListBox Grid.Row="1" ItemsSource="{Binding Photos}" SelectedItem="{Binding SelectedPhoto, Mode=TwoWay}" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="Margin" Value="1"/>
<Setter Property="Padding" Value="0"/>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate DataType="local:PhotoViewModel">
<Border Width="120" Height="120" BorderBrush="#ddd" BorderThickness="1" Padding="2"
d:DataContext="{d:DesignInstance local:PhotoViewModel}">
<Grid>
<Grid.InputBindings>
<KeyBinding Command="{Binding AddCopyCommand}" Key="F5"/>
<KeyBinding Command="{Binding RemoveCopyCommand}" Key="F6"/>
</Grid.InputBindings>
<Viewbox>
<Image Source="{Binding Image}" RenderOptions.BitmapScalingMode="HighQuality"/>
</Viewbox>
<TextBlock Text="{Binding Copies, StringFormat='×{0}'}"/>
</Grid>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
</Grid>
<Border Grid.Column="1" Background="White">
<Grid Margin="16,10,10,10">
<Viewbox>
<Image Source="{Binding SelectedPhoto.Image}" RenderOptions.BitmapScalingMode="HighQuality"/>
</Viewbox>
</Grid>
</Border>
<GridSplitter Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Stretch" Width="6" Background="White"
BorderBrush="{Binding Background, ElementName=backgroundGrid}" BorderThickness="0,0,1,0"/>
</Grid>
</Window>