XFEstudio/MyFirstRespo
添加更多设置页面的控件,增加HintTextBox控件,转义部分Style
256f1df
代码差异
30 个文件
+926
-141
@@ -4,6 +4,12 @@
4
4
xmlns:local="clr-namespace:XFEToolBox"
5
5
StartupUri="/Views/Windows/MainWindow.xaml">
6
6
<Application.Resources>
7
<ResourceDictionary Source="/Resources/Style/MainStyle.xaml"/>
7
<ResourceDictionary>
8
<ResourceDictionary.MergedDictionaries>
9
<ResourceDictionary Source="/Resources/Style/MainStyle.xaml"/>
10
<ResourceDictionary Source="/Resources/Style/MyControlsStyle.xaml"/>
11
<ResourceDictionary Source="/Resources/Style/Theme/LightTheme.xaml"/>
12
</ResourceDictionary.MergedDictionaries>
13
</ResourceDictionary>
8
14
</Application.Resources>
9
15
</Application>
@@ -1,4 +1,5 @@
1
1
using System.Windows;
2
using XFEExtension.NetCore.XFEConsole;
2
3
3
4
namespace XFEToolBox;
4
5
@@ -10,6 +11,7 @@ public partial class App : Application
10
11
public App()
11
12
{
12
13
this.InitializeComponent();
14
//XFEConsole.UseXFEConsole().Wait();
13
15
}
14
16
protected override void OnStartup(StartupEventArgs e)
15
17
{
@@ -0,0 +1,10 @@
1
namespace XFEToolBox.Model;
2
3
public class MultiParameter
4
{
5
public object? Parameter1 { get; set; }
6
public object? Parameter2 { get; set; }
7
public object? Parameter3 { get; set; }
8
public object? Parameter4 { get; set; }
9
public object? Parameter5 { get; set; }
10
}
@@ -19,7 +19,7 @@ public partial class ConsoleProfile
19
19
/// 是否只在本机回路中开放
20
20
/// </summary>
21
21
[ProfileProperty]
22
private bool localOnly = true;
22
private bool localHostOnly = true;
23
23
/// <summary>
24
24
/// 最大行数
25
25
/// </summary>
@@ -1,5 +1,6 @@
1
1
using XFEExtension.NetCore.AutoConfig;
2
2
using XFEToolBox.Core.Model;
3
using XFEToolBox.Views.Windows;
3
4
4
5
namespace XFEToolBox.Profiles.CrossVersionProfiles;
5
6
@@ -20,6 +21,16 @@ public partial class SystemProfile
20
21
/// </summary>
21
22
[ProfileProperty]
22
23
private double mainWindowHeight = 450;
24
/// <summary>
25
/// 是否开机自启动
26
/// </summary>
27
[ProfileProperty]
28
private bool autoSelfLaunch = false;
29
/// <summary>
30
/// 是否是以最大化启动
31
/// </summary>
32
[ProfileProperty]
33
private bool startWithMaximize = false;
23
34
public SystemProfile() => ProfilePath = @$"{AppPath.LocalProfile}\{typeof(SystemProfile)}.xprofile";
24
35
/// <summary>
25
36
/// 工具箱现在是否可以被关闭
@@ -1,7 +1,7 @@
1
1
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2
2
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
3
3
<Style x:Key="TabBorderStyle" TargetType="Border">
4
<Setter Property="Background" Value="#9898e7"/>
4
<Setter Property="Background" Value="{DynamicResource MainColor}"/>
5
5
<Setter Property="HorizontalAlignment" Value="Stretch"/>
6
6
<Setter Property="VerticalAlignment" Value="Stretch"/>
7
7
<Style.Triggers>
@@ -37,6 +37,7 @@
37
37
</Style>
38
38
<Style x:Key="CornerBorderStyle" TargetType="Border">
39
39
<Setter Property="Background" Value="White"/>
40
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
40
41
<Setter Property="Opacity" Value="0"/>
41
42
<Setter Property="Width" Value="25"/>
42
43
<Setter Property="Height" Value="25"/>
@@ -139,118 +140,12 @@
139
140
</Style.Triggers>
140
141
</Style>
141
142
<Style x:Key="NavigationButtonText" TargetType="TextBlock">
142
<Setter Property="Foreground" Value="#8998e7"/>
143
<Setter Property="Foreground" Value="{DynamicResource MainColor}"/>
143
144
<Setter Property="FontSize" Value="15"/>
144
145
<Setter Property="Margin" Value="10,0,0,0"/>
145
146
<Setter Property="HorizontalAlignment" Value="Left"/>
146
147
<Setter Property="VerticalAlignment" Value="Center"/>
147
148
</Style>
148
<Style x:Key="NavigationButton" TargetType="RadioButton">
149
<Setter Property="IsTabStop" Value="False"/>
150
<Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
151
<Setter Property="Margin" Value="10,5"/>
152
<Setter Property="Template">
153
<Setter.Value>
154
<ControlTemplate TargetType="RadioButton">
155
<Border x:Name="outBorder" Height="40" Background="White">
156
<Border x:Name="mainBorder" CornerRadius="15" Height="40" HorizontalAlignment="Stretch" Background="White" BorderBrush="#9898e7" BorderThickness="1.5" RenderTransformOrigin="0.5,0.5">
157
<Border.RenderTransform>
158
<ScaleTransform x:Name="mainBorderScale" ScaleX="1" ScaleY="1"/>
159
</Border.RenderTransform>
160
<Border.Effect>
161
<DropShadowEffect x:Name="mainBorderShadow" Color="#9898e7" BlurRadius="8" ShadowDepth="3" Direction="-45" Opacity="0"/>
162
</Border.Effect>
163
<Grid>
164
<Grid.ColumnDefinitions>
165
<ColumnDefinition Width="40"/>
166
<ColumnDefinition Width="10"/>
167
<ColumnDefinition Width="*"/>
168
</Grid.ColumnDefinitions>
169
<Border x:Name="borderSplit" Grid.Column="1" Background="#9898e7" CornerRadius="2" Width="3" Opacity="0.5" HorizontalAlignment="Left" VerticalAlignment="Stretch" Margin="0,5"/>
170
<ContentPresenter Grid.ColumnSpan="3"/>
171
</Grid>
172
</Border>
173
</Border>
174
<ControlTemplate.Triggers>
175
<EventTrigger RoutedEvent="MouseEnter">
176
<BeginStoryboard>
177
<Storyboard>
178
<DoubleAnimation Storyboard.TargetName="mainBorderScale" Storyboard.TargetProperty="ScaleX" From="1" To="1.1" Duration="0:0:0.3">
179
<DoubleAnimation.EasingFunction>
180
<CubicEase EasingMode="EaseOut"/>
181
</DoubleAnimation.EasingFunction>
182
</DoubleAnimation>
183
<DoubleAnimation Storyboard.TargetName="mainBorderScale" Storyboard.TargetProperty="ScaleY" From="1" To="1.1" Duration="0:0:0.3">
184
<DoubleAnimation.EasingFunction>
185
<CubicEase EasingMode="EaseOut"/>
186
</DoubleAnimation.EasingFunction>
187
</DoubleAnimation>
188
<DoubleAnimation Storyboard.TargetName="outBorder" Storyboard.TargetProperty="Height" From="40" To="60" Duration="0:0:0.3">
189
<DoubleAnimation.EasingFunction>
190
<CubicEase EasingMode="EaseOut"/>
191
</DoubleAnimation.EasingFunction>
192
</DoubleAnimation>
193
</Storyboard>
194
</BeginStoryboard>
195
</EventTrigger>
196
<EventTrigger RoutedEvent="MouseLeave">
197
<BeginStoryboard>
198
<Storyboard>
199
<DoubleAnimation Storyboard.TargetName="mainBorderScale" Storyboard.TargetProperty="ScaleX" From="1.1" To="1" Duration="0:0:0.3">
200
<DoubleAnimation.EasingFunction>
201
<CubicEase EasingMode="EaseOut"/>
202
</DoubleAnimation.EasingFunction>
203
</DoubleAnimation>
204
<DoubleAnimation Storyboard.TargetName="mainBorderScale" Storyboard.TargetProperty="ScaleY" From="1.1" To="1" Duration="0:0:0.3">
205
<DoubleAnimation.EasingFunction>
206
<CubicEase EasingMode="EaseOut"/>
207
</DoubleAnimation.EasingFunction>
208
</DoubleAnimation>
209
<DoubleAnimation Storyboard.TargetName="outBorder" Storyboard.TargetProperty="Height" From="60" To="40" Duration="0:0:0.3">
210
<DoubleAnimation.EasingFunction>
211
<CubicEase EasingMode="EaseOut"/>
212
</DoubleAnimation.EasingFunction>
213
</DoubleAnimation>
214
</Storyboard>
215
</BeginStoryboard>
216
</EventTrigger>
217
<EventTrigger RoutedEvent="Checked">
218
<BeginStoryboard>
219
<Storyboard>
220
<DoubleAnimation Storyboard.TargetName="mainBorderShadow" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:0.3">
221
<DoubleAnimation.EasingFunction>
222
<CubicEase EasingMode="EaseOut"/>
223
</DoubleAnimation.EasingFunction>
224
</DoubleAnimation>
225
<DoubleAnimation Storyboard.TargetName="borderSplit" Storyboard.TargetProperty="Opacity" From="0.5" To="1" Duration="0:0:0.3">
226
<DoubleAnimation.EasingFunction>
227
<CubicEase EasingMode="EaseOut"/>
228
</DoubleAnimation.EasingFunction>
229
</DoubleAnimation>
230
</Storyboard>
231
</BeginStoryboard>
232
</EventTrigger>
233
<EventTrigger RoutedEvent="Unchecked">
234
<BeginStoryboard>
235
<Storyboard>
236
<DoubleAnimation Storyboard.TargetName="mainBorderShadow" Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="0:0:0.3">
237
<DoubleAnimation.EasingFunction>
238
<CubicEase EasingMode="EaseOut"/>
239
</DoubleAnimation.EasingFunction>
240
</DoubleAnimation>
241
<DoubleAnimation Storyboard.TargetName="borderSplit" Storyboard.TargetProperty="Opacity" From="1" To="0.5" Duration="0:0:0.3">
242
<DoubleAnimation.EasingFunction>
243
<CubicEase EasingMode="EaseOut"/>
244
</DoubleAnimation.EasingFunction>
245
</DoubleAnimation>
246
</Storyboard>
247
</BeginStoryboard>
248
</EventTrigger>
249
</ControlTemplate.Triggers>
250
</ControlTemplate>
251
</Setter.Value>
252
</Setter>
253
</Style>
254
149
<Style x:Key="NavigationFrame" TargetType="Frame">
255
150
<Setter Property="NavigationUIVisibility" Value="Hidden"/>
256
151
<Setter Property="IsTabStop" Value="False"/>
@@ -259,6 +154,7 @@
259
154
</Style>
260
155
<Style x:Key="ConsoleScrollBar" TargetType="ScrollBar">
261
156
<Setter Property="IsTabStop" Value="False"/>
157
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
262
158
<Setter Property="Template">
263
159
<Setter.Value>
264
160
<ControlTemplate TargetType="ScrollBar">
@@ -273,19 +169,19 @@
273
169
<RowDefinition Height="*"/>
274
170
<RowDefinition Height="Auto"/>
275
171
</Grid.RowDefinitions>
276
<TextBlock Text="▲" Foreground="#9898e7" VerticalAlignment="Center" HorizontalAlignment="Center"/>
277
<Border Grid.Row="1" Background="#9898e7" CornerRadius="5"/>
278
<TextBlock Grid.Row="2" Text="▼" Foreground="#9898e7" VerticalAlignment="Center" HorizontalAlignment="Center"/>
172
<TextBlock Text="▲" Foreground="{DynamicResource MainColor}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
173
<Border Grid.Row="1" Background="{DynamicResource MainColor}" CornerRadius="5"/>
174
<TextBlock Grid.Row="2" Text="▼" Foreground="{DynamicResource MainColor}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
279
175
</Grid>
280
176
</ControlTemplate>
281
177
</Thumb.Template>
282
178
</Thumb>
283
179
</Track.Thumb>
284
180
<Track.DecreaseRepeatButton>
285
<RepeatButton Width="1" Background="#9898e7" BorderThickness="0"/>
181
<RepeatButton Width="1" Background="{DynamicResource MainColor}" BorderThickness="0"/>
286
182
</Track.DecreaseRepeatButton>
287
183
<Track.IncreaseRepeatButton>
288
<RepeatButton Width="1" Background="#9898e7" BorderThickness="0"/>
184
<RepeatButton Width="1" Background="{DynamicResource MainColor}" BorderThickness="0"/>
289
185
</Track.IncreaseRepeatButton>
290
186
</Track>
291
187
</ControlTemplate>
@@ -339,6 +235,7 @@
339
235
<Style x:Key="FoldButton" TargetType="Button">
340
236
<Style.Setters>
341
237
<Setter Property="Opacity" Value="1"/>
238
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
342
239
<Setter Property="IsTabStop" Value="False"/>
343
240
<Setter Property="Template">
344
241
<Setter.Value>
@@ -370,4 +267,8 @@
370
267
</Trigger>
371
268
</Style.Triggers>
372
269
</Style>
270
<Style x:Key="TabUnderLineText" TargetType="TextBlock">
271
<Setter Property="FontWeight" Value="Bold"/>
272
<Setter Property="FontSize" Value="15"/>
273
</Style>
373
274
</ResourceDictionary>
@@ -0,0 +1,346 @@
1
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3
xmlns:ctr="clr-namespace:XFEToolBox.Views.Controls">
4
<Style TargetType="{x:Type ctr:RoundButton}">
5
<Setter Property="Template">
6
<Setter.Value>
7
<ControlTemplate TargetType="{x:Type ctr:RoundButton}">
8
<Grid>
9
<ContentControl/>
10
<Border x:Name="backBorder" CornerRadius="{TemplateBinding RoundCornerRadius}" Background="{TemplateBinding RoundButtonBackground}" Opacity="0"/>
11
<Border CornerRadius="{TemplateBinding RoundCornerRadius}" BorderBrush="{TemplateBinding RoundButtonBorderBrush}" BorderThickness="{TemplateBinding RoundButtonBorderThickness}">
12
<ContentPresenter Content="{TemplateBinding Content}"/>
13
</Border>
14
</Grid>
15
<ControlTemplate.Triggers>
16
<EventTrigger RoutedEvent="MouseEnter">
17
<BeginStoryboard>
18
<Storyboard>
19
<DoubleAnimation Storyboard.TargetName="backBorder" Storyboard.TargetProperty="Opacity" To="0.1" Duration="0:0:0.3">
20
<DoubleAnimation.EasingFunction>
21
<CubicEase EasingMode="EaseOut"/>
22
</DoubleAnimation.EasingFunction>
23
</DoubleAnimation>
24
</Storyboard>
25
</BeginStoryboard>
26
</EventTrigger>
27
<EventTrigger RoutedEvent="MouseLeave">
28
<BeginStoryboard>
29
<Storyboard>
30
<DoubleAnimation Storyboard.TargetName="backBorder" Storyboard.TargetProperty="Opacity" To="0" Duration="0:0:0.3">
31
<DoubleAnimation.EasingFunction>
32
<CubicEase EasingMode="EaseOut"/>
33
</DoubleAnimation.EasingFunction>
34
</DoubleAnimation>
35
</Storyboard>
36
</BeginStoryboard>
37
</EventTrigger>
38
<EventTrigger RoutedEvent="MouseLeftButtonDown">
39
<BeginStoryboard>
40
<Storyboard>
41
<DoubleAnimation Storyboard.TargetName="backBorder" Storyboard.TargetProperty="Opacity" To="0.3" Duration="0:0:0.3">
42
<DoubleAnimation.EasingFunction>
43
<CubicEase EasingMode="EaseOut"/>
44
</DoubleAnimation.EasingFunction>
45
</DoubleAnimation>
46
</Storyboard>
47
</BeginStoryboard>
48
</EventTrigger>
49
<EventTrigger RoutedEvent="MouseLeftButtonUp">
50
<BeginStoryboard>
51
<Storyboard>
52
<DoubleAnimation Storyboard.TargetName="backBorder" Storyboard.TargetProperty="Opacity" To="0.1" Duration="0:0:0.3">
53
<DoubleAnimation.EasingFunction>
54
<CubicEase EasingMode="EaseOut"/>
55
</DoubleAnimation.EasingFunction>
56
</DoubleAnimation>
57
</Storyboard>
58
</BeginStoryboard>
59
</EventTrigger>
60
</ControlTemplate.Triggers>
61
</ControlTemplate>
62
</Setter.Value>
63
</Setter>
64
</Style>
65
<Style TargetType="{x:Type ctr:SwitchButton}">
66
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
67
<Setter Property="IsTabStop" Value="False"/>
68
<Setter Property="Margin" Value="0,10"/>
69
<Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
70
<Setter Property="Template">
71
<Setter.Value>
72
<ControlTemplate TargetType="ToggleButton">
73
<Grid>
74
<Grid.ColumnDefinitions>
75
<ColumnDefinition Width="32"/>
76
<ColumnDefinition Width="*"/>
77
</Grid.ColumnDefinitions>
78
<Grid x:Name="buttonGrid" Width="32" Height="17">
79
<Border x:Name="outBorder" BorderBrush="{DynamicResource MainColor}" BorderThickness="1.5" Width="32" Height="17" CornerRadius="8" VerticalAlignment="Center" HorizontalAlignment="Center" RenderTransformOrigin="0.5,0.5">
80
<Border.Background>
81
<SolidColorBrush x:Name="backgroundBursh" Color="White"/>
82
</Border.Background>
83
</Border>
84
<Border x:Name="switchBorder" Width="14.5" Height="14.5" Background="White" CornerRadius="20" BorderBrush="Gray" BorderThickness="1" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="1,0,0,0" RenderTransformOrigin="0.5,0.5">
85
<Border.RenderTransform>
86
<TranslateTransform x:Name="borderTransform" X="0" Y="0"/>
87
</Border.RenderTransform>
88
</Border>
89
</Grid>
90
<ContentPresenter x:Name="content" Grid.Column="1" Opacity="0.5" Margin="10,0,0,0"/>
91
</Grid>
92
<ControlTemplate.Triggers>
93
<EventTrigger RoutedEvent="MouseEnter" SourceName="buttonGrid">
94
<BeginStoryboard>
95
<Storyboard>
96
<ThicknessAnimation Storyboard.TargetName="switchBorder" Storyboard.TargetProperty="BorderThickness" To="0.5" Duration="0:0:0.3">
97
<ThicknessAnimation.EasingFunction>
98
<CubicEase EasingMode="EaseOut"/>
99
</ThicknessAnimation.EasingFunction>
100
</ThicknessAnimation>
101
</Storyboard>
102
</BeginStoryboard>
103
</EventTrigger>
104
<EventTrigger RoutedEvent="MouseLeave" SourceName="buttonGrid">
105
<BeginStoryboard>
106
<Storyboard>
107
<ThicknessAnimation Storyboard.TargetName="switchBorder" Storyboard.TargetProperty="BorderThickness" To="1" Duration="0:0:0.3">
108
<ThicknessAnimation.EasingFunction>
109
<CubicEase EasingMode="EaseOut"/>
110
</ThicknessAnimation.EasingFunction>
111
</ThicknessAnimation>
112
</Storyboard>
113
</BeginStoryboard>
114
</EventTrigger>
115
<EventTrigger RoutedEvent="Checked">
116
<BeginStoryboard>
117
<Storyboard>
118
<DoubleAnimation Storyboard.TargetName="borderTransform" Storyboard.TargetProperty="X" From="0" To="15" Duration="0:0:0.3">
119
<DoubleAnimation.EasingFunction>
120
<CubicEase EasingMode="EaseOut"/>
121
</DoubleAnimation.EasingFunction>
122
</DoubleAnimation>
123
<DoubleAnimation Storyboard.TargetName="content" Storyboard.TargetProperty="Opacity" From="0.5" To="1" Duration="0:0:0.3">
124
<DoubleAnimation.EasingFunction>
125
<CubicEase EasingMode="EaseOut"/>
126
</DoubleAnimation.EasingFunction>
127
</DoubleAnimation>
128
<ColorAnimation Storyboard.TargetName="backgroundBursh" Storyboard.TargetProperty="Color" From="White" To="#9898e7" Duration="0:0:0.3">
129
<ColorAnimation.EasingFunction>
130
<CubicEase EasingMode="EaseOut"/>
131
</ColorAnimation.EasingFunction>
132
</ColorAnimation>
133
</Storyboard>
134
</BeginStoryboard>
135
</EventTrigger>
136
<EventTrigger RoutedEvent="Unchecked">
137
<BeginStoryboard>
138
<Storyboard>
139
<DoubleAnimation Storyboard.TargetName="borderTransform" Storyboard.TargetProperty="X" From="15" To="0" Duration="0:0:0.3">
140
<DoubleAnimation.EasingFunction>
141
<CubicEase EasingMode="EaseOut"/>
142
</DoubleAnimation.EasingFunction>
143
</DoubleAnimation>
144
<DoubleAnimation Storyboard.TargetName="content" Storyboard.TargetProperty="Opacity" From="1" To="0.5" Duration="0:0:0.3">
145
<DoubleAnimation.EasingFunction>
146
<CubicEase EasingMode="EaseOut"/>
147
</DoubleAnimation.EasingFunction>
148
</DoubleAnimation>
149
<ColorAnimation Storyboard.TargetName="backgroundBursh" Storyboard.TargetProperty="Color" From="#9898e7" To="White" Duration="0:0:0.3">
150
<ColorAnimation.EasingFunction>
151
<CubicEase EasingMode="EaseOut"/>
152
</ColorAnimation.EasingFunction>
153
</ColorAnimation>
154
</Storyboard>
155
</BeginStoryboard>
156
</EventTrigger>
157
</ControlTemplate.Triggers>
158
</ControlTemplate>
159
</Setter.Value>
160
</Setter>
161
</Style>
162
<Style TargetType="{x:Type ctr:TabUnderLineButton}">
163
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
164
<Setter Property="IsTabStop" Value="False"/>
165
<Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
166
<Setter Property="Margin" Value="10,0"/>
167
<Setter Property="Template">
168
<Setter.Value>
169
<ControlTemplate TargetType="RadioButton">
170
<Grid>
171
<Grid.RowDefinitions>
172
<RowDefinition Height="Auto"/>
173
<RowDefinition Height="4"/>
174
</Grid.RowDefinitions>
175
<ContentPresenter x:Name="content" Opacity="0.5"/>
176
<Border x:Name="tagBorder" Background="{DynamicResource MainColor}" Grid.Row="1" CornerRadius="3" Height="4" Width="0"/>
177
<Border x:Name="tipBorder" Background="{DynamicResource MainColor}" Grid.Row="1" CornerRadius="20" Width="4" Height="4" Opacity="0"/>
178
</Grid>
179
<ControlTemplate.Triggers>
180
<EventTrigger RoutedEvent="MouseEnter">
181
<BeginStoryboard>
182
<Storyboard>
183
<DoubleAnimation Storyboard.TargetName="tipBorder" Storyboard.TargetProperty="Opacity" From="0" To="0.8" Duration="0:0:0.3">
184
<DoubleAnimation.EasingFunction>
185
<CubicEase EasingMode="EaseOut"/>
186
</DoubleAnimation.EasingFunction>
187
</DoubleAnimation>
188
</Storyboard>
189
</BeginStoryboard>
190
</EventTrigger>
191
<EventTrigger RoutedEvent="MouseLeave">
192
<BeginStoryboard>
193
<Storyboard>
194
<DoubleAnimation Storyboard.TargetName="tipBorder" Storyboard.TargetProperty="Opacity" From="0.8" To="0" Duration="0:0:0.3">
195
<DoubleAnimation.EasingFunction>
196
<CubicEase EasingMode="EaseOut"/>
197
</DoubleAnimation.EasingFunction>
198
</DoubleAnimation>
199
</Storyboard>
200
</BeginStoryboard>
201
</EventTrigger>
202
<EventTrigger RoutedEvent="Checked">
203
<BeginStoryboard>
204
<Storyboard>
205
<DoubleAnimation Storyboard.TargetName="tagBorder" Storyboard.TargetProperty="Width" From="0" To="20" Duration="0:0:0.3">
206
<DoubleAnimation.EasingFunction>
207
<CubicEase EasingMode="EaseOut"/>
208
</DoubleAnimation.EasingFunction>
209
</DoubleAnimation>
210
<DoubleAnimation Storyboard.TargetName="content" Storyboard.TargetProperty="Opacity" From="0.5" To="1" Duration="0:0:0.3">
211
<DoubleAnimation.EasingFunction>
212
<CubicEase EasingMode="EaseOut"/>
213
</DoubleAnimation.EasingFunction>
214
</DoubleAnimation>
215
</Storyboard>
216
</BeginStoryboard>
217
</EventTrigger>
218
<EventTrigger RoutedEvent="Unchecked">
219
<BeginStoryboard>
220
<Storyboard>
221
<DoubleAnimation Storyboard.TargetName="tagBorder" Storyboard.TargetProperty="Width" From="20" To="0" Duration="0:0:0.3">
222
<DoubleAnimation.EasingFunction>
223
<CubicEase EasingMode="EaseOut"/>
224
</DoubleAnimation.EasingFunction>
225
</DoubleAnimation>
226
<DoubleAnimation Storyboard.TargetName="content" Storyboard.TargetProperty="Opacity" From="1" To="0.5" Duration="0:0:0.3">
227
<DoubleAnimation.EasingFunction>
228
<CubicEase EasingMode="EaseOut"/>
229
</DoubleAnimation.EasingFunction>
230
</DoubleAnimation>
231
</Storyboard>
232
</BeginStoryboard>
233
</EventTrigger>
234
</ControlTemplate.Triggers>
235
</ControlTemplate>
236
</Setter.Value>
237
</Setter>
238
</Style>
239
<Style TargetType="{x:Type ctr:NavigationButton}">
240
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
241
<Setter Property="IsTabStop" Value="False"/>
242
<Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
243
<Setter Property="Margin" Value="10,0"/>
244
<Setter Property="Template">
245
<Setter.Value>
246
<ControlTemplate TargetType="RadioButton">
247
<Border x:Name="outBorder" Height="50" Background="{DynamicResource BackgroundColor}">
248
<Border x:Name="mainBorder" CornerRadius="15" Height="40" HorizontalAlignment="Stretch" Background="{DynamicResource BackgroundColor}" BorderBrush="#9898e7" BorderThickness="1.5" RenderTransformOrigin="0.5,0.5">
249
<Border.RenderTransform>
250
<ScaleTransform x:Name="mainBorderScale" ScaleX="1" ScaleY="1"/>
251
</Border.RenderTransform>
252
<Border.Effect>
253
<DropShadowEffect x:Name="mainBorderShadow" Color="#9898e7" BlurRadius="8" ShadowDepth="3" Direction="-45" Opacity="0"/>
254
</Border.Effect>
255
<Grid>
256
<Grid.ColumnDefinitions>
257
<ColumnDefinition Width="40"/>
258
<ColumnDefinition Width="10"/>
259
<ColumnDefinition Width="*"/>
260
</Grid.ColumnDefinitions>
261
<Border x:Name="borderSplit" Grid.Column="1" Background="{DynamicResource MainColor}" CornerRadius="2" Width="3" Opacity="0.5" HorizontalAlignment="Left" VerticalAlignment="Stretch" Margin="0,5"/>
262
<ContentPresenter Grid.ColumnSpan="3"/>
263
</Grid>
264
</Border>
265
</Border>
266
<ControlTemplate.Triggers>
267
<EventTrigger RoutedEvent="MouseEnter">
268
<BeginStoryboard>
269
<Storyboard>
270
<DoubleAnimation Storyboard.TargetName="mainBorderScale" Storyboard.TargetProperty="ScaleX" From="1" To="1.1" Duration="0:0:0.3">
271
<DoubleAnimation.EasingFunction>
272
<CubicEase EasingMode="EaseOut"/>
273
</DoubleAnimation.EasingFunction>
274
</DoubleAnimation>
275
<DoubleAnimation Storyboard.TargetName="mainBorderScale" Storyboard.TargetProperty="ScaleY" From="1" To="1.1" Duration="0:0:0.3">
276
<DoubleAnimation.EasingFunction>
277
<CubicEase EasingMode="EaseOut"/>
278
</DoubleAnimation.EasingFunction>
279
</DoubleAnimation>
280
<DoubleAnimation Storyboard.TargetName="outBorder" Storyboard.TargetProperty="Height" From="50" To="70" Duration="0:0:0.3">
281
<DoubleAnimation.EasingFunction>
282
<CubicEase EasingMode="EaseOut"/>
283
</DoubleAnimation.EasingFunction>
284
</DoubleAnimation>
285
</Storyboard>
286
</BeginStoryboard>
287
</EventTrigger>
288
<EventTrigger RoutedEvent="MouseLeave">
289
<BeginStoryboard>
290
<Storyboard>
291
<DoubleAnimation Storyboard.TargetName="mainBorderScale" Storyboard.TargetProperty="ScaleX" From="1.1" To="1" Duration="0:0:0.3">
292
<DoubleAnimation.EasingFunction>
293
<CubicEase EasingMode="EaseOut"/>
294
</DoubleAnimation.EasingFunction>
295
</DoubleAnimation>
296
<DoubleAnimation Storyboard.TargetName="mainBorderScale" Storyboard.TargetProperty="ScaleY" From="1.1" To="1" Duration="0:0:0.3">
297
<DoubleAnimation.EasingFunction>
298
<CubicEase EasingMode="EaseOut"/>
299
</DoubleAnimation.EasingFunction>
300
</DoubleAnimation>
301
<DoubleAnimation Storyboard.TargetName="outBorder" Storyboard.TargetProperty="Height" From="70" To="50" Duration="0:0:0.3">
302
<DoubleAnimation.EasingFunction>
303
<CubicEase EasingMode="EaseOut"/>
304
</DoubleAnimation.EasingFunction>
305
</DoubleAnimation>
306
</Storyboard>
307
</BeginStoryboard>
308
</EventTrigger>
309
<EventTrigger RoutedEvent="Checked">
310
<BeginStoryboard>
311
<Storyboard>
312
<DoubleAnimation Storyboard.TargetName="mainBorderShadow" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:0.3">
313
<DoubleAnimation.EasingFunction>
314
<CubicEase EasingMode="EaseOut"/>
315
</DoubleAnimation.EasingFunction>
316
</DoubleAnimation>
317
<DoubleAnimation Storyboard.TargetName="borderSplit" Storyboard.TargetProperty="Opacity" From="0.5" To="1" Duration="0:0:0.3">
318
<DoubleAnimation.EasingFunction>
319
<CubicEase EasingMode="EaseOut"/>
320
</DoubleAnimation.EasingFunction>
321
</DoubleAnimation>
322
</Storyboard>
323
</BeginStoryboard>
324
</EventTrigger>
325
<EventTrigger RoutedEvent="Unchecked">
326
<BeginStoryboard>
327
<Storyboard>
328
<DoubleAnimation Storyboard.TargetName="mainBorderShadow" Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="0:0:0.3">
329
<DoubleAnimation.EasingFunction>
330
<CubicEase EasingMode="EaseOut"/>
331
</DoubleAnimation.EasingFunction>
332
</DoubleAnimation>
333
<DoubleAnimation Storyboard.TargetName="borderSplit" Storyboard.TargetProperty="Opacity" From="1" To="0.5" Duration="0:0:0.3">
334
<DoubleAnimation.EasingFunction>
335
<CubicEase EasingMode="EaseOut"/>
336
</DoubleAnimation.EasingFunction>
337
</DoubleAnimation>
338
</Storyboard>
339
</BeginStoryboard>
340
</EventTrigger>
341
</ControlTemplate.Triggers>
342
</ControlTemplate>
343
</Setter.Value>
344
</Setter>
345
</Style>
346
</ResourceDictionary>
@@ -0,0 +1,5 @@
1
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
3
<SolidColorBrush x:Key="MainColor" Color="#9898e7"/>
4
<SolidColorBrush x:Key="BackgroundColor" Color="White"/>
5
</ResourceDictionary>
@@ -0,0 +1,25 @@
1
using System.Windows.Media;
2
using System.Windows;
3
4
namespace XFEToolBox.Utilities;
5
6
public class ControlHelper
7
{
8
public static T? FindControlByTag<T>(DependencyObject parent, object tag) where T : FrameworkElement
9
{
10
if (parent is null)
11
return null;
12
int childrenCount = VisualTreeHelper.GetChildrenCount(parent);
13
for (int i = 0; i < childrenCount; i++)
14
{
15
var child = VisualTreeHelper.GetChild(parent, i);
16
var childElement = child as T;
17
if (childElement is not null && Equals(childElement.Tag, tag))
18
return childElement;
19
var result = FindControlByTag<T>(child, tag);
20
if (result is not null)
21
return result;
22
}
23
return null;
24
}
25
}
@@ -0,0 +1,52 @@
1
using System.Reflection;
2
using System.Windows.Media;
3
using System.Windows;
4
5
namespace XFEToolBox.Utilities;
6
7
public static class ProfileHelper
8
{
9
/// <summary>
10
/// 设置配置文件值
11
/// </summary>
12
/// <param name="profilePath">配置文件属性路径</param>
13
/// <param name="value">属性值</param>
14
/// <exception cref="ArgumentException"></exception>
15
public static void SetProfileValue(string profilePath, object value)
16
{
17
var splitPath = profilePath.Split('.');
18
if (splitPath.Length < 2)
19
throw new ArgumentException("Invalid property path. It should be in the format 'NameSpace.ClassName.PropertyName'.");
20
string[] className = splitPath[..^1];
21
var propertyName = splitPath[^1];
22
var type = Type.GetType(string.Join(".", className)) ?? throw new ArgumentException($"Type '{className}' not found.");
23
var propertyInfo = type.GetProperty(propertyName, BindingFlags.Static | BindingFlags.Public) ?? throw new ArgumentException($"Property '{propertyName}' not found on type '{className}'.");
24
if (value is not null && !propertyInfo.PropertyType.IsAssignableFrom(value.GetType()))
25
throw new ArgumentException($"Value is not assignable to property '{propertyName}' of type '{propertyInfo.PropertyType}'.");
26
propertyInfo.SetValue(null, value);
27
}
28
/// <summary>
29
/// 获取配置文件值
30
/// </summary>
31
/// <typeparam name="T">目标属性类型</typeparam>
32
/// <param name="profilePath">配置文件属性路径</param>
33
/// <returns></returns>
34
public static T? GetProfileValue<T>(string profilePath)
35
{
36
var splitPath = profilePath.Split('.');
37
if (splitPath.Length < 2)
38
return default;
39
string[] className = splitPath[..^1];
40
var propertyName = splitPath[^1];
41
var type = Type.GetType(string.Join(".", className));
42
if (type is null)
43
return default;
44
var propertyInfo = type.GetProperty(propertyName, BindingFlags.Static | BindingFlags.Public);
45
if (propertyInfo is null || !propertyInfo.PropertyType.IsAssignableFrom(typeof(T)))
46
return default;
47
var result = propertyInfo.GetValue(null);
48
if (result is T resultT)
49
return resultT;
50
return default;
51
}
52
}
@@ -30,7 +30,7 @@ public partial class ConsolePageViewModel(ConsolePage viewPage) : ObservableObje
30
30
31
31
public async Task StartConsoleServer()
32
32
{
33
TerminalServer = new XFEConsoleTerminalServer(ConsoleProfile.ConsolePort, ConsoleProfile.LocalOnly, ConsoleProfile.ConsolePassword);
33
TerminalServer = new XFEConsoleTerminalServer(ConsoleProfile.ConsolePort, ConsoleProfile.LocalHostOnly, ConsoleProfile.ConsolePassword);
34
34
TerminalServer.ServerStarted += TerminalServer_ServerStarted;
35
35
TerminalServer.Connected += TerminalServer_Connected;
36
36
TerminalServer.Disconnected += TerminalServer_Disconnected;
@@ -140,10 +140,10 @@ public partial class MainWindowViewModel : ObservableObject
140
140
CurrentPage = MainPage.Current;
141
141
break;
142
142
case "tool":
143
CurrentPage = MainPage.Current;
143
CurrentPage = ToolBoxPage.Current;
144
144
break;
145
145
case "download":
146
CurrentPage = MainPage.Current;
146
CurrentPage = DownloadPage.Current;
147
147
break;
148
148
case "console":
149
149
CurrentPage = ConsolePage.Current;
@@ -1,7 +1,82 @@
1
1
using CommunityToolkit.Mvvm.ComponentModel;
2
using CommunityToolkit.Mvvm.Input;
3
using System.IO;
4
using System.Windows;
5
using System.Windows.Media;
6
using XFEExtension.NetCore.FileExtension;
7
using XFEToolBox.Core.Model;
8
using XFEToolBox.Utilities;
9
using XFEToolBox.Views.Controls;
10
using XFEToolBox.Views.Pages;
2
11
3
12
namespace XFEToolBox.ViewModel;
4
13
5
public partial class SettingPageViewModel : ObservableObject
14
public partial class SettingPageViewModel(SettingPage viewPage) : ObservableObject
6
15
{
16
[ObservableProperty]
17
string cacheProfileSize = "计算中...";
18
[ObservableProperty]
19
string crossVersionProfileSize = "计算中...";
20
[ObservableProperty]
21
string currentVersionProfileSize = "计算中...";
22
[ObservableProperty]
23
string synchronizeProfileSize = "计算中...";
24
[ObservableProperty]
25
string totalProfileSize = "计算中...";
26
public SettingPage ViewPage { get; set; } = viewPage;
27
28
public static void LoadSettingProfile(DependencyObject parent)
29
{
30
if (parent is null)
31
return;
32
int childrenCount = VisualTreeHelper.GetChildrenCount(parent);
33
for (int i = 0; i < childrenCount; i++)
34
{
35
var child = VisualTreeHelper.GetChild(parent, i);
36
if (child is SwitchButton switchButton && switchButton.Tag is string tagString)
37
{
38
switchButton.IsChecked = ProfileHelper.GetProfileValue<bool>(tagString);
39
}
40
LoadSettingProfile(child);
41
}
42
}
43
44
public void CalculateFileSize()
45
{
46
var cacheProfileSize = FileHelper.GetDirectorySize(new(AppPath.CacheProfile));
47
var crossVersionProfileSize = FileHelper.GetDirectorySize(new(AppPath.AppLocalData));
48
var currentVersionProfileSize = FileHelper.GetDirectorySize(new(AppPath.LocalVersionProfile));
49
var synchronizeProfileSize = FileHelper.GetDirectorySize(new(AppPath.SynProfile));
50
CacheProfileSize = cacheProfileSize.FileSize();
51
CrossVersionProfileSize = (crossVersionProfileSize - currentVersionProfileSize).FileSize();
52
CurrentVersionProfileSize = currentVersionProfileSize.FileSize();
53
SynchronizeProfileSize = synchronizeProfileSize.FileSize();
54
TotalProfileSize = (cacheProfileSize + crossVersionProfileSize + synchronizeProfileSize).FileSize();
55
}
56
57
#region Command
58
[RelayCommand]
59
static void Switched(SwitchButton value)
60
{
61
if (value.IsChecked.HasValue)
62
{
63
var commandPath = value.Tag as string;
64
switch (commandPath)
65
{
66
case "SystemProfile.AutoSelfLaunch":
67
68
break;
69
default:
70
break;
71
}
72
ProfileHelper.SetProfileValue(commandPath!, value.IsChecked.Value);
73
}
74
}
75
[RelayCommand]
76
async Task ClearCache()
77
{
78
Directory.Delete(AppPath.CacheProfile, true);
79
await Task.Run(CalculateFileSize);
80
}
81
#endregion
7
82
}
@@ -0,0 +1,28 @@
1
<TextBox x:Class="XFEToolBox.Views.Controls.HintTextBox"
2
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6
xmlns:local="clr-namespace:XFEToolBox.Views.Controls"
7
mc:Ignorable="d"
8
d:DesignHeight="450" d:DesignWidth="800" x:Name="hintTextBox">
9
<TextBox.Resources>
10
<VisualBrush x:Key="hintVisualBrush" TileMode="None" Stretch="None" AlignmentX="Left">
11
<VisualBrush.Visual>
12
<TextBlock x:Name="hintTextBlock" Text="{Binding ElementName=hintTextBox, Path=HintText}" Foreground="{Binding ElementName=hintTextBox, Path=HintForeground}" Background="{Binding ElementName=hintTextBox, Path=HintBackground}" FontFamily="{Binding ElementName=hintTextBox, Path=HintFontFamily}" FontSize="{Binding ElementName=hintTextBox, Path=HintFontSize}" Margin="{Binding ElementName=hintTextBox, Path=HintTextMargin}" Opacity="{Binding ElementName=hintTextBox, Path=HintTextOpacity}"/>
13
</VisualBrush.Visual>
14
</VisualBrush>
15
</TextBox.Resources>
16
<TextBox.Style>
17
<Style TargetType="TextBox">
18
<Style.Triggers>
19
<Trigger Property="Text" Value="">
20
<Setter Property="Background" Value="{StaticResource hintVisualBrush}" />
21
</Trigger>
22
<Trigger Property="Text" Value="{x:Null}">
23
<Setter Property="Background" Value="{StaticResource hintVisualBrush}" />
24
</Trigger>
25
</Style.Triggers>
26
</Style>
27
</TextBox.Style>
28
</TextBox>
@@ -0,0 +1,71 @@
1
using System.Windows;
2
using System.Windows.Controls;
3
using System.Windows.Media;
4
5
namespace XFEToolBox.Views.Controls;
6
7
/// <summary>
8
/// HintTextBox.xaml 的交互逻辑
9
/// </summary>
10
public partial class HintTextBox : TextBox
11
{
12
public HintTextBox()
13
{
14
InitializeComponent();
15
}
16
public string HintText
17
{
18
get { return (string)GetValue(HintTextProperty); }
19
set { SetValue(HintTextProperty, value); }
20
}
21
public static readonly DependencyProperty HintTextProperty = DependencyProperty.Register("HintText", typeof(string), typeof(HintTextBox), new PropertyMetadata("请输入文本..."));
22
23
public Brush HintForeground
24
{
25
get { return (Brush)GetValue(HintForegroundProperty); }
26
set { SetValue(HintForegroundProperty, value); }
27
}
28
public static readonly DependencyProperty HintForegroundProperty = DependencyProperty.Register("HintForeground", typeof(Brush), typeof(HintTextBox), new PropertyMetadata(new SolidColorBrush(Colors.Black)));
29
30
public Brush HintBackground
31
{
32
get { return (Brush)GetValue(HintBackgroundProperty); }
33
set { SetValue(HintBackgroundProperty, value); }
34
}
35
public static readonly DependencyProperty HintBackgroundProperty = DependencyProperty.Register("HintBackground", typeof(Brush), typeof(HintTextBox), new PropertyMetadata(new SolidColorBrush(Colors.Transparent)));
36
37
public double HintFontSize
38
{
39
get { return (double)GetValue(HintFontSizeProperty); }
40
set { SetValue(HintFontSizeProperty, value); }
41
}
42
public static readonly DependencyProperty HintFontSizeProperty = DependencyProperty.Register("HintFontSize", typeof(double), typeof(HintTextBox), new PropertyMetadata(13d));
43
44
public FontFamily HintFontFamily
45
{
46
get { return (FontFamily)GetValue(HintFontFamilyProperty); }
47
set { SetValue(HintFontFamilyProperty, value); }
48
}
49
public static readonly DependencyProperty HintFontFamilyProperty = DependencyProperty.Register("HintFontFamily", typeof(FontFamily), typeof(HintTextBox), new PropertyMetadata(new FontFamily()));
50
51
public FontWeight HintFontWeight
52
{
53
get { return (FontWeight)GetValue(HintFontWeightProperty); }
54
set { SetValue(HintFontWeightProperty, value); }
55
}
56
public static readonly DependencyProperty HintFontWeightProperty = DependencyProperty.Register("HintFontWeight", typeof(FontWeight), typeof(HintTextBox), new PropertyMetadata(new FontWeight()));
57
58
public Thickness HintTextMargin
59
{
60
get { return (Thickness)GetValue(HintTextMarginProperty); }
61
set { SetValue(HintTextMarginProperty, value); }
62
}
63
public static readonly DependencyProperty HintTextMarginProperty = DependencyProperty.Register("HintTextMargin", typeof(Thickness), typeof(HintTextBox), new PropertyMetadata(new Thickness(10, 0, 0, 0)));
64
65
public double HintTextOpacity
66
{
67
get { return (double)GetValue(HintTextOpacityProperty); }
68
set { SetValue(HintTextOpacityProperty, value); }
69
}
70
public static readonly DependencyProperty HintTextOpacityProperty = DependencyProperty.Register("HintTextOpacity", typeof(double), typeof(HintTextBox), new PropertyMetadata(0.5d));
71
}
@@ -0,0 +1,36 @@
1
using System.Windows;
2
using System.Windows.Controls;
3
using System.Windows.Media;
4
5
namespace XFEToolBox.Views.Controls;
6
7
public class RoundButton : Button
8
{
9
public CornerRadius RoundCornerRadius
10
{
11
get { return (CornerRadius)GetValue(RoundCornerRadiusProperty); }
12
set { SetValue(RoundCornerRadiusProperty, value); }
13
}
14
public static readonly DependencyProperty RoundCornerRadiusProperty = DependencyProperty.Register("RoundCornerRadius", typeof(CornerRadius), typeof(RoundButton), new PropertyMetadata(new CornerRadius(10)));
15
16
public Brush RoundButtonBackground
17
{
18
get { return (Brush)GetValue(RoundButtonBackgroundProperty); }
19
set { SetValue(RoundButtonBackgroundProperty, value); }
20
}
21
public static readonly DependencyProperty RoundButtonBackgroundProperty = DependencyProperty.Register("RoundButtonBackground", typeof(Brush), typeof(RoundButton), new PropertyMetadata(new SolidColorBrush(Colors.White)));
22
23
public Brush RoundButtonBorderBrush
24
{
25
get { return (Brush)GetValue(RoundButtonBorderBrushProperty); }
26
set { SetValue(RoundButtonBorderBrushProperty, value); }
27
}
28
public static readonly DependencyProperty RoundButtonBorderBrushProperty = DependencyProperty.Register("RoundButtonBorderBrush", typeof(Brush), typeof(RoundButton), new PropertyMetadata(new SolidColorBrush(Colors.White)));
29
30
public Thickness RoundButtonBorderThickness
31
{
32
get { return (Thickness)GetValue(RoundButtonBorderThicknessProperty); }
33
set { SetValue(RoundButtonBorderThicknessProperty, value); }
34
}
35
public static readonly DependencyProperty RoundButtonBorderThicknessProperty = DependencyProperty.Register("RoundButtonBorderThickness", typeof(Thickness), typeof(RoundButton), new PropertyMetadata(new Thickness(1)));
36
}
@@ -0,0 +1,10 @@
1
using System.Windows.Controls.Primitives;
2
3
namespace XFEToolBox.Views.Controls;
4
5
public class SwitchButton : ToggleButton
6
{
7
public SwitchButton()
8
{
9
}
10
}
@@ -0,0 +1,10 @@
1
using System.Windows.Controls;
2
3
namespace XFEToolBox.Views.Controls;
4
5
public class TabUnderLineButton : RadioButton
6
{
7
public TabUnderLineButton()
8
{
9
}
10
}
@@ -8,7 +8,7 @@ namespace XFEToolBox.Views.Pages;
8
8
/// </summary>
9
9
public partial class ConsolePage : Page
10
10
{
11
public static ConsolePage? Current { get; set; } = new ConsolePage();
11
public static ConsolePage? Current { get; set; } = new();
12
12
public ConsolePageViewModel ViewModel { get; set; }
13
13
public ConsolePage()
14
14
{
@@ -0,0 +1,14 @@
1
<Page x:Class="XFEToolBox.Views.Pages.DownloadPage"
2
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6
xmlns:local="clr-namespace:XFEToolBox.Views.Pages"
7
mc:Ignorable="d"
8
d:DesignHeight="450" d:DesignWidth="800"
9
Title="DownloadPage">
10
11
<Grid>
12
13
</Grid>
14
</Page>
@@ -0,0 +1,16 @@
1
using System.Windows.Controls;
2
3
namespace XFEToolBox.Views.Pages;
4
5
/// <summary>
6
/// DownloadPage.xaml 的交互逻辑
7
/// </summary>
8
public partial class DownloadPage : Page
9
{
10
public static DownloadPage? Current { get; set; } = new();
11
public DownloadPage()
12
{
13
InitializeComponent();
14
Current = this;
15
}
16
}
@@ -13,11 +13,27 @@
13
13
<ColumnDefinition Width="*"/>
14
14
</Grid.ColumnDefinitions>
15
15
<Grid.RowDefinitions>
16
<RowDefinition Height="Auto"/>
16
17
<RowDefinition Height="2*"/>
17
18
<RowDefinition Height="*"/>
18
19
</Grid.RowDefinitions>
19
<Border CornerRadius="15" Background="White" Margin="10" BorderBrush="#5b5be7" BorderThickness="2">
20
<TextBlock x:Name="notifyText"/>
20
<TextBlock Margin="10,0" Text="最近使用" Foreground="{DynamicResource BackgroundColor}" FontSize="15" FontWeight="Bold"/>
21
<Border Grid.Row="1" Grid.ColumnSpan="2" CornerRadius="15" Background="White" Margin="10">
22
<ScrollViewer VerticalScrollBarVisibility="Hidden" HorizontalScrollBarVisibility="Disabled">
23
<WrapPanel>
24
<Border Background="{DynamicResource MainColor}" CornerRadius="10" Width="50" Height="50" Margin="10"/>
25
<Border Background="{DynamicResource MainColor}" CornerRadius="10" Width="50" Height="50" Margin="10"/>
26
<Border Background="{DynamicResource MainColor}" CornerRadius="10" Width="50" Height="50" Margin="10"/>
27
<Border Background="{DynamicResource MainColor}" CornerRadius="10" Width="50" Height="50" Margin="10"/>
28
<Border Background="{DynamicResource MainColor}" CornerRadius="10" Width="50" Height="50" Margin="10"/>
29
<Border Background="{DynamicResource MainColor}" CornerRadius="10" Width="50" Height="50" Margin="10"/>
30
<Border Background="{DynamicResource MainColor}" CornerRadius="10" Width="50" Height="50" Margin="10"/>
31
<Border Background="{DynamicResource MainColor}" CornerRadius="10" Width="50" Height="50" Margin="10"/>
32
<Border Background="{DynamicResource MainColor}" CornerRadius="10" Width="50" Height="50" Margin="10"/>
33
<Border Background="{DynamicResource MainColor}" CornerRadius="10" Width="50" Height="50" Margin="10"/>
34
<Border Background="{DynamicResource MainColor}" CornerRadius="10" Width="50" Height="50" Margin="10"/>
35
</WrapPanel>
36
</ScrollViewer>
21
37
</Border>
22
38
</Grid>
23
39
</Page>
@@ -9,7 +9,7 @@ namespace XFEToolBox.Views.Pages;
9
9
/// </summary>
10
10
public partial class MainPage : Page
11
11
{
12
public static MainPage? Current { get; set; } = new MainPage();
12
public static MainPage? Current { get; set; } = new();
13
13
public MainPage()
14
14
{
15
15
InitializeComponent();
@@ -19,6 +19,5 @@ public partial class MainPage : Page
19
19
private void Page_Loaded(object sender, System.Windows.RoutedEventArgs e)
20
20
{
21
21
//notifyText.Text = FileHelper.GetDirectorySize(new(@"C:\Users\XFEstudio\Downloads")).FileSize();
22
notifyText.Text = "持续开发中...";
23
22
}
24
23
}
@@ -1,14 +1,119 @@
1
1
<Page x:Class="XFEToolBox.Views.Pages.SettingPage"
2
2
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3
3
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
4
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5
xmlns:viewmodel="clr-namespace:XFEToolBox.ViewModel"
6
xmlns:model="clr-namespace:XFEToolBox.Model"
7
xmlns:ctr="clr-namespace:XFEToolBox.Views.Controls"
5
8
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6
9
xmlns:local="clr-namespace:XFEToolBox.Views.Pages"
7
10
mc:Ignorable="d"
8
11
d:DesignHeight="450" d:DesignWidth="800"
9
Title="SettingPage">
12
Title="SettingPage" d:DataContext="{d:DesignInstance Type=viewmodel:SettingPageViewModel}" Loaded="Page_Loaded">
10
13
11
<Grid>
12
13
</Grid>
14
<Border Background="{DynamicResource BackgroundColor}" CornerRadius="15" Margin="15,5,15,15">
15
<Grid>
16
<Grid.ColumnDefinitions>
17
<ColumnDefinition Width="*"/>
18
<ColumnDefinition Width="5*"/>
19
<ColumnDefinition Width="*"/>
20
</Grid.ColumnDefinitions>
21
<Grid.RowDefinitions>
22
<RowDefinition Height="33"/>
23
<RowDefinition Height="*"/>
24
</Grid.RowDefinitions>
25
<Border Grid.Column="1" Background="{DynamicResource BackgroundColor}">
26
<Grid>
27
<Grid.RowDefinitions>
28
<RowDefinition Height="*"/>
29
</Grid.RowDefinitions>
30
<ScrollViewer Grid.Row="0" VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Hidden" VerticalAlignment="Center">
31
<StackPanel Orientation="Horizontal">
32
<ctr:TabUnderLineButton x:Name="generalTabUnderLineButton" Margin="0,0,10,0">
33
<TextBlock Text="常规" Style="{StaticResource TabUnderLineText}"/>
34
</ctr:TabUnderLineButton>
35
<ctr:TabUnderLineButton>
36
<TextBlock Text="控制台" Style="{StaticResource TabUnderLineText}"/>
37
</ctr:TabUnderLineButton>
38
<ctr:TabUnderLineButton>
39
<TextBlock Text="性能" Style="{StaticResource TabUnderLineText}"/>
40
</ctr:TabUnderLineButton>
41
</StackPanel>
42
</ScrollViewer>
43
<Border Background="{DynamicResource MainColor}" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" Height="1"/>
44
</Grid>
45
</Border>
46
<ScrollViewer Grid.Row="1" Grid.ColumnSpan="3" VerticalScrollBarVisibility="Hidden" HorizontalScrollBarVisibility="Disabled">
47
<Grid>
48
<Grid.ColumnDefinitions>
49
<ColumnDefinition Width="*"/>
50
<ColumnDefinition Width="5*"/>
51
<ColumnDefinition Width="*"/>
52
</Grid.ColumnDefinitions>
53
<StackPanel Grid.Column="1">
54
<Grid Margin="0,20">
55
<Grid.RowDefinitions>
56
<RowDefinition Height="25"/>
57
<RowDefinition Height="*"/>
58
</Grid.RowDefinitions>
59
<TextBlock VerticalAlignment="Center" Text="常规" Style="{StaticResource TabUnderLineText}" Tag="常规"/>
60
<Border Background="{DynamicResource MainColor}" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" Height="1"/>
61
<StackPanel Grid.Row="1">
62
<ctr:SwitchButton x:Name="autoSelfLaunchSwitch" Command="{Binding SwitchedCommand}" CommandParameter="{Binding RelativeSource={x:Static RelativeSource.Self}}" Tag="XFEToolBox.Profiles.CrossVersionProfiles.SystemProfile.AutoSelfLaunch">
63
<TextBlock Text="开机自启动"/>
64
</ctr:SwitchButton>
65
<ctr:SwitchButton x:Name="startWithMaximize" Command="{Binding SwitchedCommand}" CommandParameter="{Binding RelativeSource={x:Static RelativeSource.Self}}" Tag="XFEToolBox.Profiles.CrossVersionProfiles.SystemProfile.StartWithMaximize">
66
<TextBlock Text="最大化窗口启动"/>
67
</ctr:SwitchButton>
68
</StackPanel>
69
</Grid>
70
<Grid Margin="0,20">
71
<Grid.RowDefinitions>
72
<RowDefinition Height="25"/>
73
<RowDefinition Height="*"/>
74
</Grid.RowDefinitions>
75
<TextBlock VerticalAlignment="Center" Text="控制台" Style="{StaticResource TabUnderLineText}" Tag="控制台"/>
76
<Border Background="{DynamicResource MainColor}" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" Height="1"/>
77
<StackPanel Grid.Row="1">
78
<ctr:HintTextBox/>
79
<ctr:SwitchButton Command="{Binding SwitchedCommand}" CommandParameter="{Binding RelativeSource={x:Static RelativeSource.Self}}" Tag="XFEToolBox.Profiles.CrossVersionProfiles.ConsoleProfile.LocalHostOnly">
80
<TextBlock Text="只对本地回环开放(localhost)"/>
81
</ctr:SwitchButton>
82
</StackPanel>
83
</Grid>
84
<Grid Margin="0,20">
85
<Grid.RowDefinitions>
86
<RowDefinition Height="25"/>
87
<RowDefinition Height="*"/>
88
</Grid.RowDefinitions>
89
<TextBlock VerticalAlignment="Center" Text="性能" Style="{StaticResource TabUnderLineText}" Tag="性能"/>
90
<Border Background="{DynamicResource MainColor}" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" Height="1"/>
91
<StackPanel Grid.Row="1">
92
<TextBlock Text="储存使用" FontWeight="Bold" Margin="0,10,0,5"/>
93
<Border BorderBrush="{DynamicResource MainColor}" BorderThickness="1" Padding="10" CornerRadius="10" HorizontalAlignment="Left">
94
<UniformGrid Columns="2" Rows="5">
95
<TextBlock Text="缓存配置文件:" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left"/>
96
<StackPanel Orientation="Horizontal">
97
<TextBlock Text="{Binding CacheProfileSize}" VerticalAlignment="Center" HorizontalAlignment="Left"/>
98
<ctr:RoundButton RoundButtonBackground="{DynamicResource MainColor}" RoundButtonBorderBrush="{DynamicResource MainColor}" Margin="10,0,0,0" Command="{Binding ClearCacheCommand}">
99
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Text="清理缓存" Margin="5,0" Foreground="{DynamicResource MainColor}"/>
100
</ctr:RoundButton>
101
</StackPanel>
102
<TextBlock Text="跨版本配置文件:" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left"/>
103
<TextBlock Text="{Binding CrossVersionProfileSize}" VerticalAlignment="Center" HorizontalAlignment="Left"/>
104
<TextBlock Text="当前版本配置文件:" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left"/>
105
<TextBlock Text="{Binding CurrentVersionProfileSize}" VerticalAlignment="Center" HorizontalAlignment="Left"/>
106
<TextBlock Text="同步配置文件:" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left"/>
107
<TextBlock Text="{Binding SynchronizeProfileSize}" VerticalAlignment="Center" HorizontalAlignment="Left"/>
108
<TextBlock Text="总配置文件:" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left"/>
109
<TextBlock Text="{Binding TotalProfileSize}" VerticalAlignment="Center" HorizontalAlignment="Left"/>
110
</UniformGrid>
111
</Border>
112
</StackPanel>
113
</Grid>
114
</StackPanel>
115
</Grid>
116
</ScrollViewer>
117
</Grid>
118
</Border>
14
119
</Page>
@@ -1,4 +1,5 @@
1
1
using System.Windows.Controls;
2
using XFEToolBox.ViewModel;
2
3
3
4
namespace XFEToolBox.Views.Pages;
4
5
@@ -7,10 +8,26 @@ namespace XFEToolBox.Views.Pages;
7
8
/// </summary>
8
9
public partial class SettingPage : Page
9
10
{
10
public static SettingPage? Current { get; set; } = new SettingPage();
11
public static SettingPage? Current { get; set; } = new();
12
public SettingPageViewModel ViewModel { get; set; }
11
13
public SettingPage()
12
14
{
13
15
InitializeComponent();
16
ViewModel = new(this);
17
DataContext = ViewModel;
14
18
Current = this;
15
19
}
20
21
private async void Page_Loaded(object sender, System.Windows.RoutedEventArgs e)
22
{
23
await Task.Run(() =>
24
{
25
Dispatcher.Invoke(() =>
26
{
27
generalTabUnderLineButton.IsChecked = true;
28
SettingPageViewModel.LoadSettingProfile(this);
29
});
30
ViewModel.CalculateFileSize();
31
});
32
}
16
33
}
@@ -0,0 +1,14 @@
1
<Page x:Class="XFEToolBox.Views.Pages.ToolBoxPage"
2
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6
xmlns:local="clr-namespace:XFEToolBox.Views.Pages"
7
mc:Ignorable="d"
8
d:DesignHeight="450" d:DesignWidth="800"
9
Title="ToolBoxPage">
10
11
<Grid>
12
13
</Grid>
14
</Page>
@@ -0,0 +1,16 @@
1
using System.Windows.Controls;
2
3
namespace XFEToolBox.Views.Pages;
4
5
/// <summary>
6
/// ToolBoxPage.xaml 的交互逻辑
7
/// </summary>
8
public partial class ToolBoxPage : Page
9
{
10
public static ToolBoxPage? Current { get; set; } = new();
11
public ToolBoxPage()
12
{
13
InitializeComponent();
14
Current = this;
15
}
16
}
@@ -10,7 +10,7 @@
10
10
d:DataContext="{d:DesignInstance Type=viewmodel:MainWindowViewModel}"
11
11
Title="XFE工具箱" Height="460" Width="730" MinHeight="450" MinWidth="720" Background="Transparent" WindowStyle="None" AllowsTransparency="True" WindowStartupLocation="CenterScreen" Icon="/Resources/Icon/XFEToolBoxIcon.ico" Loaded="Window_Loaded">
12
12
13
<Border CornerRadius="19" Background="#9898e7" Margin="5">
13
<Border CornerRadius="19" Background="{DynamicResource MainColor}" Margin="5">
14
14
<Grid>
15
15
<Grid.ColumnDefinitions>
16
16
<ColumnDefinition Width="180"/>
@@ -20,7 +20,7 @@
20
20
<RowDefinition Height="25"/>
21
21
<RowDefinition Height="*"/>
22
22
</Grid.RowDefinitions>
23
<Border CornerRadius="20,0,0,20" Grid.Column="0" Grid.Row="0" Grid.RowSpan="2" Background="White"/>
23
<Border CornerRadius="20,0,0,20" Grid.Column="0" Grid.Row="0" Grid.RowSpan="2" Background="{DynamicResource BackgroundColor}"/>
24
24
<Border Grid.Column="1" Grid.Row="0" Background="Transparent">
25
25
<Grid>
26
26
<Grid.ColumnDefinitions>
@@ -41,7 +41,7 @@
41
41
</TextBlock>
42
42
</Border>
43
43
<StackPanel Grid.Column="0" Grid.Row="1">
44
<ctr:NavigationButton x:Name="mainButton" Style="{StaticResource NavigationButton}" Command="{Binding NavigateToPageCommand}" CommandParameter="home">
44
<ctr:NavigationButton x:Name="mainButton" Command="{Binding NavigateToPageCommand}" CommandParameter="home">
45
45
<Grid>
46
46
<Grid.ColumnDefinitions>
47
47
<ColumnDefinition Width="40"/>
@@ -51,7 +51,7 @@
51
51
<TextBlock Grid.Column="1" Style="{StaticResource NavigationButtonText}" Text="首页"/>
52
52
</Grid>
53
53
</ctr:NavigationButton>
54
<ctr:NavigationButton Style="{StaticResource NavigationButton}" Command="{Binding NavigateToPageCommand}" CommandParameter="tool">
54
<ctr:NavigationButton Command="{Binding NavigateToPageCommand}" CommandParameter="tool">
55
55
<Grid>
56
56
<Grid.ColumnDefinitions>
57
57
<ColumnDefinition Width="40"/>
@@ -61,7 +61,7 @@
61
61
<TextBlock Grid.Column="1" Style="{StaticResource NavigationButtonText}" Text="工具箱"/>
62
62
</Grid>
63
63
</ctr:NavigationButton>
64
<ctr:NavigationButton Style="{StaticResource NavigationButton}" Command="{Binding NavigateToPageCommand}" CommandParameter="console">
64
<ctr:NavigationButton Command="{Binding NavigateToPageCommand}" CommandParameter="console">
65
65
<Grid>
66
66
<Grid.ColumnDefinitions>
67
67
<ColumnDefinition Width="40"/>
@@ -71,7 +71,7 @@
71
71
<TextBlock Grid.Column="1" Style="{StaticResource NavigationButtonText}" Text="C#控制台"/>
72
72
</Grid>
73
73
</ctr:NavigationButton>
74
<ctr:NavigationButton Style="{StaticResource NavigationButton}" Command="{Binding NavigateToPageCommand}" CommandParameter="download">
74
<ctr:NavigationButton Command="{Binding NavigateToPageCommand}" CommandParameter="download">
75
75
<Grid>
76
76
<Grid.ColumnDefinitions>
77
77
<ColumnDefinition Width="40"/>
@@ -81,7 +81,7 @@
81
81
<TextBlock Grid.Column="1" Style="{StaticResource NavigationButtonText}" Text="下载专区"/>
82
82
</Grid>
83
83
</ctr:NavigationButton>
84
<ctr:NavigationButton Style="{StaticResource NavigationButton}" Command="{Binding NavigateToPageCommand}" CommandParameter="setting">
84
<ctr:NavigationButton Command="{Binding NavigateToPageCommand}" CommandParameter="setting">
85
85
<Grid>
86
86
<Grid.ColumnDefinitions>
87
87
<ColumnDefinition Width="40"/>
@@ -93,7 +93,7 @@
93
93
</ctr:NavigationButton>
94
94
</StackPanel>
95
95
<Frame x:Name="contentFrame" Style="{StaticResource NavigationFrame}" Content="{Binding CurrentPage}" Navigated="ContentFrame_Navigated"/>
96
<Image Grid.Column="1" Grid.Row="1" Source="/Resources/Image/corner.png" Width="25" Height="25" HorizontalAlignment="Right" VerticalAlignment="Bottom"/>
96
<Image Grid.Column="1" Grid.Row="1" Source="/Resources/Image/corner.png" Width="25" Height="25" HorizontalAlignment="Right" VerticalAlignment="Bottom" FocusVisualStyle="{x:Null}"/>
97
97
<Border x:Name="cornerBorder" Grid.Column="1" Grid.Row="1" Style="{StaticResource CornerBorderStyle}" MouseDown="CornerBorder_MouseDown">
98
98
</Border>
99
99
</Grid>
@@ -21,6 +21,7 @@ namespace XFEToolBox.Views.Windows
21
21
Current = this;
22
22
Width = SystemProfile.MainWindowWidth;
23
23
Height = SystemProfile.MainWindowHeight;
24
WindowState = SystemProfile.StartWithMaximize ? WindowState.Maximized : WindowState.Normal;
24
25
}
25
26
26
27
private void MinimizeImage_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e) => ViewModel.Minimize();
@@ -45,7 +46,7 @@ namespace XFEToolBox.Views.Windows
45
46
private void DragTabBorder_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
46
47
{
47
48
if (ViewModel.CheckDoubleClick(500))
48
WindowState = WindowState.Maximized;
49
_ = WindowState == WindowState.Maximized ? WindowState = WindowState.Normal : WindowState = WindowState.Maximized;
49
50
}
50
51
51
52
private void Window_Loaded(object sender, RoutedEventArgs e)
@@ -37,7 +37,7 @@
37
37
<PackageReference Include="XFEExtension.NetCore.AutoPath" Version="1.0.1" />
38
38
<PackageReference Include="XFEExtension.NetCore.InputSimulator" Version="2.2.0" />
39
39
<PackageReference Include="XFEExtension.NetCore.TodoHighLight" Version="1.0.0" />
40
<PackageReference Include="XFEExtension.NetCore.XFEConsole" Version="1.0.0" />
40
<PackageReference Include="XFEExtension.NetCore.XFEConsole" Version="1.0.2" />
41
41
</ItemGroup>
42
42
43
43
<ItemGroup>
@@ -58,7 +58,6 @@
58
58
</ItemGroup>
59
59
60
60
<ItemGroup>
61
<Folder Include="Model\" />
62
61
<Folder Include="Profiles\CurrentVersionProfiles\" />
63
62
<Folder Include="Profiles\SynProfiles\" />
64
63
</ItemGroup>