forked from PhoenixNil/XrayUI-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
201 lines (179 loc) · 8.78 KB
/
MainWindow.xaml
File metadata and controls
201 lines (179 loc) · 8.78 KB
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<?xml version="1.0" encoding="utf-8"?>
<Window x:Class="XrayUI.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:views="using:XrayUI.Views"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Title="代理控制台">
<Grid Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<!-- Custom title bar — registered via SetTitleBar() in code-behind -->
<Grid x:Name="AppTitleBar"
Grid.Row="0"
Height="40">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Button Grid.Column="0"
Click="DockButton_Click"
Background="Transparent"
BorderThickness="0"
CornerRadius="4"
Width="30" Height="28"
Padding="0"
Margin="8,0,0,0"
VerticalAlignment="Center"
ToolTipService.ToolTip="切换mini窗口">
<FontIcon Glyph="" FontSize="13" />
</Button>
<Button Grid.Column="1"
Click="AppTitleBar_BackRequested"
Visibility="{x:Bind ViewModel.BackButtonVisibility, Mode=OneWay}"
Background="Transparent"
BorderThickness="0"
CornerRadius="4"
Margin="6,0,0,0"
Width="30" Height="28"
Padding="0"
VerticalAlignment="Center">
<FontIcon Glyph="" FontSize="12" />
</Button>
<TextBlock Grid.Column="2"
Text="代理控制台"
FontSize="13"
VerticalAlignment="Center"
Margin="8,0,0,0" />
</Grid>
<!-- Mini mode compact panel -->
<Grid Grid.Row="1"
Visibility="{x:Bind ViewModel.MiniModeVisibility, Mode=OneWay}"
Margin="16,0,16,0">
<!-- Mini content: tighten vertical rhythm to match the mockup -->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<!-- Server name + routing mode -->
<StackPanel Grid.Row="0"
Margin="2,18,20,0"
VerticalAlignment="Top"
Spacing="6">
<TextBlock Text="{x:Bind ViewModel.ActiveServerName, Mode=OneWay}"
FontSize="16"
FontWeight="SemiBold" />
<TextBlock Text="{x:Bind ViewModel.ControlPanel.RoutingMode, Mode=OneWay}"
FontSize="12"
Foreground="{ThemeResource TextFillColorSecondaryBrush}" />
</StackPanel>
<!-- Power button (left) + status indicator (right) -->
<Grid Grid.Row="2"
Margin="0,0,0,12">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ToggleButton Grid.Column="0"
Command="{x:Bind ViewModel.ControlPanel.StartStopCommand, Mode=OneWay}"
IsChecked="{x:Bind ViewModel.ControlPanel.IsRunning, Mode=OneWay}"
Width="40" Height="40"
CornerRadius="20"
Padding="0"
BorderThickness="0"
VerticalAlignment="Bottom">
<FontIcon Glyph="" FontSize="16" />
</ToggleButton>
<StackPanel Grid.Column="2"
Orientation="Horizontal"
Spacing="5"
VerticalAlignment="Center">
<Ellipse Width="6"
Height="6"
Fill="{StaticResource StateSuccessBrush}"
VerticalAlignment="Center"
Visibility="{x:Bind ViewModel.MiniDotVisibility, Mode=OneWay}" />
<TextBlock Text="{x:Bind ViewModel.MiniStatusText, Mode=OneWay}"
FontSize="13"
FontWeight="Medium"
VerticalAlignment="Center"
Foreground="{ThemeResource TextFillColorSecondaryBrush}" />
</StackPanel>
</Grid>
</Grid>
<Border x:Name="MiniDragRegion"
Height="32"
Margin="0,0,56,0"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
Background="Transparent" />
<Grid HorizontalAlignment="Right"
VerticalAlignment="Top"
Margin="0,4,-10,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Button x:Name="MiniExpandButton"
Grid.Column="0"
Width="28" Height="22"
Padding="0"
BorderThickness="0"
Background="Transparent"
ToolTipService.ToolTip="返回完整窗口">
<FontIcon Glyph="" FontSize="12" />
</Button>
<Button x:Name="MinicloseButton"
Grid.Column="1"
Width="28" Height="22"
Padding="0"
BorderThickness="0"
Background="Transparent"
ToolTipService.ToolTip="关闭">
<FontIcon Glyph="" FontSize="12" />
</Button>
</Grid>
</Grid>
<Grid Grid.Row="1"
Visibility="{x:Bind ViewModel.FullModeVisibility, Mode=OneWay}"
Margin="16,0,16,16"
ColumnSpacing="16">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.2*" MinWidth="380" MaxWidth="600" />
<ColumnDefinition Width="1.5*" MinWidth="400" />
</Grid.ColumnDefinitions>
<views:ServerListControl Grid.Column="0"
x:Name="ServerList"
ViewModel="{x:Bind ViewModel.ServerList, Mode=OneWay}"
SwitchToSelectedServerCommand="{x:Bind ViewModel.SwitchToSelectedServerCommand, Mode=OneWay}" />
<Grid Grid.Column="1"
VerticalAlignment="Stretch">
<!-- Main view: server detail + control panel -->
<Grid Visibility="{x:Bind ViewModel.MainContentVisibility, Mode=OneWay}">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<views:ServerDetailControl Grid.Row="0"
x:Name="ServerDetail"
ViewModel="{x:Bind ViewModel.ServerDetail, Mode=OneWay}" />
<views:ControlPanelControl x:Name="ControlPanel"
Grid.Row="1"
ViewModel="{x:Bind ViewModel.ControlPanel, Mode=OneWay}" />
</Grid>
<!-- Personalize view -->
<views:PersonalizeControl Visibility="{x:Bind ViewModel.PersonalizeVisibility, Mode=OneWay}"
ViewModel="{x:Bind ViewModel.Personalize, Mode=OneWay}" />
</Grid>
</Grid>
</Grid>
</Window>