-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
128 lines (119 loc) · 5.77 KB
/
MainWindow.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
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
<Window x:Class="DanmakuClient.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Title="弹幕客户端"
Icon="Resources/Icon.ico"
SizeToContent="WidthAndHeight"
MinWidth="300"
Background="White"
WindowStartupLocation="CenterScreen">
<Window.Resources>
<Style TargetType="TextBox">
<Setter Property="Padding" Value="8,6" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="BorderBrush" Value="#E0E0E0" />
<Setter Property="Background" Value="#FFFFFF" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TextBox">
<Border BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
CornerRadius="4">
<ScrollViewer x:Name="PART_ContentHost" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="Button">
<Setter Property="Background" Value="#2196F3" />
<Setter Property="Foreground" Value="White" />
<Setter Property="Padding" Value="12,6" />
<Setter Property="FontSize" Value="14" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
CornerRadius="4"
Padding="{TemplateBinding Padding}"
x:Name="border">
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="Background" Value="#1976D2" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<StackPanel Margin="20">
<TextBlock Text="请输入要加载的 URL"
FontSize="18"
FontWeight="Medium"
Margin="0,0,0,15" />
<TextBox Name="UrlTextBox"
Margin="0,0,0,20"
Text="https://dm.wybxc.cc/1234" />
<GroupBox Header="WebView 边距设置"
Margin="0,0,0,20"
BorderBrush="#E0E0E0">
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="60" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="60" />
</Grid.ColumnDefinitions>
<TextBlock Text="上边距:" VerticalAlignment="Center" Margin="0,0,5,5" />
<DockPanel Grid.Row="0" Grid.Column="1" Margin="0,0,10,5">
<TextBlock Text="%"
DockPanel.Dock="Right"
VerticalAlignment="Center"
Margin="2,0,0,0" />
<TextBox Name="TopPaddingBox" Text="0" />
</DockPanel>
<TextBlock Text="下边距:" Grid.Row="0" Grid.Column="2" VerticalAlignment="Center" Margin="0,0,5,5" />
<DockPanel Grid.Row="0" Grid.Column="3" Margin="0,0,0,5">
<TextBlock Text="%"
DockPanel.Dock="Right"
VerticalAlignment="Center"
Margin="2,0,0,0" />
<TextBox Name="BottomPaddingBox" Text="0" />
</DockPanel>
<TextBlock Text="左边距:" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" Margin="0,0,5,0" />
<DockPanel Grid.Row="1" Grid.Column="1" Margin="0,0,10,0">
<TextBlock Text="%"
DockPanel.Dock="Right"
VerticalAlignment="Center"
Margin="2,0,0,0" />
<TextBox Name="LeftPaddingBox" Text="0" />
</DockPanel>
<TextBlock Text="右边距:" Grid.Row="1" Grid.Column="2" VerticalAlignment="Center" Margin="0,0,5,0" />
<DockPanel Grid.Row="1" Grid.Column="3">
<TextBlock Text="%"
DockPanel.Dock="Right"
VerticalAlignment="Center"
Margin="2,0,0,0" />
<TextBox Name="RightPaddingBox" Text="0" />
</DockPanel>
</Grid>
</GroupBox>
<Button x:Name="ConfirmButton"
Content="确认"
IsDefault="True"
Click="OnConfirmClick" />
</StackPanel>
</Window>