프로젝트

일반

사용자정보

통계
| 브랜치(Branch): | 개정판:

markus / KCOM / Resources / WindowStyle.xaml @ a197bf6f

이력 | 보기 | 이력해설 | 다운로드 (16.7 KB)

1
<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

    
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
    <Visibility x:Key="GripVisible">Visible</Visibility>
14
    <Style x:Key="VS2012WindowStyleTitleBarButton" TargetType="{x:Type Button}">
15
        <Setter Property="Focusable" Value="false" />
16
        <Setter Property="Foreground" Value="White" />
17
        <Setter Property="Template">
18
            <Setter.Value>
19
                <ControlTemplate TargetType="{x:Type Button}">
20
                    <Grid>
21
                        <Border x:Name="PART_border" Background="Transparent" />
22
                        <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
                            <Setter TargetName="PART_border" Property="Background" Value="{StaticResource VS2012WindowBorderBrush}" />
31
                            <Setter TargetName="PART_border" Property="Opacity" Value="1" />
32
                            <Setter Property="Foreground" Value="#FFF" />
33
                        </Trigger>
34
                    </ControlTemplate.Triggers>
35
                </ControlTemplate>
36
            </Setter.Value>
37
        </Setter>
38
    </Style>
39

    
40
    <Style x:Key="VS2012WindowStyle" TargetType="{x:Type cWin:CustomWindow}">
41
        <!--
42
            20240808 IRON 수정
43
            AllowsTransparency, WindowStyle 주석 및 Template 주석으로 CustomWindow Theme를 적용 안함. (최대화 관련하여 기본 Winform으로 변경)
44
        -->
45

    
46
        <!--<Setter Property="AllowsTransparency" Value="True" />
47
        <Setter Property="WindowStyle" Value="None" />-->
48
        <Setter Property="AllowsTransparency" Value="False" />
49
        <Setter Property="WindowStyle" Value="SingleBorderWindow" />
50
        <Setter Property="Background" Value="Transparent" />
51
        <Setter Property="ResizeMode" Value="CanResizeWithGrip" />
52
        <Setter Property="Foreground" Value="White" />
53
        <!--<Setter Property="Template">
54
            <Setter.Value>
55
                <ControlTemplate TargetType="{x:Type cWin:CustomWindow}">
56
        -->
57
        <!--
58
            7 is a magic number. By default Windows fits a maximized window with Margin
59
            7 7 7 7 to fill entire screen (WPF .Net 4.5). Larger numbers produce a gap
60
            between maximized window and screen edges; smaller numbers show parts of
61
            the window outside of the current monitor on multi-display computers.
62
        -->
63
        <!--
64
                    <Grid TextOptions.TextFormattingMode="Ideal" TextOptions.TextRenderingMode="Auto">
65
                        <Border
66
                            x:Name="PART_Border"
67
                            Width="Auto"
68
                            Height="Auto"
69
                            Padding="0"
70
                            Background="#1B1811"
71
                            BorderBrush="#FF1D2D44"
72
                            BorderThickness="1">
73
                            <Border BorderBrush="#FF293C57" BorderThickness="2">
74
                                <DockPanel
75
                                    HorizontalAlignment="Stretch"
76
                                    VerticalAlignment="Stretch"
77
                                    Background="Transparent">
78
                                    <Border
79
                                        x:Name="TitleBar"
80
                                        Background="{StaticResource TitleBarBackgroundBrush}"
81
                                        BorderThickness="0"
82
                                        DockPanel.Dock="Top"
83
                                        MouseLeftButtonDown="TitleBarMouseLeftButtonDown"
84
                                        MouseMove="TitleBarMouseMove">
85
                                        <Grid Height="32">
86
                                            <Grid.ColumnDefinitions>
87
                                                <ColumnDefinition Width="36" />
88
                                                <ColumnDefinition />
89
                                                <ColumnDefinition Width="34" />
90
                                                <ColumnDefinition Width="34" />
91
                                                <ColumnDefinition Width="34" />
92
                                            </Grid.ColumnDefinitions>
93
                                            <Image
94
                                                x:Name="Icon"
95
                                                Grid.Column="0"
96
                                                Width="32"
97
                                                Height="32"
98
                                                Margin="4,-7,0,7"
99
                                                HorizontalAlignment="Right"
100
                                                MouseLeftButtonDown="IconMouseLeftButtonDown"
101
                                                Source="{Binding Path=Icon, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" />
102
                                            <TextBlock
103
                                                x:Name="Caption"
104
                                                Grid.Column="1"
105
                                                Margin="4,0,0,0"
106
                                                HorizontalAlignment="Center"
107
                                                VerticalAlignment="Center"
108
                                                FontFamily="Segoe UI"
109
                                                FontSize="12"
110
                                                FontWeight="Bold"
111
                                                Foreground="White"
112
                                                Opacity="0.66"
113
                                                Text="{Binding Path=Title, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" />
114
                                            <Button
115
                                                x:Name="MinButton"
116
                                                Grid.Column="2"
117
                                                Width="34"
118
                                                Height="26"
119
                                                VerticalAlignment="Top"
120
                                                Click="MinButtonClick"
121
                                                Style="{StaticResource VS2012WindowStyleTitleBarButton}">
122
                                                <Grid MaxWidth="9" MaxHeight="9">
123
                                                    <Path
124
                                                        Data="M0,8 H8 M0,7 H8 M0,6 H8"
125
                                                        RenderOptions.EdgeMode="Aliased"
126
                                                        Stretch="None"
127
                                                        Stroke="{Binding RelativeSource={RelativeSource AncestorType=Button}, Path=Foreground}"
128
                                                        StrokeThickness="1" />
129
                                                </Grid>
130
                                            </Button>
131
                                            <Button
132
                                                x:Name="MaxButton"
133
                                                Grid.Column="3"
134
                                                Width="34"
135
                                                Height="26"
136
                                                VerticalAlignment="Top"
137
                                                Click="MaxButtonClick"
138
                                                Style="{StaticResource VS2012WindowStyleTitleBarButton}">
139
                                                <Grid MaxWidth="9" MaxHeight="9">
140
                                                    <Path
141
                                                        x:Name="PART_MaxButton_Path"
142
                                                        Data="M0,0 H8 V8 H0 V0 M0,1 H8 M0,2 H8"
143
                                                        RenderOptions.EdgeMode="Aliased"
144
                                                        Stretch="None"
145
                                                        Stroke="{Binding RelativeSource={RelativeSource AncestorType=Button}, Path=Foreground}"
146
                                                        StrokeThickness="1" />
147
                                                </Grid>
148
                                            </Button>
149
                                            <Button
150
                                                x:Name="CloseButton"
151
                                                Grid.Column="4"
152
                                                Width="34"
153
                                                Height="26"
154
                                                VerticalAlignment="Top"
155
                                                Click="CloseButtonClick"
156
                                                Style="{StaticResource VS2012WindowStyleTitleBarButton}">
157
                                                <Grid MaxWidth="9" MaxHeight="9">
158
                                                    <Path
159
                                                        Data="M0,0 L8,8 M0,8 L8,0"
160
                                                        Stretch="None"
161
                                                        Stroke="{Binding RelativeSource={RelativeSource AncestorType=Button}, Path=Foreground}"
162
                                                        StrokeThickness="1.5" />
163
                                                </Grid>
164
                                            </Button>
165
                                        </Grid>
166
                                    </Border>
167
                                    <ContentPresenter />
168
                                </DockPanel>
169
                            </Border>
170
                        </Border>
171
                        <Line
172
                            x:Name="lnSizeNorth"
173
                            Cursor="SizeNS"
174
                            MouseDown="OnSizeNorth"
175
                            Stroke="Transparent"
176
                            StrokeThickness="4"
177
                            X1="1"
178
                            X2="{TemplateBinding ActualWidth}"
179
                            Y1="1"
180
                            Y2="1" />
181
                        <Line
182
                            x:Name="lnSizeSouth"
183
                            VerticalAlignment="Bottom"
184
                            Cursor="SizeNS"
185
                            MouseDown="OnSizeSouth"
186
                            Stroke="Transparent"
187
                            StrokeThickness="4"
188
                            X1="1"
189
                            X2="{TemplateBinding ActualWidth}"
190
                            Y1="{TemplateBinding ActualHeight}"
191
                            Y2="{TemplateBinding ActualHeight}" />
192
                        <Line
193
                            x:Name="lnSizeWest"
194
                            Cursor="SizeWE"
195
                            MouseDown="OnSizeWest"
196
                            Stroke="Transparent"
197
                            StrokeThickness="4"
198
                            X1="1"
199
                            X2="1"
200
                            Y1="1"
201
                            Y2="{TemplateBinding ActualHeight}" />
202
                        <Line
203
                            x:Name="lnSizeEast"
204
                            HorizontalAlignment="Right"
205
                            Cursor="SizeWE"
206
                            MouseDown="OnSizeEast"
207
                            Stroke="Transparent"
208
                            StrokeThickness="4"
209
                            X1="{TemplateBinding ActualWidth}"
210
                            X2="{TemplateBinding ActualWidth}"
211
                            Y1="1"
212
                            Y2="{TemplateBinding ActualHeight}" />
213
                        <Rectangle
214
                            x:Name="rectSizeNorthWest"
215
                            Width="5"
216
                            Height="5"
217
                            HorizontalAlignment="Left"
218
                            VerticalAlignment="Top"
219
                            Cursor="SizeNWSE"
220
                            Fill="Transparent"
221
                            MouseDown="OnSizeNorthWest" />
222
                        <Rectangle
223
                            x:Name="rectSizeNorthEast"
224
                            Width="5"
225
                            Height="5"
226
                            HorizontalAlignment="Right"
227
                            VerticalAlignment="Top"
228
                            Cursor="SizeNESW"
229
                            Fill="Transparent"
230
                            MouseDown="OnSizeNorthEast" />
231
                        <Rectangle
232
                            x:Name="rectSizeSouthWest"
233
                            Width="5"
234
                            Height="5"
235
                            HorizontalAlignment="Left"
236
                            VerticalAlignment="Bottom"
237
                            Cursor="SizeNESW"
238
                            Fill="Transparent"
239
                            MouseDown="OnSizeSouthWest" />
240
                        <Rectangle
241
                            x:Name="rectSizeSouthEast"
242
                            Width="5"
243
                            Height="5"
244
                            HorizontalAlignment="Right"
245
                            VerticalAlignment="Bottom"
246
                            Cursor="SizeNWSE"
247
                            Fill="Transparent"
248
                            MouseDown="OnSizeSouthEast" />
249
                    </Grid>
250
                    <ControlTemplate.Triggers>
251
                        <Trigger Property="CustomState" Value="Maximized">
252
                            <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" />
253
                            <Setter TargetName="lnSizeNorth" Property="Visibility" Value="Hidden" />
254
                            <Setter TargetName="lnSizeSouth" Property="Visibility" Value="Hidden" />
255
                            <Setter TargetName="lnSizeWest" Property="Visibility" Value="Hidden" />
256
                            <Setter TargetName="lnSizeEast" Property="Visibility" Value="Hidden" />
257
                            <Setter TargetName="rectSizeNorthWest" Property="Visibility" Value="Hidden" />
258
                            <Setter TargetName="rectSizeNorthEast" Property="Visibility" Value="Hidden" />
259
                            <Setter TargetName="rectSizeSouthWest" Property="Visibility" Value="Hidden" />
260
                            <Setter TargetName="rectSizeSouthEast" Property="Visibility" Value="Hidden" />
261
                        </Trigger>
262
                        <Trigger Property="IsActive" Value="False">
263
                            <Setter TargetName="PART_Border" Property="BorderBrush" Value="#54626F" />
264
                        </Trigger>
265
                    </ControlTemplate.Triggers>
266
                </ControlTemplate>
267
            </Setter.Value>
268
        </Setter>-->
269
        <Style.Resources>
270
            <Style TargetType="{x:Type StatusBar}">
271
                <Style.Triggers>
272
                    <DataTrigger Binding="{Binding IsActive, RelativeSource={RelativeSource AncestorType=Window}}" Value="True">
273
                        <Setter Property="Foreground" Value="{StaticResource VS2012WindowStatusForeground}" />
274
                        <Setter Property="Background" Value="{StaticResource VS2012WindowBorderBrush}" />
275
                    </DataTrigger>
276
                    <DataTrigger Binding="{Binding IsActive, RelativeSource={RelativeSource AncestorType=Window}}" Value="False">
277
                        <Setter Property="Foreground" Value="{StaticResource VS2012WindowStatusForegroundInactive}" />
278
                        <Setter Property="Background" Value="{StaticResource VS2012WindowBorderBrushInactive}" />
279
                    </DataTrigger>
280
                </Style.Triggers>
281
            </Style>
282
        </Style.Resources>
283
    </Style>
284
</ResourceDictionary>
클립보드 이미지 추가 (최대 크기: 500 MB)