|
1 | | -<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
2 | | - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
| 1 | +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
3 | 2 | <ResourceDictionary.MergedDictionaries> |
4 | 3 | <ResourceDictionary> |
5 | | - <!-- 按钮样式 --> |
6 | | - <!-- 关闭按钮 --> |
| 4 | + <!-- 按钮样式 --> |
| 5 | + <!-- 关闭按钮 --> |
7 | 6 | <Style x:Key="CloseButtonStyle" TargetType="Button"> |
8 | | - <Setter Property="Opacity" Value="0.5"/> |
9 | | - |
| 7 | + <Setter Property="Opacity" Value="0.5" /> |
| 8 | + |
10 | 9 | <Setter Property="Template"> |
11 | 10 | <Setter.Value> |
12 | 11 | <ControlTemplate TargetType="Button"> |
13 | 12 | <Border Name="Border" Background="Transparent"> |
14 | | - <Canvas Width="10" Height="10" ClipToBounds="True"> |
15 | | - <Line x:Name="Line01" Stroke="White" X1="0" Y1="0" X2="10" Y2="10"/> |
16 | | - <Line x:Name="Line02" Stroke="White" X1="10" Y1="0" X2="0" Y2="10"/> |
| 13 | + <Canvas |
| 14 | + Width="10" |
| 15 | + Height="10" |
| 16 | + ClipToBounds="True"> |
| 17 | + <Line |
| 18 | + x:Name="Line01" |
| 19 | + Stroke="White" |
| 20 | + X1="0" |
| 21 | + X2="10" |
| 22 | + Y1="0" |
| 23 | + Y2="10" /> |
| 24 | + <Line |
| 25 | + x:Name="Line02" |
| 26 | + Stroke="White" |
| 27 | + X1="10" |
| 28 | + X2="0" |
| 29 | + Y1="0" |
| 30 | + Y2="10" /> |
17 | 31 | </Canvas> |
18 | 32 | </Border> |
19 | | - <!-- 触发器 --> |
| 33 | + <!-- 触发器 --> |
20 | 34 | <ControlTemplate.Triggers> |
21 | 35 | <Trigger Property="IsMouseOver" Value="True"> |
22 | | - <Setter Property="Opacity" Value="0.75"/> |
| 36 | + <Setter Property="Opacity" Value="0.75" /> |
23 | 37 | </Trigger> |
24 | 38 | <Trigger Property="IsPressed" Value="True"> |
25 | | - <Setter Property="Opacity" Value="1"/> |
| 39 | + <Setter Property="Opacity" Value="1" /> |
26 | 40 | </Trigger> |
27 | 41 | </ControlTemplate.Triggers> |
28 | 42 | </ControlTemplate> |
29 | 43 | </Setter.Value> |
30 | 44 | </Setter> |
31 | 45 | </Style> |
32 | 46 |
|
33 | | - <!-- 登录/注册按钮 --> |
| 47 | + <!-- 登录/注册按钮 --> |
34 | 48 | <Style x:Key="LoginButtonStyle" TargetType="Button"> |
35 | | - <Setter Property="Foreground" Value="White"/> |
36 | | - |
| 49 | + <Setter Property="Foreground" Value="White" /> |
| 50 | + |
37 | 51 | <Setter Property="Template"> |
38 | 52 | <Setter.Value> |
39 | 53 | <ControlTemplate TargetType="Button"> |
40 | 54 | <Border x:Name="Border" Background="#4370F5"> |
41 | | - <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/> |
| 55 | + <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" /> |
42 | 56 | </Border> |
43 | | - <!-- 触发器 --> |
| 57 | + <!-- 触发器 --> |
44 | 58 | <ControlTemplate.Triggers> |
45 | | - <!-- 鼠标悬停时 --> |
| 59 | + <!-- 鼠标悬停时 --> |
46 | 60 | <Trigger Property="IsMouseOver" Value="True"> |
47 | | - <Setter TargetName="Border" Property="Background" Value="#5B84FE"/> |
| 61 | + <Setter TargetName="Border" Property="Background" Value="#5B84FE" /> |
48 | 62 | </Trigger> |
49 | | - <!-- 鼠标按下时 --> |
| 63 | + <!-- 鼠标按下时 --> |
50 | 64 | <Trigger Property="IsPressed" Value="True"> |
51 | | - <Setter TargetName="Border" Property="Background" Value="#3761DF"/> |
| 65 | + <Setter TargetName="Border" Property="Background" Value="#3761DF" /> |
52 | 66 | </Trigger> |
53 | | - <!-- 禁用时 --> |
| 67 | + <!-- 禁用时 --> |
54 | 68 | <Trigger Property="IsEnabled" Value="False"> |
55 | | - <Setter Property="Opacity" Value="0.3"/> |
| 69 | + <Setter Property="Opacity" Value="0.3" /> |
56 | 70 | </Trigger> |
57 | 71 | </ControlTemplate.Triggers> |
58 | 72 | </ControlTemplate> |
59 | 73 | </Setter.Value> |
60 | 74 | </Setter> |
61 | 75 | </Style> |
62 | | - <!-- 文本框样式 --> |
| 76 | + <!-- 文本框样式 --> |
63 | 77 | <Style x:Key="TextBoxStyle" TargetType="TextBox"> |
64 | | - <!-- 文本色 --> |
65 | | - <Setter Property="Foreground" Value="Black"/> |
66 | | - <!-- 文本垂直居中 --> |
67 | | - <Setter Property="VerticalContentAlignment" Value="Center"/> |
68 | | - <!-- 模板 --> |
| 78 | + <!-- 文本色 --> |
| 79 | + <Setter Property="Foreground" Value="Black" /> |
| 80 | + <!-- 文本垂直居中 --> |
| 81 | + <Setter Property="VerticalContentAlignment" Value="Center" /> |
| 82 | + <!-- 模板 --> |
69 | 83 | <Setter Property="Template"> |
70 | 84 | <Setter.Value> |
71 | 85 | <ControlTemplate TargetType="TextBox"> |
72 | | - <!-- 外观 --> |
73 | | - <Border x:Name="border" BorderBrush="#D9D9D9" BorderThickness="1" Background="Transparent"> |
74 | | - <ScrollViewer x:Name="PART_ContentHost" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/> |
| 86 | + <!-- 外观 --> |
| 87 | + <Border |
| 88 | + x:Name="border" |
| 89 | + Background="Transparent" |
| 90 | + BorderBrush="#D9D9D9" |
| 91 | + BorderThickness="1"> |
| 92 | + <ScrollViewer |
| 93 | + x:Name="PART_ContentHost" |
| 94 | + HorizontalScrollBarVisibility="Hidden" |
| 95 | + VerticalScrollBarVisibility="Hidden" /> |
75 | 96 | </Border> |
76 | | - <!-- 触发器 --> |
| 97 | + <!-- 触发器 --> |
77 | 98 | <ControlTemplate.Triggers> |
78 | | - <!-- 禁用 --> |
| 99 | + <!-- 禁用 --> |
79 | 100 | <Trigger Property="IsEnabled" Value="false"> |
80 | | - <Setter Property="Opacity" TargetName="border" Value="0.4"/> |
| 101 | + <Setter TargetName="border" Property="Opacity" Value="0.4" /> |
81 | 102 | </Trigger> |
82 | | - <!-- 鼠标悬停 --> |
| 103 | + <!-- 鼠标悬停 --> |
83 | 104 | <Trigger Property="IsMouseOver" Value="true"> |
84 | | - <Setter Property="BorderBrush" TargetName="border" Value="#B4B4B4"/> |
| 105 | + <Setter TargetName="border" Property="BorderBrush" Value="#B4B4B4" /> |
85 | 106 | </Trigger> |
86 | | - <!-- 获取焦点 --> |
| 107 | + <!-- 获取焦点 --> |
87 | 108 | <Trigger Property="IsKeyboardFocused" Value="true"> |
88 | | - <Setter Property="BorderBrush" TargetName="border" Value="#4370F5"/> |
| 109 | + <Setter TargetName="border" Property="BorderBrush" Value="#4370F5" /> |
89 | 110 | </Trigger> |
90 | 111 | </ControlTemplate.Triggers> |
91 | 112 | </ControlTemplate> |
92 | 113 | </Setter.Value> |
93 | 114 | </Setter> |
94 | 115 | </Style> |
95 | | - <!-- 密码框样式 --> |
| 116 | + <!-- 密码框样式 --> |
96 | 117 | <Style x:Key="PasswordBoxStyle" TargetType="PasswordBox"> |
97 | | - <!-- 文本色 --> |
98 | | - <Setter Property="Foreground" Value="Black"/> |
99 | | - <!-- 文本垂直居中 --> |
100 | | - <Setter Property="VerticalContentAlignment" Value="Center"/> |
101 | | - <Setter Property="PasswordChar" Value="●"/> |
102 | | - <!-- 模板 --> |
| 118 | + <!-- 文本色 --> |
| 119 | + <Setter Property="Foreground" Value="Black" /> |
| 120 | + <!-- 文本垂直居中 --> |
| 121 | + <Setter Property="VerticalContentAlignment" Value="Center" /> |
| 122 | + <Setter Property="PasswordChar" Value="●" /> |
| 123 | + <!-- 模板 --> |
103 | 124 | <Setter Property="Template"> |
104 | 125 | <Setter.Value> |
105 | 126 | <ControlTemplate TargetType="PasswordBox"> |
106 | | - <!-- 外观 --> |
107 | | - <Border x:Name="border" BorderBrush="#D9D9D9" BorderThickness="1" Background="Transparent"> |
108 | | - <ScrollViewer x:Name="PART_ContentHost" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/> |
| 127 | + <!-- 外观 --> |
| 128 | + <Border |
| 129 | + x:Name="border" |
| 130 | + Background="Transparent" |
| 131 | + BorderBrush="#D9D9D9" |
| 132 | + BorderThickness="1"> |
| 133 | + <ScrollViewer |
| 134 | + x:Name="PART_ContentHost" |
| 135 | + HorizontalScrollBarVisibility="Hidden" |
| 136 | + VerticalScrollBarVisibility="Hidden" /> |
109 | 137 | </Border> |
110 | | - <!-- 触发器 --> |
| 138 | + <!-- 触发器 --> |
111 | 139 | <ControlTemplate.Triggers> |
112 | | - <!-- 禁用 --> |
| 140 | + <!-- 禁用 --> |
113 | 141 | <Trigger Property="IsEnabled" Value="false"> |
114 | | - <Setter Property="Opacity" TargetName="border" Value="0.4"/> |
| 142 | + <Setter TargetName="border" Property="Opacity" Value="0.4" /> |
115 | 143 | </Trigger> |
116 | | - <!-- 鼠标悬停 --> |
| 144 | + <!-- 鼠标悬停 --> |
117 | 145 | <Trigger Property="IsMouseOver" Value="true"> |
118 | | - <Setter Property="BorderBrush" TargetName="border" Value="#B4B4B4"/> |
| 146 | + <Setter TargetName="border" Property="BorderBrush" Value="#B4B4B4" /> |
119 | 147 | </Trigger> |
120 | | - <!-- 获取焦点 --> |
| 148 | + <!-- 获取焦点 --> |
121 | 149 | <Trigger Property="IsKeyboardFocused" Value="true"> |
122 | | - <Setter Property="BorderBrush" TargetName="border" Value="#4370F5"/> |
| 150 | + <Setter TargetName="border" Property="BorderBrush" Value="#4370F5" /> |
123 | 151 | </Trigger> |
124 | 152 | </ControlTemplate.Triggers> |
125 | 153 | </ControlTemplate> |
126 | 154 | </Setter.Value> |
127 | 155 | </Setter> |
128 | 156 | </Style> |
129 | | - <!-- 窗口样式 --> |
| 157 | + <!-- 窗口样式 --> |
130 | 158 | <Style x:Key="NormalWindow" TargetType="Window"> |
131 | | - <Setter Property="Background" Value="#80222324"/> |
132 | | - <Setter Property="FontFamily" Value="NSimSun"/> |
133 | | - <Setter Property="FontSize" Value="12"/> |
134 | | - <Setter Property="TextOptions.TextFormattingMode" Value="Display"/> |
135 | | - <Setter Property="SnapsToDevicePixels" Value="True"/> |
136 | | - <!-- 模板 --> |
| 159 | + <Setter Property="Background" Value="#80222324" /> |
| 160 | + <Setter Property="FontFamily" Value="NSimSun" /> |
| 161 | + <Setter Property="FontSize" Value="12" /> |
| 162 | + <Setter Property="TextOptions.TextFormattingMode" Value="Display" /> |
| 163 | + <Setter Property="SnapsToDevicePixels" Value="True" /> |
| 164 | + <!-- 模板 --> |
137 | 165 | <Setter Property="Template"> |
138 | 166 | <Setter.Value> |
139 | 167 | <ControlTemplate TargetType="Window"> |
140 | | - <!-- 外观 --> |
| 168 | + <!-- 外观 --> |
141 | 169 | <Grid> |
142 | | - <!-- 分区 --> |
| 170 | + <!-- 分区 --> |
143 | 171 | <Grid.RowDefinitions> |
144 | | - <!-- 标题栏 --> |
145 | | - <RowDefinition Height="100"/> |
146 | | - <!-- 客户区 --> |
| 172 | + <!-- 标题栏 --> |
| 173 | + <RowDefinition Height="100" /> |
| 174 | + <!-- 客户区 --> |
147 | 175 | <RowDefinition /> |
148 | 176 | </Grid.RowDefinitions> |
149 | | - <!-- 第一块:标题栏 --> |
| 177 | + <!-- 第一块:标题栏 --> |
150 | 178 | <Grid> |
151 | | - <!-- 背景色 --> |
152 | | - <Grid Height="200" VerticalAlignment="Center" Opacity="0.9"> |
| 179 | + <!-- 背景色 --> |
| 180 | + <Grid |
| 181 | + Height="200" |
| 182 | + VerticalAlignment="Center" |
| 183 | + Opacity="0.9"> |
153 | 184 | <Grid.Background> |
154 | 185 | <LinearGradientBrush StartPoint="0,0" EndPoint="1,1"> |
155 | | - <GradientStop Offset="0" Color="#4370F5"/> |
156 | | - <GradientStop Offset="1" Color="#AE088D"/> |
| 186 | + <GradientStop Offset="0" Color="#4370F5" /> |
| 187 | + <GradientStop Offset="1" Color="#AE088D" /> |
157 | 188 | </LinearGradientBrush> |
158 | 189 | </Grid.Background> |
159 | 190 | </Grid> |
160 | | - <!-- 背景图 --> |
161 | | - <Image Source="pack://application:,,,/WPFDevelopers.Samples;component/Resources/Assets/Background.png" Width="360" VerticalAlignment="Bottom"/> |
162 | | - <!-- 标识 --> |
163 | | - <Image Source="pack://application:,,,/WPFDevelopers.Samples;component/Resources/Assets/Logo.png" Width="114" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="20,20,0,0"/> |
164 | | - <!-- 关闭按钮 --> |
165 | | - <Button x:Name="CloseButton" Width="30" Height="30" HorizontalAlignment="Right" VerticalAlignment="Top" |
166 | | - Style="{StaticResource CloseButtonStyle}"/> |
| 191 | + <!-- 背景图 --> |
| 192 | + <Image |
| 193 | + Width="360" |
| 194 | + VerticalAlignment="Bottom" |
| 195 | + Source="pack://application:,,,/WPFDevelopers.Samples;component/Resources/Assets/Background.png" /> |
| 196 | + <!-- 标识 --> |
| 197 | + <Image |
| 198 | + Width="114" |
| 199 | + Margin="20,20,0,0" |
| 200 | + HorizontalAlignment="Left" |
| 201 | + VerticalAlignment="Top" |
| 202 | + Source="pack://application:,,,/WPFDevelopers.Samples;component/Resources/Assets/Logo.png" /> |
| 203 | + <!-- 关闭按钮 --> |
| 204 | + <Button |
| 205 | + x:Name="CloseButton" |
| 206 | + Width="30" |
| 207 | + Height="30" |
| 208 | + HorizontalAlignment="Right" |
| 209 | + VerticalAlignment="Top" |
| 210 | + Style="{StaticResource CloseButtonStyle}" /> |
167 | 211 | </Grid> |
168 | | - <!-- 第二块:客户区 --> |
| 212 | + <!-- 第二块:客户区 --> |
169 | 213 | <Grid Grid.Row="1" Background="White"> |
170 | 214 | <AdornerDecorator> |
171 | | - <ContentPresenter/> |
| 215 | + <ContentPresenter /> |
172 | 216 | </AdornerDecorator> |
173 | 217 | </Grid> |
174 | 218 | </Grid> |
|
0 commit comments