-
Notifications
You must be signed in to change notification settings - Fork 1
/
MainWindow.xaml
65 lines (64 loc) · 3.33 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
<Window x:Class="ImageWatcher.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:ImageWatcher"
mc:Ignorable="d"
Title="Image Watcher" Height="400" Width="500">
<Window.Resources>
<FontFamily x:Key="Icomoon">/Resources/#icomoon</FontFamily>
<ControlTemplate x:Key="FlatButton" TargetType="Button">
<Border Name="RootElement">
<!-- define button effects-->
<VisualStateManager.VisualStateGroups>
<VisualStateGroup Name="CommonStates">
<!-- the normal state defined below -->
<VisualState Name="Normal" />
<!-- hover state-->
<VisualState Name="MouseOver">
<Storyboard>
<ColorAnimation Storyboard.TargetName="BtnBgBrush"
Storyboard.TargetProperty="Color"
To="#FF7D64FF" />
</Storyboard>
</VisualState>
<!-- disabled and click states -->
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<!-- set properties on border parent element -->
<Border.Background>
<SolidColorBrush x:Name="BtnBgBrush" Color="#3F327F" />
</Border.Background>
<Border.Margin>4,2</Border.Margin>
<Border.Width>50</Border.Width>
<Border.Cursor>Hand</Border.Cursor>
<!-- set content -->
<ContentPresenter
TextBlock.FontFamily="{StaticResource Icomoon}"
TextBlock.Foreground="White"
TextBlock.FontSize="20"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Margin="8" />
</Border>
</ControlTemplate>
</Window.Resources>
<DockPanel Background="#FFD5D5D6" Drop="ImageDrop" AllowDrop="True">
<Border DockPanel.Dock="Top" Padding="0,2" Background="#1F0C7F" BorderBrush="#7D64FF" BorderThickness="0,0,0,2">
<DockPanel Margin="4">
<Button Template="{StaticResource FlatButton}"
Click="OpenBtnClick"></Button>
<Button Template="{StaticResource FlatButton}" x:Name="FitButton" DockPanel.Dock="Right"
Click="FitButtonClick"></Button>
<TextBlock Foreground="White" x:Name="StatusText" Margin="16,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="15">100%</TextBlock>
</DockPanel>
</Border>
<Image x:Name="ImageBox" Margin="2"
Stretch="Uniform"
LayoutUpdated="ImageLayoutUpdated" />
</DockPanel>
</Window>