优化代码

This commit is contained in:
2025-08-31 08:51:50 +08:00
parent a2aa6b48a8
commit 1bc23af61a
15 changed files with 81 additions and 46 deletions
+7 -7
View File
@@ -179,12 +179,12 @@
<Grid>
<Border x:Name="BtnStart" MouseUp="BtnStart_MouseUp" Background="#0066BF" Height="20" Width="20" CornerRadius="100">
<Viewbox Margin="5">
<ui:SymbolIcon Name="SymbolIconStart" Symbol="Play" Foreground="White"/>
<ui:FontIcon Name="FontIconStart" Glyph="&#xE768;" Foreground="White"/>
</Viewbox>
</Border>
<Border x:Name="BtnStartCover" Visibility="Collapsed" Background="#BFBFBF" Height="20" Width="20" CornerRadius="100">
<Viewbox Margin="5">
<ui:SymbolIcon Symbol="{Binding ElementName=SymbolIconStart, Path=Symbol}" Foreground="White"/>
<ui:FontIcon Glyph="{Binding ElementName=FontIconStart, Path=Glyph}" Foreground="White"/>
</Viewbox>
</Border>
</Grid>
@@ -194,12 +194,12 @@
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.15" BlurRadius="3"/>
</Border.Effect>
<Viewbox Margin="5.5">
<ui:SymbolIcon Symbol="Refresh" Foreground="Black"/>
<ui:FontIcon Glyph="&#xE72C;" Foreground="Black"/>
</Viewbox>
</Border>
<Border x:Name="BtnResetCover" Background="#F3F5F9" Height="20" Width="20" CornerRadius="100">
<Viewbox Margin="5.5">
<ui:SymbolIcon Symbol="Refresh" Foreground="#9D9D9E"/>
<ui:FontIcon Glyph="&#xE72C;" Foreground="#9D9D9E"/>
</Viewbox>
</Border>
</Grid>
@@ -215,7 +215,7 @@
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.1" BlurRadius="3"/>
</Border.Effect>
<Viewbox Margin="5.5">
<ui:SymbolIcon Name="SymbolIconMinimal" Symbol="HideBcc" Foreground="Black"/>
<ui:FontIcon Name="FontIconMinimal" Glyph="&#xE7B3;" Foreground="Black"/>
</Viewbox>
</Border>
<Border x:Name="BtnFullscreen" MouseUp="BtnFullscreen_MouseUp" HorizontalAlignment="Right" VerticalAlignment="Bottom"
@@ -225,7 +225,7 @@
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.1" BlurRadius="3"/>
</Border.Effect>
<Viewbox Margin="5.5">
<ui:SymbolIcon Name="SymbolIconFullscreen" Symbol="FullScreen" Foreground="Black"/>
<ui:FontIcon Name="FontIconFullscreen" Glyph="&#xE740;" Foreground="Black"/>
</Viewbox>
</Border>
<Border x:Name="BtnClose" MouseUp="BtnClose_MouseUp" HorizontalAlignment="Right" VerticalAlignment="Bottom"
@@ -235,7 +235,7 @@
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.1" BlurRadius="3"/>
</Border.Effect>
<Viewbox Margin="5.5">
<ui:SymbolIcon Symbol="Clear" Foreground="White"/>
<ui:FontIcon Glyph="&#xE8BB;" Foreground="White"/>
</Viewbox>
</Border>
</ui:SimpleStackPanel>
@@ -57,7 +57,7 @@ namespace Ink_Canvas
TextBlockSecond.Text = "00";
timer.Stop();
isTimerRunning = false;
SymbolIconStart.Symbol = Symbol.Play;
FontIconStart.Glyph = "&#xE768;";
BtnStartCover.Visibility = Visibility.Visible;
TextBlockHour.Foreground = new SolidColorBrush(StringToColor("#FF5B5D5F"));
BorderStopTime.Visibility = Visibility.Collapsed;
@@ -208,12 +208,12 @@ namespace Ink_Canvas
if (WindowState == WindowState.Normal)
{
WindowState = WindowState.Maximized;
SymbolIconFullscreen.Symbol = Symbol.BackToWindow;
FontIconFullscreen.Glyph = "&#xE73F;";
}
else
{
WindowState = WindowState.Normal;
SymbolIconFullscreen.Symbol = Symbol.FullScreen;
FontIconFullscreen.Glyph = "&#xE740;";
}
}
@@ -238,7 +238,7 @@ namespace Ink_Canvas
BtnStartCover.Visibility = Visibility.Collapsed;
BorderStopTime.Visibility = Visibility.Collapsed;
TextBlockHour.Foreground = new SolidColorBrush(StringToColor("#FF5B5D5F"));
SymbolIconStart.Symbol = Symbol.Play;
FontIconStart.Glyph = "&#xE768;";
isTimerRunning = false;
timer.Stop();
isPaused = false;
@@ -288,7 +288,7 @@ namespace Ink_Canvas
startTime += DateTime.Now - pauseTime;
ProcessBarTime.IsPaused = false;
TextBlockHour.Foreground = Brushes.Black;
SymbolIconStart.Symbol = Symbol.Pause;
FontIconStart.Glyph = "&#xE769;";
isPaused = false;
timer.Start();
UpdateStopTime();
@@ -300,7 +300,7 @@ namespace Ink_Canvas
pauseTime = DateTime.Now;
ProcessBarTime.IsPaused = true;
TextBlockHour.Foreground = new SolidColorBrush(StringToColor("#FF5B5D5F"));
SymbolIconStart.Symbol = Symbol.Play;
FontIconStart.Glyph = "&#xE768;";
BorderStopTime.Visibility = Visibility.Collapsed;
isPaused = true;
timer.Stop();
@@ -312,7 +312,7 @@ namespace Ink_Canvas
totalSeconds = ((hour * 60) + minute) * 60 + second;
ProcessBarTime.IsPaused = false;
TextBlockHour.Foreground = Brushes.Black;
SymbolIconStart.Symbol = Symbol.Pause;
FontIconStart.Glyph = "&#xE769;";
BtnResetCover.Visibility = Visibility.Collapsed;
if (totalSeconds <= 10)
+2 -2
View File
@@ -80,7 +80,7 @@
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.1" BlurRadius="3"/>
</Border.Effect>
<Viewbox Margin="5.5">
<ui:SymbolIcon Name="SymbolIconFullscreen" Symbol="FullScreen" Foreground="Black"/>
<ui:FontIcon Name="FontIconFullscreen" Glyph="&#xE740;" Foreground="Black"/>
</Viewbox>
</Border>
<Border x:Name="BtnClose" MouseUp="BtnClose_MouseUp" HorizontalAlignment="Right" VerticalAlignment="Bottom"
@@ -90,7 +90,7 @@
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.1" BlurRadius="3"/>
</Border.Effect>
<Viewbox Margin="5.5">
<ui:SymbolIcon Symbol="Clear" Foreground="White"/>
<ui:FontIcon Glyph="&#xE8BB;" Foreground="White"/>
</Viewbox>
</Border>
</ui:SimpleStackPanel>
@@ -31,12 +31,12 @@ namespace Ink_Canvas
if (WindowState == WindowState.Normal)
{
WindowState = WindowState.Maximized;
SymbolIconFullscreen.Symbol = Symbol.BackToWindow;
FontIconFullscreen.Glyph = "&#xE73F;";
}
else
{
WindowState = WindowState.Normal;
SymbolIconFullscreen.Symbol = Symbol.FullScreen;
FontIconFullscreen.Glyph = "&#xE740;";
}
}
@@ -68,11 +68,11 @@ namespace Ink_Canvas.Windows
}
}
public string Name => SelectedPlugin?.Name ?? string.Empty;
public new string Name => SelectedPlugin?.Name ?? string.Empty;
public string Version => SelectedPlugin?.Version?.ToString() ?? string.Empty;
public string Author => SelectedPlugin?.Author ?? string.Empty;
public string Description => SelectedPlugin?.Description ?? string.Empty;
public bool IsEnabled => SelectedPlugin is PluginBase plugin && plugin.IsEnabled;
public new bool IsEnabled => SelectedPlugin is PluginBase plugin && plugin.IsEnabled;
public bool IsBuiltIn => SelectedPlugin?.IsBuiltIn ?? false;
/// <summary>
+4 -4
View File
@@ -98,7 +98,7 @@
<Border x:Name="BorderBtnRand" MouseUp="BorderBtnRand_MouseUp" Background="#0066BF" Height="70" Width="200" CornerRadius="35">
<ui:SimpleStackPanel Margin="3,0" Spacing="20" Orientation="Horizontal" HorizontalAlignment="Center">
<Viewbox Margin="0,20">
<ui:SymbolIcon Name="SymbolIconStart" Symbol="Contact" Foreground="White"/>
<ui:FontIcon Name="FontIconStart" Glyph="&#xE779;" Foreground="White"/>
</Viewbox>
<TextBlock Text="开抽" Foreground="White" FontSize="32" Margin="-1,-1,4,0" VerticalAlignment="Center"/>
</ui:SimpleStackPanel>
@@ -113,7 +113,7 @@
<Border x:Name="BorderBtnExternalCaller" MouseUp="BorderBtnExternalCaller_MouseUp" Background="#00B894" Height="50" Width="120" CornerRadius="25">
<ui:SimpleStackPanel Margin="3,0" Spacing="8" Orientation="Horizontal" HorizontalAlignment="Center">
<Viewbox Margin="0,10">
<ui:SymbolIcon Symbol="Globe" Foreground="White"/>
<ui:FontIcon Glyph="&#xE909;" Foreground="White"/>
</Viewbox>
<TextBlock Text="外部点名" Foreground="White" FontSize="16" Margin="-1,-1,4,0" VerticalAlignment="Center"/>
</ui:SimpleStackPanel>
@@ -127,7 +127,7 @@
</Border.Effect>
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Viewbox Margin="15,12">
<ui:SymbolIcon Symbol="People" Foreground="Black"/>
<ui:FontIcon Glyph="&#xE716;" Foreground="Black"/>
</Viewbox>
<TextBlock Margin="-5,12,15,12" Name="TextBlockPeopleCount" Text="点击此处以导入名单" FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</ui:SimpleStackPanel>
@@ -137,7 +137,7 @@
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.1" BlurRadius="3"/>
</Border.Effect>
<Viewbox Margin="14">
<ui:SymbolIcon Symbol="Clear" Foreground="White"/>
<ui:FontIcon Glyph="&#xE8BB;" Foreground="White"/>
</Viewbox>
</Border>
</Canvas>
+2 -2
View File
@@ -100,7 +100,7 @@ namespace Ink_Canvas
if (RandMaxPeopleOneTime != -1 && TotalCount >= RandMaxPeopleOneTime) return;
TotalCount++;
LabelNumberCount.Text = TotalCount.ToString();
SymbolIconStart.Symbol = Symbol.People;
FontIconStart.Glyph = "&#xE779;";
BorderBtnAdd.Opacity = 1;
BorderBtnMinus.Opacity = 1;
}
@@ -112,7 +112,7 @@ namespace Ink_Canvas
LabelNumberCount.Text = TotalCount.ToString();
if (TotalCount == 1)
{
SymbolIconStart.Symbol = Symbol.Contact;
FontIconStart.Glyph = "&#xE779;";
}
}