-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
101 lines (96 loc) · 5.24 KB
/
MainWindow.xaml
File metadata and controls
101 lines (96 loc) · 5.24 KB
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
<Window x:Class="ImageConverter.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:ImageConverter"
mc:Ignorable="d"
Title="Image Converter" Height="600" Width="800"
WindowStartupLocation="CenterScreen"
Background="#FF2D2D30">
<Window.Resources>
<Style TargetType="Button">
<Setter Property="Background" Value="#FF3F3F46"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="BorderBrush" Value="#FF555555"/>
<Setter Property="Padding" Value="10,5"/>
<Setter Property="Margin" Value="5"/>
<Setter Property="MinWidth" Value="120"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#FF555555"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.5"/>
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="ListView">
<Setter Property="Background" Value="#FF252526"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="BorderBrush" Value="#FF555555"/>
</Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="White"/>
</Style>
<Style TargetType="ComboBox">
<Setter Property="Background" Value="#FF252526"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="BorderBrush" Value="#FF555555"/>
</Style>
<Style TargetType="ComboBoxItem">
<Setter Property="Background" Value="#FF3F3F46"/>
<Setter Property="Foreground" Value="White"/>
<Style.Triggers>
<Trigger Property="IsHighlighted" Value="True">
<Setter Property="Background" Value="#FF555555"/>
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<DockPanel>
<StatusBar DockPanel.Dock="Bottom" Background="#FF333337" Height="24">
<StatusBarItem>
<ProgressBar x:Name="ConversionProgressBar" Width="200" Height="16" Visibility="Collapsed"/>
</StatusBarItem>
<StatusBarItem>
<TextBlock x:Name="StatusTextBlock" Text="Готово" Margin="5,0"/>
</StatusBarItem>
<StatusBarItem HorizontalAlignment="Right">
<TextBlock Text="made by fleim" Foreground="#FFAAAAAA" Margin="0,0,10,0"/>
</StatusBarItem>
</StatusBar>
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Margin="10">
<Button x:Name="AddFilesButton" Content="Добавить файлы..." Click="AddFilesButton_Click"/>
<Button x:Name="SetAllButton" Content="Задать формат для всех..." Click="SetAllButton_Click"/>
<Button x:Name="ClearListButton" Content="Очистить список" Click="ClearListButton_Click"/>
</StackPanel>
<Button x:Name="ConvertButton" DockPanel.Dock="Bottom" Content="Начать конвертацию" Height="40" FontSize="16" FontWeight="Bold" Margin="10" Click="ConvertButton_Click"/>
<ListView x:Name="ImageListView" Margin="10,0,10,10" AllowDrop="True" DragEnter="ImageListView_DragEnter" Drop="ImageListView_Drop">
<ListView.View>
<GridView>
<GridViewColumn Header="Исходный файл" Width="300" DisplayMemberBinding="{Binding FileName}"/>
<GridViewColumn Header="Целевой формат" Width="150">
<GridViewColumn.CellTemplate>
<DataTemplate>
<ComboBox ItemsSource="{Binding SupportedFormats}" SelectedItem="{Binding TargetFormat}" Width="120"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Header="Статус" Width="150" DisplayMemberBinding="{Binding Status}"/>
</GridView>
</ListView.View>
</ListView>
</DockPanel>
</Window>