|
11 | 11 | <Design.DataContext> |
12 | 12 | <vm:MainViewModel /> |
13 | 13 | </Design.DataContext> |
14 | | - |
| 14 | + <UserControl.Styles> |
| 15 | + <Style Selector="TabControl WrapPanel"> |
| 16 | + <Setter Property="MaxHeight" Value="32"/> |
| 17 | + <Setter Property="Margin" Value="0, 0, 0, 5"/> |
| 18 | + </Style> |
| 19 | + <Style Selector="TabControl > TextBlock"> |
| 20 | + <Setter Property="FontSize" Value="12"/> |
| 21 | + </Style> |
| 22 | + <Style Selector="Label"> |
| 23 | + <Setter Property="VerticalAlignment" Value="Center"/> |
| 24 | + </Style> |
| 25 | + </UserControl.Styles> |
| 26 | + |
15 | 27 | <Grid Margin="5"> |
16 | 28 | <Grid.RowDefinitions> |
17 | | - <RowDefinition Height="Auto"/> |
18 | 29 | <RowDefinition Height="Auto"/> |
19 | 30 | <RowDefinition Height="10"/> |
20 | 31 | <RowDefinition Height="*"/> |
21 | 32 | </Grid.RowDefinitions> |
22 | | - <Grid Grid.Row="0" Margin="0, 5, 0, 0"> |
23 | | - <Grid.ColumnDefinitions> |
24 | | - <ColumnDefinition Width="120"/> |
25 | | - <ColumnDefinition/> |
26 | | - <ColumnDefinition Width="110"/> |
27 | | - </Grid.ColumnDefinitions> |
28 | | - <Label Grid.Column="0" >Input file: </Label> |
29 | | - <TextBox Grid.Column="1" Height="24" Text="{Binding InputFile, Mode=TwoWay}"></TextBox> |
30 | | - <Button Grid.Column="2" Margin="5, 0, 0, 0" Command="{Binding BrowseInputFileCommand}" HorizontalAlignment="Right">Browse</Button> |
31 | | - </Grid> |
32 | | - <Grid Grid.Row="1"> |
| 33 | + <Grid Grid.Row="0" |
| 34 | + Margin="0, 5, 0, 0"> |
33 | 35 | <Grid.ColumnDefinitions> |
| 36 | + <ColumnDefinition Width="Auto"/> |
34 | 37 | <ColumnDefinition/> |
35 | | - <ColumnDefinition/> |
| 38 | + <ColumnDefinition Width="Auto"/> |
| 39 | + <ColumnDefinition Width="Auto"/> |
36 | 40 | </Grid.ColumnDefinitions> |
37 | | - <StackPanel Grid.Column="0" Orientation="Horizontal" Margin="0, 5"> |
38 | | - <Button Command="{Binding AddFilesCommand}" |
39 | | - Margin="5, 0">Add files</Button> |
40 | | - <Button Command="{Binding AddDirCommand}" |
41 | | - Margin="5, 0">Add folder</Button> |
42 | | - <Button Command="{Binding RemoveCommand}" |
43 | | - Margin="5, 0">Remove</Button> |
44 | | - <Button Command="{Binding RemoveAllCommand}" |
45 | | - Margin="5, 0">Remove All</Button> |
46 | | - <Button Command="{Binding BackCommand}" |
47 | | - Margin="5, 0">Back</Button> |
48 | | - </StackPanel> |
49 | | - <StackPanel Grid.Column="1" Orientation="Horizontal" FlowDirection="RightToLeft"> |
50 | | - <Button Command="{Binding HideFilesCommand}" |
51 | | - Margin="5, 0">Hide Files</Button> |
52 | | - </StackPanel> |
| 41 | + <Label Grid.Column="0" |
| 42 | + Margin="2, 2, 5, 2">Input file: </Label> |
| 43 | + <TextBox Grid.Column="1" |
| 44 | + Height="24" |
| 45 | + Text="{Binding InputFile, Mode=TwoWay}" |
| 46 | + Margin="2, 2, 2, 2"></TextBox> |
| 47 | + <Button Grid.Column="2" |
| 48 | + Command="{Binding BrowseInputFileCommand}" |
| 49 | + Margin="10, 0, 5, 0" |
| 50 | + HorizontalAlignment="Right">Browse</Button> |
| 51 | + <Button Grid.Column="3" |
| 52 | + Command="{Binding HideFilesCommand}" |
| 53 | + Margin="5, 0">Hide Files</Button> |
53 | 54 | </Grid> |
54 | | - |
55 | | - <ProgressBar Grid.Row="2" |
| 55 | + <ProgressBar Grid.Row="1" |
56 | 56 | Margin="5" |
57 | 57 | Value="{Binding PercentDone}" |
58 | 58 | IsVisible="{Binding IsRunning}"/> |
| 59 | + <TabControl Grid.Row="2"> |
| 60 | + <TabItem Name="FilesList" Header="File View"> |
| 61 | + <Grid> |
| 62 | + <Grid.RowDefinitions> |
| 63 | + <RowDefinition Height="48"/> |
| 64 | + <RowDefinition Height="Auto"/> |
| 65 | + </Grid.RowDefinitions> |
| 66 | + <Grid Grid.Row="0"> |
| 67 | + <Grid.ColumnDefinitions> |
| 68 | + <ColumnDefinition/> |
| 69 | + <ColumnDefinition/> |
| 70 | + </Grid.ColumnDefinitions> |
| 71 | + <StackPanel Grid.Column="0" |
| 72 | + Orientation="Horizontal" |
| 73 | + Margin="0, 5"> |
| 74 | + <Button Command="{Binding AddFilesCommand}" |
| 75 | + Margin="5, 0">Add files</Button> |
| 76 | + <Button Command="{Binding AddDirCommand}" |
| 77 | + Margin="5, 0">Add folder</Button> |
| 78 | + <Button Command="{Binding RemoveCommand}" |
| 79 | + Margin="5, 0">Remove</Button> |
| 80 | + <Button Command="{Binding RemoveAllCommand}" |
| 81 | + Margin="5, 0">Remove All</Button> |
| 82 | + <Button Command="{Binding BackCommand}" |
| 83 | + Margin="5, 0">Back</Button> |
| 84 | + </StackPanel> |
| 85 | + <StackPanel Grid.Column="1" |
| 86 | + Orientation="Horizontal" |
| 87 | + FlowDirection="RightToLeft"> |
| 88 | + </StackPanel> |
| 89 | + </Grid> |
| 90 | + <ListBox Grid.Row="1" |
| 91 | + Name="FilesListBox" |
| 92 | + ItemsSource="{Binding Files.CurrentDirectory.Children}" |
| 93 | + SelectedItem="{Binding SelectedItem}" |
| 94 | + DoubleTapped="FilesList_DoubleTap"> |
| 95 | + <ListBox.ItemTemplate> |
| 96 | + <DataTemplate> |
| 97 | + <TextBlock Text="{Binding Name}"/> |
| 98 | + </DataTemplate> |
| 99 | + </ListBox.ItemTemplate> |
| 100 | + </ListBox> |
| 101 | + </Grid> |
| 102 | + </TabItem> |
| 103 | + <TabItem Name="Options" Header="Options"> |
| 104 | + <StackPanel Margin="5, 15, 5, 5" HorizontalAlignment="Center" VerticalAlignment="Center"> |
| 105 | + <!--To-do: implement password protection--> |
| 106 | + <!--<Grid> |
| 107 | + <Grid.ColumnDefinitions> |
| 108 | + <ColumnDefinition Width="48"/> |
| 109 | + <ColumnDefinition Width="120"/> |
| 110 | + <ColumnDefinition/> |
| 111 | + </Grid.ColumnDefinitions> |
| 112 | + <CheckBox Grid.Column="0" |
| 113 | + Name="IsEnabledCheckBox" |
| 114 | + IsChecked="{Binding Options.IsPasswordProtected}"/> |
| 115 | + <Label Grid.Column="1">Password: </Label> |
| 116 | + <TextBox Grid.Column="2" |
| 117 | + Text="{Binding Options.Password}" |
| 118 | + IsEnabled="{Binding Options.IsPasswordProtected}"/> |
| 119 | + </Grid>--> |
| 120 | + <Grid> |
| 121 | + <Grid.ColumnDefinitions> |
| 122 | + <ColumnDefinition/> |
| 123 | + <ColumnDefinition/> |
| 124 | + </Grid.ColumnDefinitions> |
| 125 | + <Label Grid.Column="0" |
| 126 | + Margin="0, 0, 5, 0">Compression Level: </Label> |
| 127 | + <ComboBox Grid.Column="1" |
| 128 | + Name="CompressionLevelComboBox" |
| 129 | + ItemsSource="{Binding CompressionLevels}" |
| 130 | + SelectedItem="{Binding SelectedCompressionLevel}"/> |
| 131 | + </Grid> |
| 132 | + </StackPanel> |
| 133 | + </TabItem> |
| 134 | + </TabControl> |
59 | 135 |
|
60 | | - <ListBox Grid.Row="3" |
61 | | - Name="FilesListBox" |
62 | | - ItemsSource="{Binding Files.CurrentDirectory.Children}" |
63 | | - SelectedItem="{Binding SelectedItem}" |
64 | | - DoubleTapped="FilesList_DoubleTap"> |
65 | | - <ListBox.ItemTemplate> |
66 | | - <DataTemplate> |
67 | | - <TextBlock Text="{Binding Name}"/> |
68 | | - </DataTemplate> |
69 | | - </ListBox.ItemTemplate> |
70 | | - </ListBox> |
71 | 136 | </Grid> |
72 | 137 | </UserControl> |
0 commit comments