markus / KCOM / Resources / WindowStyle.xaml @ ef8fafdf
이력 | 보기 | 이력해설 | 다운로드 (16.8 KB)
1 | 4fcb686a | taeseongkim | <ResourceDictionary
|
---|---|---|---|
2 | x:Class="KCOM.Controls.CustomizedWindow.VS2012WindowStyle" |
||
3 | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
||
4 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||
5 | xmlns:cWin="clr-namespace:KCOM.Controls.CustomizedWindow" |
||
6 | xmlns:local="clr-namespace:KCOM.Controls"> |
||
7 | d33ef543 | taeseongkim | |
8 | <SolidColorBrush x:Key="TitleBarBackgroundBrush" Color="#FF2A579A" /> |
||
9 | <SolidColorBrush x:Key="VS2012WindowBorderBrush" Color="#007ACC" /> |
||
10 | <SolidColorBrush x:Key="VS2012WindowBorderBrushInactive" Color="#999999" /> |
||
11 | <SolidColorBrush x:Key="VS2012WindowStatusForeground" Color="#FFFFFF" /> |
||
12 | <SolidColorBrush x:Key="VS2012WindowStatusForegroundInactive" Color="#FFFFFF" /> |
||
13 | 40a810fc | taeseongkim | <Visibility x:Key="GripVisible">Visible</Visibility> |
14 | d33ef543 | taeseongkim | <Style x:Key="VS2012WindowStyleTitleBarButton" TargetType="{x:Type Button}"> |
15 | <Setter Property="Focusable" Value="false" /> |
||
16 | 4fcb686a | taeseongkim | <Setter Property="Foreground" Value="White" /> |
17 | d33ef543 | taeseongkim | <Setter Property="Template"> |
18 | <Setter.Value>
|
||
19 | <ControlTemplate TargetType="{x:Type Button}"> |
||
20 | <Grid>
|
||
21 | 4fcb686a | taeseongkim | <Border x:Name="PART_border" Background="Transparent" /> |
22 | d33ef543 | taeseongkim | <ContentPresenter /> |
23 | </Grid>
|
||
24 | <ControlTemplate.Triggers>
|
||
25 | <Trigger Property="IsMouseOver" Value="True"> |
||
26 | <Setter TargetName="PART_border" Property="Background" Value="#FFF" /> |
||
27 | <Setter TargetName="PART_border" Property="Opacity" Value="0.7" /> |
||
28 | </Trigger>
|
||
29 | <Trigger Property="IsPressed" Value="True"> |
||
30 | 4fcb686a | taeseongkim | <Setter TargetName="PART_border" Property="Background" Value="{StaticResource VS2012WindowBorderBrush}" /> |
31 | d33ef543 | taeseongkim | <Setter TargetName="PART_border" Property="Opacity" Value="1" /> |
32 | 4fcb686a | taeseongkim | <Setter Property="Foreground" Value="#FFF" /> |
33 | d33ef543 | taeseongkim | </Trigger>
|
34 | </ControlTemplate.Triggers>
|
||
35 | </ControlTemplate>
|
||
36 | </Setter.Value>
|
||
37 | </Setter>
|
||
38 | </Style>
|
||
39 | |||
40 | 68302e9d | taeseongkim | <Style x:Key="VS2012WindowStyle" TargetType="{x:Type cWin:CustomWindow}"> |
41 | ef8fafdf | swate0609 | <!--20240808 IRON 수정
|
42 | AllowsTransparency, WindowStyle 주석 및 Template 주석으로 CustomWindow Theme를 적용 안함. (최대화 관련하여 기본 Winform으로 변경) -->
|
||
43 | |||
44 | <!--<Setter Property="AllowsTransparency" Value="True" />
|
||
45 | <Setter Property="WindowStyle" Value="None" />-->
|
||
46 | <Setter Property="AllowsTransparency" Value="False" /> |
||
47 | <Setter Property="WindowStyle" Value="SingleBorderWindow" /> |
||
48 | d33ef543 | taeseongkim | <Setter Property="Background" Value="Transparent" /> |
49 | <Setter Property="ResizeMode" Value="CanResizeWithGrip" /> |
||
50 | 4fcb686a | taeseongkim | <Setter Property="Foreground" Value="White" /> |
51 | ef8fafdf | swate0609 | <!--<Setter Property="Template">
|
52 | d33ef543 | taeseongkim | <Setter.Value>
|
53 | 68302e9d | taeseongkim | <ControlTemplate TargetType="{x:Type cWin:CustomWindow}">
|
54 | ef8fafdf | swate0609 | --><!-- |
55 | 4fcb686a | taeseongkim | 7 is a magic number. By default Windows fits a maximized window with Margin
|
56 | 7 7 7 7 to fill entire screen (WPF .Net 4.5). Larger numbers produce a gap
|
||
57 | between maximized window and screen edges; smaller numbers show parts of
|
||
58 | the window outside of the current monitor on multi-display computers.
|
||
59 | ef8fafdf | swate0609 | --><!-- |
60 | 4fcb686a | taeseongkim | <Grid TextOptions.TextFormattingMode="Ideal" TextOptions.TextRenderingMode="Auto">
|
61 | d33ef543 | taeseongkim | <Border
|
62 | x:Name="PART_Border"
|
||
63 | Width="Auto"
|
||
64 | Height="Auto"
|
||
65 | 4fcb686a | taeseongkim | Padding="0"
|
66 | 68302e9d | taeseongkim | Background="#1B1811"
|
67 | BorderBrush="#FF1D2D44"
|
||
68 | 4fcb686a | taeseongkim | BorderThickness="1">
|
69 | <Border BorderBrush="#FF293C57" BorderThickness="2">
|
||
70 | <DockPanel
|
||
71 | HorizontalAlignment="Stretch"
|
||
72 | VerticalAlignment="Stretch"
|
||
73 | Background="Transparent">
|
||
74 | <Border
|
||
75 | x:Name="TitleBar"
|
||
76 | Background="{StaticResource TitleBarBackgroundBrush}"
|
||
77 | BorderThickness="0"
|
||
78 | DockPanel.Dock="Top"
|
||
79 | MouseLeftButtonDown="TitleBarMouseLeftButtonDown"
|
||
80 | MouseMove="TitleBarMouseMove">
|
||
81 | <Grid Height="32">
|
||
82 | <Grid.ColumnDefinitions>
|
||
83 | <ColumnDefinition Width="36" />
|
||
84 | <ColumnDefinition />
|
||
85 | <ColumnDefinition Width="34" />
|
||
86 | <ColumnDefinition Width="34" />
|
||
87 | <ColumnDefinition Width="34" />
|
||
88 | </Grid.ColumnDefinitions>
|
||
89 | <Image
|
||
90 | x:Name="Icon"
|
||
91 | Grid.Column="0"
|
||
92 | Width="32"
|
||
93 | Height="32"
|
||
94 | Margin="4,-7,0,7"
|
||
95 | HorizontalAlignment="Right"
|
||
96 | MouseLeftButtonDown="IconMouseLeftButtonDown"
|
||
97 | Source="{Binding Path=Icon, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" />
|
||
98 | <TextBlock
|
||
99 | x:Name="Caption"
|
||
100 | Grid.Column="1"
|
||
101 | Margin="4,0,0,0"
|
||
102 | HorizontalAlignment="Center"
|
||
103 | VerticalAlignment="Center"
|
||
104 | FontFamily="Segoe UI"
|
||
105 | FontSize="12"
|
||
106 | FontWeight="Bold"
|
||
107 | Foreground="White"
|
||
108 | Opacity="0.66"
|
||
109 | Text="{Binding Path=Title, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" />
|
||
110 | <Button
|
||
111 | x:Name="MinButton"
|
||
112 | Grid.Column="2"
|
||
113 | Width="34"
|
||
114 | Height="26"
|
||
115 | VerticalAlignment="Top"
|
||
116 | Click="MinButtonClick"
|
||
117 | Style="{StaticResource VS2012WindowStyleTitleBarButton}">
|
||
118 | <Grid MaxWidth="9" MaxHeight="9">
|
||
119 | <Path
|
||
120 | Data="M0,8 H8 M0,7 H8 M0,6 H8"
|
||
121 | RenderOptions.EdgeMode="Aliased"
|
||
122 | Stretch="None"
|
||
123 | Stroke="{Binding RelativeSource={RelativeSource AncestorType=Button}, Path=Foreground}"
|
||
124 | StrokeThickness="1" />
|
||
125 | </Grid>
|
||
126 | </Button>
|
||
127 | <Button
|
||
128 | x:Name="MaxButton"
|
||
129 | Grid.Column="3"
|
||
130 | Width="34"
|
||
131 | Height="26"
|
||
132 | VerticalAlignment="Top"
|
||
133 | Click="MaxButtonClick"
|
||
134 | Style="{StaticResource VS2012WindowStyleTitleBarButton}">
|
||
135 | <Grid MaxWidth="9" MaxHeight="9">
|
||
136 | <Path
|
||
137 | x:Name="PART_MaxButton_Path"
|
||
138 | Data="M0,0 H8 V8 H0 V0 M0,1 H8 M0,2 H8"
|
||
139 | RenderOptions.EdgeMode="Aliased"
|
||
140 | Stretch="None"
|
||
141 | Stroke="{Binding RelativeSource={RelativeSource AncestorType=Button}, Path=Foreground}"
|
||
142 | StrokeThickness="1" />
|
||
143 | </Grid>
|
||
144 | </Button>
|
||
145 | <Button
|
||
146 | x:Name="CloseButton"
|
||
147 | Grid.Column="4"
|
||
148 | Width="34"
|
||
149 | Height="26"
|
||
150 | VerticalAlignment="Top"
|
||
151 | Click="CloseButtonClick"
|
||
152 | Style="{StaticResource VS2012WindowStyleTitleBarButton}">
|
||
153 | <Grid MaxWidth="9" MaxHeight="9">
|
||
154 | <Path
|
||
155 | Data="M0,0 L8,8 M0,8 L8,0"
|
||
156 | Stretch="None"
|
||
157 | Stroke="{Binding RelativeSource={RelativeSource AncestorType=Button}, Path=Foreground}"
|
||
158 | StrokeThickness="1.5" />
|
||
159 | </Grid>
|
||
160 | </Button>
|
||
161 | </Grid>
|
||
162 | </Border>
|
||
163 | <ContentPresenter />
|
||
164 | </DockPanel>
|
||
165 | 68302e9d | taeseongkim | </Border>
|
166 | d33ef543 | taeseongkim | </Border>
|
167 | <Line
|
||
168 | x:Name="lnSizeNorth"
|
||
169 | Cursor="SizeNS"
|
||
170 | 4fcb686a | taeseongkim | MouseDown="OnSizeNorth"
|
171 | Stroke="Transparent"
|
||
172 | 68302e9d | taeseongkim | StrokeThickness="4"
|
173 | 4fcb686a | taeseongkim | X1="1"
|
174 | X2="{TemplateBinding ActualWidth}"
|
||
175 | Y1="1"
|
||
176 | Y2="1" />
|
||
177 | d33ef543 | taeseongkim | <Line
|
178 | x:Name="lnSizeSouth"
|
||
179 | 4fcb686a | taeseongkim | VerticalAlignment="Bottom"
|
180 | d33ef543 | taeseongkim | Cursor="SizeNS"
|
181 | 4fcb686a | taeseongkim | MouseDown="OnSizeSouth"
|
182 | Stroke="Transparent"
|
||
183 | 68302e9d | taeseongkim | StrokeThickness="4"
|
184 | 4fcb686a | taeseongkim | X1="1"
|
185 | X2="{TemplateBinding ActualWidth}"
|
||
186 | Y1="{TemplateBinding ActualHeight}"
|
||
187 | Y2="{TemplateBinding ActualHeight}" />
|
||
188 | d33ef543 | taeseongkim | <Line
|
189 | x:Name="lnSizeWest"
|
||
190 | Cursor="SizeWE"
|
||
191 | 4fcb686a | taeseongkim | MouseDown="OnSizeWest"
|
192 | Stroke="Transparent"
|
||
193 | 68302e9d | taeseongkim | StrokeThickness="4"
|
194 | 4fcb686a | taeseongkim | X1="1"
|
195 | X2="1"
|
||
196 | Y1="1"
|
||
197 | Y2="{TemplateBinding ActualHeight}" />
|
||
198 | d33ef543 | taeseongkim | <Line
|
199 | x:Name="lnSizeEast"
|
||
200 | 4fcb686a | taeseongkim | HorizontalAlignment="Right"
|
201 | Cursor="SizeWE"
|
||
202 | MouseDown="OnSizeEast"
|
||
203 | d33ef543 | taeseongkim | Stroke="Transparent"
|
204 | 68302e9d | taeseongkim | StrokeThickness="4"
|
205 | 4fcb686a | taeseongkim | X1="{TemplateBinding ActualWidth}"
|
206 | X2="{TemplateBinding ActualWidth}"
|
||
207 | Y1="1"
|
||
208 | Y2="{TemplateBinding ActualHeight}" />
|
||
209 | <Rectangle
|
||
210 | x:Name="rectSizeNorthWest"
|
||
211 | Width="5"
|
||
212 | Height="5"
|
||
213 | HorizontalAlignment="Left"
|
||
214 | VerticalAlignment="Top"
|
||
215 | Cursor="SizeNWSE"
|
||
216 | Fill="Transparent"
|
||
217 | MouseDown="OnSizeNorthWest" />
|
||
218 | <Rectangle
|
||
219 | x:Name="rectSizeNorthEast"
|
||
220 | Width="5"
|
||
221 | Height="5"
|
||
222 | HorizontalAlignment="Right"
|
||
223 | VerticalAlignment="Top"
|
||
224 | Cursor="SizeNESW"
|
||
225 | Fill="Transparent"
|
||
226 | MouseDown="OnSizeNorthEast" />
|
||
227 | <Rectangle
|
||
228 | x:Name="rectSizeSouthWest"
|
||
229 | Width="5"
|
||
230 | Height="5"
|
||
231 | HorizontalAlignment="Left"
|
||
232 | VerticalAlignment="Bottom"
|
||
233 | Cursor="SizeNESW"
|
||
234 | Fill="Transparent"
|
||
235 | MouseDown="OnSizeSouthWest" />
|
||
236 | <Rectangle
|
||
237 | x:Name="rectSizeSouthEast"
|
||
238 | Width="5"
|
||
239 | Height="5"
|
||
240 | HorizontalAlignment="Right"
|
||
241 | VerticalAlignment="Bottom"
|
||
242 | Cursor="SizeNWSE"
|
||
243 | Fill="Transparent"
|
||
244 | MouseDown="OnSizeSouthEast" />
|
||
245 | d33ef543 | taeseongkim | </Grid>
|
246 | <ControlTemplate.Triggers>
|
||
247 | 4fcb686a | taeseongkim | <Trigger Property="CustomState" Value="Maximized">
|
248 | <Setter TargetName="PART_MaxButton_Path" Property="Data" Value="M0,3 H5 V8 H0 V3 M0,4 H5 M3,0 H8 V5 H7 M3,1 H8" />
|
||
249 | <Setter TargetName="lnSizeNorth" Property="Visibility" Value="Hidden" />
|
||
250 | <Setter TargetName="lnSizeSouth" Property="Visibility" Value="Hidden" />
|
||
251 | <Setter TargetName="lnSizeWest" Property="Visibility" Value="Hidden" />
|
||
252 | <Setter TargetName="lnSizeEast" Property="Visibility" Value="Hidden" />
|
||
253 | <Setter TargetName="rectSizeNorthWest" Property="Visibility" Value="Hidden" />
|
||
254 | <Setter TargetName="rectSizeNorthEast" Property="Visibility" Value="Hidden" />
|
||
255 | <Setter TargetName="rectSizeSouthWest" Property="Visibility" Value="Hidden" />
|
||
256 | <Setter TargetName="rectSizeSouthEast" Property="Visibility" Value="Hidden" />
|
||
257 | d33ef543 | taeseongkim | </Trigger>
|
258 | <Trigger Property="IsActive" Value="False">
|
||
259 | 4fcb686a | taeseongkim | <Setter TargetName="PART_Border" Property="BorderBrush" Value="#54626F" />
|
260 | d33ef543 | taeseongkim | </Trigger>
|
261 | </ControlTemplate.Triggers>
|
||
262 | </ControlTemplate>
|
||
263 | </Setter.Value>
|
||
264 | ef8fafdf | swate0609 | </Setter>-->
|
265 | d33ef543 | taeseongkim | <Style.Resources>
|
266 | <Style TargetType="{x:Type StatusBar}"> |
||
267 | <Style.Triggers>
|
||
268 | <DataTrigger Binding="{Binding IsActive, RelativeSource={RelativeSource AncestorType=Window}}" Value="True"> |
||
269 | <Setter Property="Foreground" Value="{StaticResource VS2012WindowStatusForeground}" /> |
||
270 | <Setter Property="Background" Value="{StaticResource VS2012WindowBorderBrush}" /> |
||
271 | </DataTrigger>
|
||
272 | <DataTrigger Binding="{Binding IsActive, RelativeSource={RelativeSource AncestorType=Window}}" Value="False"> |
||
273 | <Setter Property="Foreground" Value="{StaticResource VS2012WindowStatusForegroundInactive}" /> |
||
274 | <Setter Property="Background" Value="{StaticResource VS2012WindowBorderBrushInactive}" /> |
||
275 | </DataTrigger>
|
||
276 | </Style.Triggers>
|
||
277 | </Style>
|
||
278 | </Style.Resources>
|
||
279 | </Style>
|
||
280 | </ResourceDictionary> |