Merge branch 'net6' of https://github.com/InkCanvasForClass/community into net6
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
xmlns:controls="clr-namespace:Ink_Canvas.Controls;assembly=InkCanvas.Controls"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||
mc:Ignorable="d"
|
||||
Title="欢迎使用 InkCanvasForClass"
|
||||
Title="欢迎使用 InkCanvasForClass CE"
|
||||
Height="700"
|
||||
Width="1080"
|
||||
MinHeight="520"
|
||||
@@ -68,7 +68,7 @@
|
||||
<Image Source="\Resources\icc.ico" Width="18"
|
||||
RenderOptions.BitmapScalingMode="HighQuality" />
|
||||
<TextBlock VerticalAlignment="Center"
|
||||
Text="欢迎使用 InkCanvasForClass"
|
||||
Text="欢迎使用 InkCanvasForClass CE"
|
||||
TextWrapping="NoWrap" />
|
||||
</ikw:SimpleStackPanel>
|
||||
|
||||
@@ -167,7 +167,7 @@
|
||||
RenderOptions.BitmapScalingMode="HighQuality" />
|
||||
</Border>
|
||||
|
||||
<TextBlock Text="欢迎使用 InkCanvasForClass"
|
||||
<TextBlock Text="欢迎使用 InkCanvasForClass CE"
|
||||
Style="{DynamicResource TitleLargeTextBlockStyle}"
|
||||
HorizontalAlignment="Center"
|
||||
TextAlignment="Center"
|
||||
|
||||
@@ -306,17 +306,6 @@ namespace Ink_Canvas.Windows
|
||||
|
||||
private void BtnConfirm_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// 离开"启动与隐私"页前必须勾选隐私协议
|
||||
if (_currentStep == 0 && CheckBoxPrivacyAccepted.IsChecked != true)
|
||||
{
|
||||
MessageBox.Show(this,
|
||||
"请先勾选\"我已阅读并同意《隐私协议》\"后再继续。",
|
||||
"需要同意隐私协议",
|
||||
MessageBoxButton.OK,
|
||||
MessageBoxImage.Information);
|
||||
return;
|
||||
}
|
||||
|
||||
if (_currentStep == FinishIndex)
|
||||
{
|
||||
ApplySelection();
|
||||
@@ -341,18 +330,6 @@ namespace Ink_Canvas.Windows
|
||||
int target = ResolveTargetFromNavItem(args.SelectedItem as NavigationViewItem);
|
||||
if (target == _currentStep) return;
|
||||
|
||||
// 强制隐私门禁: 如果当前在步骤 0 且未勾选, 仅允许返回欢迎页, 不允许跳到后续步骤
|
||||
if (_currentStep == 0 && CheckBoxPrivacyAccepted.IsChecked != true && target > 0)
|
||||
{
|
||||
MessageBox.Show(this,
|
||||
"请先勾选\"我已阅读并同意《隐私协议》\"后再继续。",
|
||||
"需要同意隐私协议",
|
||||
MessageBoxButton.OK,
|
||||
MessageBoxImage.Information);
|
||||
SyncNavSelection();
|
||||
return;
|
||||
}
|
||||
|
||||
int direction = target > _currentStep ? 1 : -1;
|
||||
NavigateTo(target, direction);
|
||||
}
|
||||
@@ -405,6 +382,7 @@ namespace Ink_Canvas.Windows
|
||||
|
||||
private void HyperlinkPrivacy_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
e.Handled = true;
|
||||
if (_privacyDialogShown) return;
|
||||
_privacyDialogShown = true;
|
||||
try
|
||||
@@ -422,15 +400,15 @@ namespace Ink_Canvas.Windows
|
||||
}
|
||||
finally
|
||||
{
|
||||
_privacyDialogShown = false;
|
||||
Dispatcher.BeginInvoke(new Action(() => _privacyDialogShown = false),
|
||||
System.Windows.Threading.DispatcherPriority.Background);
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateConfirmEnabled()
|
||||
{
|
||||
if (BtnConfirm == null || CheckBoxPrivacyAccepted == null) return;
|
||||
// 在步骤 0 时, 必须先勾选隐私协议才能继续
|
||||
BtnConfirm.IsEnabled = _currentStep != 0 || CheckBoxPrivacyAccepted.IsChecked == true;
|
||||
if (BtnConfirm == null) return;
|
||||
BtnConfirm.IsEnabled = true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -6,7 +6,6 @@ using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace Ink_Canvas.Windows
|
||||
{
|
||||
@@ -15,16 +14,7 @@ namespace Ink_Canvas.Windows
|
||||
/// </summary>
|
||||
public partial class SplashScreen : Window
|
||||
{
|
||||
private DispatcherTimer _timer;
|
||||
private int _loadingStep = 0;
|
||||
private int _actualSplashStyle = 1;
|
||||
private readonly string[] _loadingMessages = {
|
||||
"正在启动 Ink Canvas...",
|
||||
"正在初始化组件...",
|
||||
"正在加载配置...",
|
||||
"正在准备界面...",
|
||||
"启动完成!"
|
||||
};
|
||||
|
||||
public SplashScreen()
|
||||
{
|
||||
@@ -42,33 +32,6 @@ namespace Ink_Canvas.Windows
|
||||
|
||||
// 加载启动图片并获取实际样式
|
||||
_actualSplashStyle = LoadSplashImageWithStyle();
|
||||
|
||||
// 启动加载动画
|
||||
StartLoadingAnimation();
|
||||
}
|
||||
|
||||
private void StartLoadingAnimation()
|
||||
{
|
||||
_timer = new DispatcherTimer
|
||||
{
|
||||
Interval = TimeSpan.FromMilliseconds(1200)
|
||||
};
|
||||
_timer.Tick += Timer_Tick;
|
||||
_timer.Start();
|
||||
}
|
||||
|
||||
private void Timer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
if (_loadingStep < _loadingMessages.Length)
|
||||
{
|
||||
LoadingText.Text = _loadingMessages[_loadingStep];
|
||||
_loadingStep++;
|
||||
}
|
||||
else
|
||||
{
|
||||
_timer.Stop();
|
||||
// 不要自动关闭启动画面,等待外部调用CloseSplashScreen
|
||||
}
|
||||
}
|
||||
|
||||
public void CloseSplashScreen()
|
||||
|
||||
Reference in New Issue
Block a user