-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.xaml
60 lines (60 loc) · 3.32 KB
/
App.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
<Application
x:Class="VisualChatBot.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:VisualChatBot"
StartupUri="Views/VisualChat.xaml">
<Application.Resources>
<ResourceDictionary>
<!-- 默认颜色 -->
<SolidColorBrush x:Key="BackgroundColor" Color="White" />
<SolidColorBrush x:Key="ForegroundColor" Color="Black" />
<SolidColorBrush x:Key="TextBoxBackgroundColor" Color="#F5F5F5" />
<SolidColorBrush x:Key="TextBoxForegroundColor" Color="Black" />
<SolidColorBrush x:Key="LabelForegroundColor" Color="#36454f" />
<SolidColorBrush x:Key="ButtonBackgroundColor" Color="LightGray" />
<!-- 黑暗模式颜色 -->
<SolidColorBrush x:Key="DarkBackgroundColor" Color="#1F1F1F" />
<SolidColorBrush x:Key="DarkForegroundColor" Color="White" />
<SolidColorBrush x:Key="DarkTextBoxBackgroundColor" Color="#454545" />
<SolidColorBrush x:Key="DarkTextBoxForegroundColor" Color="White" />
<SolidColorBrush x:Key="DarkLabelForegroundColor" Color="#f2f3f4" />
<SolidColorBrush x:Key="DarkButtonBackgroundColor" Color="LightGray" />
<!-- 无边框Textbox样式 -->
<Style x:Key="NoBorderTextBox" TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="Black" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Margin" Value="5,10,5,10" />
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<Border
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="BorderBrush" Value="Transparent" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 无光标框Button -->
<Style x:Key="NoFocusButton" TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<TextBlock Cursor="Hand" Text="{Binding Content, RelativeSource={RelativeSource AncestorType=Button, Mode=FindAncestor}}" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</Application.Resources>
</Application>