Repository navigation
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
154 lines (154 loc) · 9.72 KB
/
Copy pathMainWindow.xaml
File metadata and controls
154 lines (154 loc) · 9.72 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
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<Window x:Class="LiveScreenshot.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
Width="388" SizeToContent="Height" UseLayoutRounding="True" SnapsToDevicePixels="True"
Background="Transparent" AllowsTransparency="True" Icon="LiveScreenshot.ico"
WindowStyle="None" ResizeMode="CanMinimize" WindowStartupLocation="CenterScreen" FontFamily="Segoe UI" Language="en-US">
<Window.Resources>
<sys:String x:Key="ApplicationTitle">LiveScreenshot</sys:String>
<Style TargetType="Button">
<Setter Property="Padding" Value="10,5" />
<Setter Property="Margin" Value="0,0,6,4" />
<Setter Property="MinHeight" Value="32" />
<Setter Property="Background" Value="#30323D" />
<Setter Property="Foreground" Value="#F4F5FA" />
<Setter Property="BorderBrush" Value="#555968" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="Surface" CornerRadius="5" Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"
RecognizesAccessKey="True" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Surface" Property="Background" Value="#414555" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="Surface" Property="Background" Value="#242631" />
</Trigger>
<Trigger Property="IsKeyboardFocused" Value="True">
<Setter TargetName="Surface" Property="BorderBrush" Value="#AEBFFF" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="#9296A4" />
<Setter TargetName="Surface" Property="Background" Value="#252731" />
<Setter TargetName="Surface" Property="BorderBrush" Value="#383B48" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Window.Title>
<StaticResource ResourceKey="ApplicationTitle" />
</Window.Title>
<WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="54" ResizeBorderThickness="0" GlassFrameThickness="0" CornerRadius="0"
UseAeroCaptionButtons="False" />
</WindowChrome.WindowChrome>
<Window.CommandBindings>
<CommandBinding Command="{x:Static SystemCommands.MinimizeWindowCommand}" Executed="MinimizeWindow" />
<CommandBinding Command="{x:Static SystemCommands.CloseWindowCommand}" Executed="CloseWindow" />
</Window.CommandBindings>
<Grid>
<Border Margin="20" Background="#202020" CornerRadius="8" IsHitTestVisible="False">
<Border.Effect>
<DropShadowEffect Color="Black" BlurRadius="18" ShadowDepth="4" Direction="270" Opacity="0.85" />
</Border.Effect>
</Border>
<Border Margin="20" BorderBrush="#555968" BorderThickness="0" Background="#26282C" CornerRadius="8">
<DockPanel>
<DockPanel DockPanel.Dock="Top" Height="34" LastChildFill="True">
<DockPanel.Resources>
<Style x:Key="TitleBarButton" TargetType="Button">
<Setter Property="Width" Value="36" />
<Setter Property="FontSize" Value="10" />
<Setter Property="FontFamily" Value="Segoe MDL2 Assets" />
<Setter Property="Foreground" Value="#F4F5FA" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="ButtonBackground" Background="{TemplateBinding Background}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="Command" Value="{x:Static SystemCommands.CloseWindowCommand}">
<Setter TargetName="ButtonBackground" Property="CornerRadius" Value="0,7,0,0" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#414555" />
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="CloseTitleBarButton" TargetType="Button" BasedOn="{StaticResource TitleBarButton}">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#C42B1C" />
</Trigger>
</Style.Triggers>
</Style>
</DockPanel.Resources>
<Button DockPanel.Dock="Right" Command="{x:Static SystemCommands.CloseWindowCommand}"
CommandTarget="{Binding RelativeSource={RelativeSource AncestorType=Window}}"
WindowChrome.IsHitTestVisibleInChrome="True" AutomationProperties.Name="Close"
ToolTip="Close" Content="" Style="{StaticResource CloseTitleBarButton}" />
<Button DockPanel.Dock="Right" Command="{x:Static SystemCommands.MinimizeWindowCommand}"
CommandTarget="{Binding RelativeSource={RelativeSource AncestorType=Window}}"
WindowChrome.IsHitTestVisibleInChrome="True" AutomationProperties.Name="Minimize"
ToolTip="Minimize" Content="" Style="{StaticResource TitleBarButton}" />
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="8,2,0,0">
<Image Source="LiveScreenshot.png" Width="22" Height="22" Margin="0,0,10,0"
RenderOptions.BitmapScalingMode="HighQuality" />
<TextBlock Text="{StaticResource ApplicationTitle}" FontSize="14"
Foreground="#aaa" VerticalAlignment="Center" />
</StackPanel>
</DockPanel>
<StackPanel Margin="23,12,23,24">
<WrapPanel>
<Button x:Name="CaptureWindowButton" Content="Open Window Picker" Click="OpenCaptureWindows" />
<Button x:Name="StopButton" Content="Stop Capture" Click="StopCapture" Visibility="Collapsed" />
<Button Click="CopyPath" ToolTip="Copy path" AutomationProperties.Name="Copy path" MinWidth="36">
<Path Width="16" Height="16" Stretch="Uniform" StrokeThickness="1.5"
Stroke="{Binding Foreground, RelativeSource={RelativeSource AncestorType=Button}}"
Data="M 10,6 V 3 H 2 V 13 H 5 M 5,6 H 13 V 16 H 5 Z" />
</Button>
</WrapPanel>
<TextBlock x:Name="ErrorText" Foreground="#FF9494" TextWrapping="Wrap">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Style.Triggers>
<Trigger Property="Text" Value="">
<Setter Property="Visibility" Value="Collapsed" />
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<Border Width="298" Height="225" Margin="0,4,0,0"
Background="#191A1C" BorderBrush="#383B48" BorderThickness="1" CornerRadius="5">
<Grid>
<Image x:Name="CapturePreview" Stretch="Uniform" HorizontalAlignment="Center" VerticalAlignment="Center"
AutomationProperties.Name="Latest capture preview" />
<TextBlock x:Name="Status" Text="Stopped" Foreground="#F4F5FA" FontWeight="SemiBold" IsHitTestVisible="False"
Background="#191A1C" Padding="6,5"
HorizontalAlignment="Left" VerticalAlignment="Bottom"
AutomationProperties.LiveSetting="Polite" />
</Grid>
</Border>
</StackPanel>
</DockPanel>
</Border>
</Grid>
</Window>