Compare commits
No files matched your search
@@ -1,91 +1,182 @@
|
||||
<Window x:Class="ZNTechClone.LoginWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="ZNTech · 登录" Width="460" Height="560"
|
||||
Title="ZNTech · 登录" Width="436" MinHeight="489" SizeToContent="Height"
|
||||
WindowStyle="None" ResizeMode="NoResize" AllowsTransparency="True" Background="Transparent"
|
||||
WindowStartupLocation="CenterScreen" MouseLeftButtonDown="TitleBar_Drag">
|
||||
<Grid>
|
||||
<Border Background="{StaticResource B.Window}" BorderBrush="{StaticResource B.Border}" BorderThickness="1" CornerRadius="14">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="54"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="40"/>
|
||||
</Grid.RowDefinitions>
|
||||
WindowStartupLocation="CenterScreen" FontFamily="{StaticResource F.Ui}"
|
||||
MouseLeftButtonDown="TitleBar_Drag">
|
||||
|
||||
<!-- 标题栏 -->
|
||||
<Grid Grid.Row="0" Margin="18,0,10,0">
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
||||
<Border Width="26" Height="26" CornerRadius="8" Background="{StaticResource B.Accent}" Margin="0,0,10,0">
|
||||
<TextBlock Text="Z" Foreground="White" FontWeight="Bold" FontSize="15" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
<Window.Resources>
|
||||
<Style x:Key="IconBtn" TargetType="Button">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Foreground" Value="#FF6B7280"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border x:Name="bd" Background="Transparent" CornerRadius="6">
|
||||
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<TextBlock Text="ZNTech" FontWeight="SemiBold" FontSize="15" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="账号授权" Style="{StaticResource Faint}" Margin="10,0,0,0" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
<Button Content="✕" Style="{StaticResource Ghost}" Width="32" Height="32"
|
||||
HorizontalAlignment="Right" VerticalAlignment="Center" Click="Close_Click"/>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="bd" Property="Background" Value="#FFF0F2F6"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter TargetName="bd" Property="Background" Value="#FFE6EAF1"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style x:Key="LinkBtn" TargetType="Button">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Foreground" Value="#FF111827"/>
|
||||
<Setter Property="FontSize" Value="13.5"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border Background="Transparent" Padding="2">
|
||||
<ContentPresenter/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Foreground" Value="{StaticResource B.Accent}"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Window.Resources>
|
||||
|
||||
<!-- 主体 -->
|
||||
<StackPanel Grid.Row="1" Margin="26,4,26,0">
|
||||
<TextBlock Text="登录" Style="{StaticResource H1}"/>
|
||||
<TextBlock Text="使用卡密账号登录,登录即绑定当前设备" Style="{StaticResource Dim}" Margin="0,6,0,18"/>
|
||||
<Border CornerRadius="10" Background="#FFFAFBFC" BorderBrush="#FFE1E6EE" BorderThickness="1">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect BlurRadius="18" ShadowDepth="3" Opacity="0.16"/>
|
||||
</Border.Effect>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="50"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 页签 -->
|
||||
<Border Background="{StaticResource B.Card}" BorderBrush="{StaticResource B.Border}" BorderThickness="1" CornerRadius="10" Padding="4" HorizontalAlignment="Left">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<RadioButton x:Name="TabLogin" GroupName="auth" Content="登录" Style="{StaticResource TabChip}" IsChecked="True" Checked="Tab_Checked"/>
|
||||
<RadioButton x:Name="TabRegister" GroupName="auth" Content="注册" Style="{StaticResource TabChip}" Checked="Tab_Checked"/>
|
||||
<RadioButton x:Name="TabRecharge" GroupName="auth" Content="充值" Style="{StaticResource TabChip}" Checked="Tab_Checked"/>
|
||||
</StackPanel>
|
||||
<!-- 标题栏 -->
|
||||
<Grid Grid.Row="0" Margin="14,0,8,0">
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
||||
<Border Width="22" Height="22" CornerRadius="6" Background="#FF16181D">
|
||||
<TextBlock Text="Z" Foreground="White" FontWeight="Bold" FontSize="13"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<TextBlock Text="ZNTech" FontWeight="Bold" FontSize="14" Margin="9,0,0,0" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
|
||||
<Button x:Name="MinBtn" Style="{StaticResource IconBtn}" Width="30" Height="30" Click="Min_Click">
|
||||
<Path Data="M 0,0 L 11,0" Stroke="#FF6B7280" StrokeThickness="1.4"/>
|
||||
</Button>
|
||||
<Button x:Name="CloseBtn" Style="{StaticResource IconBtn}" Width="30" Height="30" Click="Close_Click">
|
||||
<Path Data="M 0,0 L 10,10 M 10,0 L 0,10" Stroke="#FF6B7280" StrokeThickness="1.4"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- 登录 -->
|
||||
<StackPanel x:Name="PanelLogin" Margin="0,18,0,0">
|
||||
<TextBlock Text="账号" Style="{StaticResource Dim}" Margin="0,0,0,6"/>
|
||||
<TextBox x:Name="LoginUser" Style="{StaticResource Input}" Text="demo"/>
|
||||
<TextBlock Text="密码" Style="{StaticResource Dim}" Margin="0,12,0,6"/>
|
||||
<PasswordBox x:Name="LoginPwd" Style="{StaticResource InputPwd}" Password="demo123"/>
|
||||
<Grid Margin="0,12,0,0">
|
||||
<CheckBox x:Name="Remember" Content="记住账号 / 密码" Style="{StaticResource Check}" HorizontalAlignment="Left"/>
|
||||
<Button Content="解绑设备" Style="{StaticResource Ghost}" Height="26" Padding="10,0"
|
||||
HorizontalAlignment="Right" Click="Unbind_Click"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
<!-- 主体 -->
|
||||
<StackPanel Grid.Row="1" Margin="26,2,26,26">
|
||||
<TextBlock Text="登录" Style="{StaticResource H1}"/>
|
||||
|
||||
<!-- 注册 -->
|
||||
<StackPanel x:Name="PanelRegister" Visibility="Collapsed" Margin="0,18,0,0">
|
||||
<TextBlock Text="账号" Style="{StaticResource Dim}" Margin="0,0,0,6"/>
|
||||
<TextBox x:Name="RegUser" Style="{StaticResource Input}"/>
|
||||
<Grid Margin="0,12,0,0">
|
||||
<StackPanel Width="180" HorizontalAlignment="Left">
|
||||
<TextBlock Text="密码" Style="{StaticResource Dim}" Margin="0,0,0,6"/>
|
||||
<PasswordBox x:Name="RegPwd" Style="{StaticResource InputPwd}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Width="180" HorizontalAlignment="Right">
|
||||
<TextBlock Text="确认密码" Style="{StaticResource Dim}" Margin="0,0,0,6"/>
|
||||
<PasswordBox x:Name="RegPwd2" Style="{StaticResource InputPwd}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<TextBlock Text="卡密" Style="{StaticResource Dim}" Margin="0,12,0,6"/>
|
||||
<TextBox x:Name="RegCard" Style="{StaticResource Input}" Text="ZNTECH-TRIAL-0001"/>
|
||||
</StackPanel>
|
||||
<!-- 分段页签 -->
|
||||
<Border Margin="0,12,0,0" Background="White" BorderBrush="{StaticResource B.Border}" BorderThickness="1"
|
||||
CornerRadius="9" Padding="3">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<RadioButton x:Name="TabLogin" Grid.Column="0" GroupName="auth" Content="登录"
|
||||
Style="{StaticResource TabChip}" IsChecked="True" Checked="Tab_Checked" HorizontalAlignment="Stretch"/>
|
||||
<RadioButton x:Name="TabRegister" Grid.Column="1" GroupName="auth" Content="注册"
|
||||
Style="{StaticResource TabChip}" Checked="Tab_Checked" HorizontalAlignment="Stretch"/>
|
||||
<RadioButton x:Name="TabRecharge" Grid.Column="2" GroupName="auth" Content="充值"
|
||||
Style="{StaticResource TabChip}" Checked="Tab_Checked" HorizontalAlignment="Stretch"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- 充值 -->
|
||||
<StackPanel x:Name="PanelRecharge" Visibility="Collapsed" Margin="0,18,0,0">
|
||||
<TextBlock Text="充值卡密" Style="{StaticResource Dim}" Margin="0,0,0,6"/>
|
||||
<TextBox x:Name="RechargeCard" Style="{StaticResource Input}" Text="ZNTECH-DEMO-24H"/>
|
||||
<TextBlock Text="充值会在当前到期时间上顺延" Style="{StaticResource Faint}" Margin="0,8,0,0"/>
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock x:Name="Status" Text="" Style="{StaticResource Dim}" Margin="0,16,0,0" TextWrapping="Wrap" MinHeight="34"/>
|
||||
|
||||
<Button x:Name="PrimaryBtn" Content="登录" Style="{StaticResource Primary}" Height="42" Margin="0,6,0,0" Click="Primary_Click"/>
|
||||
<!-- 登录 -->
|
||||
<StackPanel x:Name="PanelLogin" Margin="0,13,0,0">
|
||||
<TextBlock Text="账号" Style="{StaticResource Dim}" FontSize="12.5" Margin="0,0,0,6"/>
|
||||
<TextBox x:Name="LoginUser" Style="{StaticResource Input}" Height="40" Text="demo"/>
|
||||
<TextBlock Text="密码" Style="{StaticResource Dim}" FontSize="12.5" Margin="0,12,0,6"/>
|
||||
<Grid>
|
||||
<PasswordBox x:Name="LoginPwd" Style="{StaticResource InputPwd}" Height="40" Password="demo123" Margin="0,0,36,0"/>
|
||||
<TextBox x:Name="LoginPwdPlain" Style="{StaticResource Input}" Height="40" Visibility="Collapsed" Margin="0,0,36,0"/>
|
||||
<Button x:Name="EyeBtn" Style="{StaticResource IconBtn}" Width="30" Height="30"
|
||||
HorizontalAlignment="Right" Margin="0,0,4,0" Click="Eye_Click">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Path Data="M 1,8 C 4,3.4 12,3.4 15,8 C 12,12.6 4,12.6 1,8 Z" Stroke="#FF8A94A3" StrokeThickness="1.2"/>
|
||||
<Ellipse Canvas.Left="6" Canvas.Top="6" Width="4" Height="4" Fill="#FF8A94A3"/>
|
||||
</Canvas>
|
||||
</Button>
|
||||
<Button x:Name="EyeOffBtn" Style="{StaticResource IconBtn}" Width="30" Height="30"
|
||||
HorizontalAlignment="Right" Margin="0,0,4,0" Click="Eye_Click" Visibility="Collapsed">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Path Data="M 1,8 C 4,3.4 12,3.4 15,8 C 12,12.6 4,12.6 1,8 Z" Stroke="#FF8A94A3" StrokeThickness="1.2"/>
|
||||
<Ellipse Canvas.Left="6" Canvas.Top="6" Width="4" Height="4" Fill="#FF8A94A3"/>
|
||||
<Path Data="M 2,14 L 14,2" Stroke="#FF8A94A3" StrokeThickness="1.2"/>
|
||||
</Canvas>
|
||||
</Button>
|
||||
</Grid>
|
||||
<Grid Margin="0,11,0,0">
|
||||
<CheckBox x:Name="Remember" Content="记住账号 / 密码" Style="{StaticResource Check}" HorizontalAlignment="Left"/>
|
||||
<Button x:Name="UnbindBtn" Content="解绑" Style="{StaticResource LinkBtn}" HorizontalAlignment="Right" Click="Unbind_Click"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Grid.Row="2" Text="本地演示授权服务 · 127.0.0.1:5210" Style="{StaticResource Faint}"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
<!-- 注册 -->
|
||||
<StackPanel x:Name="PanelRegister" Visibility="Collapsed" Margin="0,18,0,0">
|
||||
<TextBlock Text="账号" Style="{StaticResource Dim}" FontSize="12.5" Margin="0,0,0,6"/>
|
||||
<TextBox x:Name="RegUser" Style="{StaticResource Input}" Height="40"/>
|
||||
<Grid Margin="0,14,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="12"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.Column="0">
|
||||
<TextBlock Text="密码" Style="{StaticResource Dim}" FontSize="12.5" Margin="0,0,0,6"/>
|
||||
<PasswordBox x:Name="RegPwd" Style="{StaticResource InputPwd}" Height="40"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="2">
|
||||
<TextBlock Text="确认密码" Style="{StaticResource Dim}" FontSize="12.5" Margin="0,0,0,6"/>
|
||||
<PasswordBox x:Name="RegPwd2" Style="{StaticResource InputPwd}" Height="40"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<TextBlock Text="卡密" Style="{StaticResource Dim}" FontSize="12.5" Margin="0,14,0,6"/>
|
||||
<TextBox x:Name="RegCard" Style="{StaticResource Input}" Height="40" Text="ZNTECH-TRIAL-0001"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- 充值 -->
|
||||
<StackPanel x:Name="PanelRecharge" Visibility="Collapsed" Margin="0,18,0,0">
|
||||
<TextBlock Text="充值卡密" Style="{StaticResource Dim}" FontSize="12.5" Margin="0,0,0,6"/>
|
||||
<TextBox x:Name="RechargeCard" Style="{StaticResource Input}" Height="40" Text="ZNTECH-DEMO-24H"/>
|
||||
<TextBlock Text="充值会在当前到期时间上顺延" Style="{StaticResource Faint}" Margin="0,10,0,0"/>
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock x:Name="Status" Text="" FontSize="12.5"
|
||||
Margin="0,10,0,0" TextWrapping="Wrap">
|
||||
<TextBlock.Style>
|
||||
<Style TargetType="TextBlock" BasedOn="{StaticResource Dim}">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="Text" Value="">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</TextBlock.Style>
|
||||
</TextBlock>
|
||||
|
||||
<Button x:Name="PrimaryBtn" Content="登录" Style="{StaticResource Primary}" Height="44" Margin="0,10,0,0" Click="Primary_Click"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Window>
|
||||
@@ -19,7 +19,7 @@ namespace ZNTechClone
|
||||
{
|
||||
var c = cached.Value;
|
||||
LoginUser.Text = c.user;
|
||||
LoginPwd.Password = c.pwd;
|
||||
LoginPwd.Password = c.pwd; LoginPwdPlain.Text = c.pwd;
|
||||
Remember.IsChecked = true;
|
||||
}
|
||||
await CheckServerAsync();
|
||||
@@ -33,7 +33,7 @@ namespace ZNTechClone
|
||||
using var http = new System.Net.Http.HttpClient { Timeout = TimeSpan.FromSeconds(3) };
|
||||
var res = await http.GetAsync(LocalServer.Prefix + "api/health");
|
||||
Status.Text = res.IsSuccessStatusCode
|
||||
? "本地授权服务已就绪"
|
||||
? ""
|
||||
: $"授权服务异常:HTTP {(int)res.StatusCode}";
|
||||
Status.Foreground = (System.Windows.Media.Brush)FindResource("B.TextDim");
|
||||
}
|
||||
@@ -50,6 +50,36 @@ namespace ZNTechClone
|
||||
|
||||
private void Close_Click(object sender, RoutedEventArgs e) => Close();
|
||||
|
||||
private void Min_Click(object sender, RoutedEventArgs e) => WindowState = WindowState.Minimized;
|
||||
|
||||
private bool _showPwd;
|
||||
|
||||
private void Eye_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
_showPwd = !_showPwd;
|
||||
if (_showPwd)
|
||||
{
|
||||
LoginPwdPlain.Text = LoginPwd.Password;
|
||||
LoginPwdPlain.Visibility = Visibility.Visible;
|
||||
LoginPwd.Visibility = Visibility.Collapsed;
|
||||
EyeBtn.Visibility = Visibility.Collapsed;
|
||||
EyeOffBtn.Visibility = Visibility.Visible;
|
||||
LoginPwdPlain.Focus();
|
||||
LoginPwdPlain.CaretIndex = LoginPwdPlain.Text.Length;
|
||||
}
|
||||
else
|
||||
{
|
||||
LoginPwd.Password = LoginPwdPlain.Text;
|
||||
LoginPwd.Visibility = Visibility.Visible;
|
||||
LoginPwdPlain.Visibility = Visibility.Collapsed;
|
||||
EyeOffBtn.Visibility = Visibility.Collapsed;
|
||||
EyeBtn.Visibility = Visibility.Visible;
|
||||
LoginPwd.Focus();
|
||||
}
|
||||
}
|
||||
|
||||
private string CurrentPassword => _showPwd ? LoginPwdPlain.Text : LoginPwd.Password;
|
||||
|
||||
private void Tab_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (PanelLogin == null) return;
|
||||
@@ -76,13 +106,13 @@ namespace ZNTechClone
|
||||
private async System.Threading.Tasks.Task DoLoginAsync()
|
||||
{
|
||||
var user = LoginUser.Text.Trim();
|
||||
if (user.Length == 0 || LoginPwd.Password.Length == 0)
|
||||
if (user.Length == 0 || CurrentPassword.Length == 0)
|
||||
{
|
||||
Status.Text = "请输入账号和密码";
|
||||
return;
|
||||
}
|
||||
Status.Text = "正在登录…";
|
||||
var r = await AccountApi.Login(user, LoginPwd.Password, AccountApi.MachineId());
|
||||
var r = await AccountApi.Login(user, CurrentPassword, AccountApi.MachineId());
|
||||
if (!r.Ok) { Status.Text = r.Message ?? "登录失败"; return; }
|
||||
|
||||
App.Session.Username = r.Username ?? user;
|
||||
@@ -91,7 +121,7 @@ namespace ZNTechClone
|
||||
App.Session.ExpiresAt = r.ExpiresAt;
|
||||
App.Session.HoursLeft = r.HoursLeft;
|
||||
|
||||
if (Remember.IsChecked == true) CredentialStore.Save(user, LoginPwd.Password);
|
||||
if (Remember.IsChecked == true) CredentialStore.Save(user, CurrentPassword);
|
||||
else CredentialStore.Clear();
|
||||
|
||||
var main = new MainWindow();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<Window x:Class="ZNTechClone.MainWindow"
|
||||
<Window x:Class="ZNTechClone.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:shell="clr-namespace:System.Windows.Shell;assembly=PresentationFramework"
|
||||
@@ -33,7 +33,7 @@
|
||||
</Border>
|
||||
<StackPanel Margin="10,0,0,0" VerticalAlignment="Center">
|
||||
<TextBlock Text="ZNTech" FontWeight="SemiBold" FontSize="14"/>
|
||||
<TextBlock Text="v1.0.0 · 复刻版" Style="{StaticResource Faint}" FontSize="10"/>
|
||||
<TextBlock Text="v1.1.1 · 复刻版" Style="{StaticResource Faint}" FontSize="10"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
@@ -41,26 +41,26 @@
|
||||
<!-- 导航 -->
|
||||
<StackPanel Grid.Row="1" Margin="10,4,10,0">
|
||||
<RadioButton x:Name="NavHop" GroupName="nav" Style="{StaticResource Nav}" IsChecked="True" Checked="Nav_Checked" Tag="hop">
|
||||
<StackPanel Orientation="Horizontal"><TextBlock Text="连跳" Margin="0"/><TextBlock Text=" HOP" Style="{StaticResource Faint}" VerticalAlignment="Center"/></StackPanel>
|
||||
<StackPanel Orientation="Horizontal"><TextBlock Text="连跳" Margin="0"/></StackPanel>
|
||||
</RadioButton>
|
||||
<RadioButton x:Name="NavKnife" GroupName="nav" Style="{StaticResource Nav}" Checked="Nav_Checked" Tag="knife">
|
||||
<StackPanel Orientation="Horizontal"><TextBlock Text="刀喷"/><TextBlock Text=" KNIFE" Style="{StaticResource Faint}" VerticalAlignment="Center"/></StackPanel>
|
||||
<StackPanel Orientation="Horizontal"><TextBlock Text="刀喷"/></StackPanel>
|
||||
</RadioButton>
|
||||
<RadioButton x:Name="NavMap" GroupName="nav" Style="{StaticResource Nav}" Checked="Nav_Checked" Tag="map">
|
||||
<StackPanel Orientation="Horizontal"><TextBlock Text="地图"/><TextBlock Text=" MAP" Style="{StaticResource Faint}" VerticalAlignment="Center"/></StackPanel>
|
||||
<StackPanel Orientation="Horizontal"><TextBlock Text="地图"/></StackPanel>
|
||||
</RadioButton>
|
||||
<RadioButton x:Name="NavAnon" GroupName="nav" Style="{StaticResource Nav}" Checked="Nav_Checked" Tag="anon">
|
||||
<StackPanel Orientation="Horizontal"><TextBlock Text="匿名"/><TextBlock Text=" ANON" Style="{StaticResource Faint}" VerticalAlignment="Center"/></StackPanel>
|
||||
<StackPanel Orientation="Horizontal"><TextBlock Text="匿名"/></StackPanel>
|
||||
</RadioButton>
|
||||
<RadioButton x:Name="NavSkins" GroupName="nav" Style="{StaticResource Nav}" Checked="Nav_Checked" Tag="skins">
|
||||
<StackPanel Orientation="Horizontal"><TextBlock Text="换肤"/><TextBlock Text=" SKINS" Style="{StaticResource Faint}" VerticalAlignment="Center"/></StackPanel>
|
||||
<StackPanel Orientation="Horizontal"><TextBlock Text="换肤"/></StackPanel>
|
||||
</RadioButton>
|
||||
<RadioButton x:Name="NavAnnounce" GroupName="nav" Style="{StaticResource Nav}" Checked="Nav_Checked" Tag="announce">
|
||||
<StackPanel Orientation="Horizontal"><TextBlock Text="公告"/><TextBlock Text=" NOTICE" Style="{StaticResource Faint}" VerticalAlignment="Center"/></StackPanel>
|
||||
<StackPanel Orientation="Horizontal"><TextBlock Text="公告"/></StackPanel>
|
||||
</RadioButton>
|
||||
<Border Height="1" Background="{StaticResource B.BorderSoft}" Margin="8,10,8,10"/>
|
||||
<RadioButton x:Name="NavSettings" GroupName="nav" Style="{StaticResource Nav}" Checked="Nav_Checked" Tag="settings">
|
||||
<StackPanel Orientation="Horizontal"><TextBlock Text="设置"/><TextBlock Text=" SETTINGS" Style="{StaticResource Faint}" VerticalAlignment="Center"/></StackPanel>
|
||||
<StackPanel Orientation="Horizontal"><TextBlock Text="设置"/></StackPanel>
|
||||
</RadioButton>
|
||||
</StackPanel>
|
||||
|
||||
@@ -74,7 +74,8 @@
|
||||
</Border>
|
||||
<StackPanel Margin="10,0,0,0" VerticalAlignment="Center">
|
||||
<TextBlock x:Name="AccountName" Text="demo" FontWeight="SemiBold" FontSize="13"/>
|
||||
<TextBlock x:Name="AccountTime" Text="—" Style="{StaticResource Faint}" FontSize="11"/>
|
||||
<TextBlock x:Name="AccountTime" Text="—" Style="{StaticResource Faint}" FontSize="11" Margin="0,1,0,0"/>
|
||||
<TextBlock x:Name="AccountExpiry" Text="" Style="{StaticResource Faint}" FontSize="10" Margin="0,1,0,0"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<Grid Margin="0,10,0,0">
|
||||
@@ -103,7 +104,7 @@
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
|
||||
<Border x:Name="MacroBadge" CornerRadius="12" Background="#FF1E1E24" BorderBrush="{StaticResource B.Border}" BorderThickness="1" Padding="10,5" Margin="0,0,10,0">
|
||||
<Border x:Name="MacroBadge" CornerRadius="12" Background="#FFF2F5FA" BorderBrush="{StaticResource B.Border}" BorderThickness="1" Padding="10,5" Margin="0,0,10,0">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Ellipse x:Name="MacroDot" Width="7" Height="7" Fill="{StaticResource B.Danger}" VerticalAlignment="Center"/>
|
||||
<TextBlock x:Name="MacroText" Text="宏未启动" FontSize="11" Margin="7,0,0,0" Foreground="{StaticResource B.TextDim}"/>
|
||||
@@ -111,7 +112,10 @@
|
||||
</Border>
|
||||
<Button x:Name="PauseBtn" Content="暂停 F8" Style="{StaticResource Ghost}" Height="30" Padding="12,0" Margin="0,0,8,0" Click="Pause_Click"/>
|
||||
<Button Content="—" Style="{StaticResource Ghost}" Width="34" Height="30" Click="Minimize_Click"/>
|
||||
<Button Content="✕" Style="{StaticResource Ghost}" Width="34" Height="30" Margin="8,0,0,0" Click="Close_Click"/>
|
||||
<Button Style="{StaticResource Ghost}" Width="34" Height="30" Margin="8,0,0,0" Click="Close_Click">
|
||||
<Path Data="M 0,0 L 10,10 M 10,0 L 0,10" Stroke="#FF4B5563" StrokeThickness="1.4"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
@@ -122,3 +126,4 @@
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
@@ -33,7 +33,8 @@ namespace ZNTechClone
|
||||
|
||||
private void Tick()
|
||||
{
|
||||
AccountTime.Text = "剩余 " + App.Session.TimeLeftText + " · 到期 " + App.Session.ExpiresText;
|
||||
AccountTime.Text = "剩余 " + App.Session.TimeLeftText;
|
||||
AccountExpiry.Text = "到期 " + App.Session.ExpiresText;
|
||||
bool on = MacroEngine.IsRunning;
|
||||
MacroDot.Fill = (System.Windows.Media.Brush)FindResource(on ? "B.Ok" : "B.Danger");
|
||||
MacroText.Text = on ? "宏运行中" : "宏未启动";
|
||||
@@ -74,7 +75,7 @@ namespace ZNTechClone
|
||||
"anon" => ("匿名", "玩家名替换规则 · 队友视角同步"),
|
||||
"skins" => ("换肤", "皮肤包导入 · 分组启用 · 冲突检测"),
|
||||
"announce" => ("公告", "服务器公告与更新日志"),
|
||||
"settings" => ("设置", "账号 · 游戏目录 · 驱动组件"),
|
||||
"settings" => ("设置", "账号 · 游戏目录 · 安全"),
|
||||
_ => ("连跳", "一键连跳 / 二段跳 / 上坡模式")
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
@@ -262,17 +262,28 @@ namespace ZNTechClone
|
||||
var openFolder = Ui.Btn("打开皮肤目录", "Ghost", 130);
|
||||
openFolder.Click += (_, __) =>
|
||||
{
|
||||
var dir = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "ZNTechClone", "skins");
|
||||
var dir = System.IO.Path.Combine(DataRoot.Dir, "skins");
|
||||
System.IO.Directory.CreateDirectory(dir);
|
||||
Process.Start(new ProcessStartInfo("explorer.exe", dir) { UseShellExecute = true });
|
||||
};
|
||||
|
||||
var sample = Ui.Btn("导入示例皮肤包", "Ghost", 140);
|
||||
sample.Click += (_, __) =>
|
||||
{
|
||||
var zip = System.IO.Path.Combine(AppContext.BaseDirectory, "assets", "demo-skin.zip");
|
||||
if (!System.IO.File.Exists(zip)) { _status.Text = "找不到示例包:" + zip; _status.Foreground = Ui.Br("B.Danger"); return; }
|
||||
var pack = SkinStore.Import(zip, out var msg);
|
||||
_status.Text = msg;
|
||||
_status.Foreground = pack == null ? Ui.Br("B.Danger") : Ui.Br("B.Ok");
|
||||
Rebuild();
|
||||
};
|
||||
|
||||
Rebuild();
|
||||
|
||||
var root = new StackPanel();
|
||||
root.Children.Add(Ui.Section("皮肤包", "支持 pack.json 清单或按文件名识别",
|
||||
Ui.Card(
|
||||
Ui.H(10, import, openFolder),
|
||||
Ui.H(10, import, openFolder, sample),
|
||||
PageHelper.Hint("皮肤包为 zip:可包含 pack.json(id/name/category/weapon/author/version)或直接放资源文件。同一分类+武器同时只启用一个。"),
|
||||
_status
|
||||
)));
|
||||
@@ -323,6 +334,32 @@ namespace ZNTechClone
|
||||
on.Unchecked += (_, __) => { SkinStore.SetEnabled(SkinStore.Load(), id, false); Rebuild(); };
|
||||
ops.Children.Add(on);
|
||||
|
||||
var apply = Ui.Btn("应用", "Ghost", 64);
|
||||
apply.Click += (_, __) =>
|
||||
{
|
||||
var gd = AppSettings.Current.GameDir;
|
||||
if (string.IsNullOrEmpty(gd) || !System.IO.Directory.Exists(gd))
|
||||
{
|
||||
_status.Text = "请先在「设置 → 游戏」里选择游戏目录";
|
||||
_status.Foreground = Ui.Br("B.Danger");
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
var src = System.IO.Path.Combine(DataRoot.Dir, "skins", id);
|
||||
var dst = System.IO.Path.Combine(gd, "ZNTechSkins", id);
|
||||
CopyDir(src, dst);
|
||||
_status.Text = "已应用「" + p.Name + "」→ " + dst;
|
||||
_status.Foreground = Ui.Br("B.Ok");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_status.Text = "应用失败:" + ex.Message;
|
||||
_status.Foreground = Ui.Br("B.Danger");
|
||||
}
|
||||
};
|
||||
ops.Children.Add(apply);
|
||||
|
||||
var del = Ui.Btn("删除", "DangerGhost", 64);
|
||||
del.Click += (_, __) => { SkinStore.Delete(SkinStore.Load(), id); Rebuild(); };
|
||||
ops.Children.Add(del);
|
||||
@@ -332,6 +369,19 @@ namespace ZNTechClone
|
||||
_list.Children.Add(row);
|
||||
}
|
||||
}
|
||||
|
||||
private static void CopyDir(string src, string dst)
|
||||
{
|
||||
if (!System.IO.Directory.Exists(src)) throw new System.IO.DirectoryNotFoundException(src);
|
||||
System.IO.Directory.CreateDirectory(dst);
|
||||
foreach (var f in System.IO.Directory.GetFiles(src, "*", System.IO.SearchOption.AllDirectories))
|
||||
{
|
||||
var rel = System.IO.Path.GetRelativePath(src, f);
|
||||
var target = System.IO.Path.Combine(dst, rel);
|
||||
System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(target)!);
|
||||
System.IO.File.Copy(f, target, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- 公告
|
||||
@@ -384,6 +434,8 @@ namespace ZNTechClone
|
||||
// ---------------------------------------------------------------- 设置
|
||||
public class SettingsPage : UserControl
|
||||
{
|
||||
private readonly StackPanel _sessions = new();
|
||||
|
||||
public SettingsPage()
|
||||
{
|
||||
var user = new TextBlock { Text = App.Session.Username ?? "demo", FontWeight = FontWeights.SemiBold, FontSize = 15 };
|
||||
@@ -403,24 +455,37 @@ namespace ZNTechClone
|
||||
if (Window.GetWindow(this) is MainWindow mw) { mw.Close(); }
|
||||
};
|
||||
|
||||
// ---- 修改密码
|
||||
var oldPwd = Ui.InputPwd(220); oldPwd.Margin = new Thickness(0, 0, 8, 0);
|
||||
var newPwd = Ui.InputPwd(220); newPwd.Margin = new Thickness(0, 0, 8, 0);
|
||||
var newPwd2 = Ui.InputPwd(220);
|
||||
var pwdStatus = new TextBlock { Style = Ui.St("Faint"), Margin = new Thickness(0, 8, 0, 0) };
|
||||
var changePwd = Ui.Btn("修改密码", "Primary", 110);
|
||||
changePwd.Click += async (_, __) =>
|
||||
{
|
||||
if (!App.Session.IsLoggedIn) { pwdStatus.Text = "请先登录"; return; }
|
||||
if (newPwd.Password != newPwd2.Password) { pwdStatus.Text = "两次输入的新密码不一致"; return; }
|
||||
pwdStatus.Text = "正在修改…";
|
||||
var r = await AccountApi.ChangePassword(App.Session.Token, oldPwd.Password, newPwd.Password);
|
||||
pwdStatus.Text = r.Message ?? (r.Ok ? "密码已修改" : "修改失败");
|
||||
pwdStatus.Foreground = r.Ok ? Ui.Br("B.Ok") : Ui.Br("B.Danger");
|
||||
if (r.Ok) { oldPwd.Password = ""; newPwd.Password = ""; newPwd2.Password = ""; }
|
||||
};
|
||||
|
||||
// ---- 游戏目录
|
||||
var gamePath = Ui.Input("未选择游戏目录", 360);
|
||||
gamePath.IsReadOnly = true;
|
||||
gamePath.Text = AppSettings.Current.GameDir ?? "";
|
||||
var pick = Ui.Btn("选择目录", "Ghost", 100);
|
||||
pick.Click += (_, __) =>
|
||||
{
|
||||
var dlg = new OpenFolderDialog { Title = "选择游戏目录" };
|
||||
if (dlg.ShowDialog() == true) gamePath.Text = dlg.FolderName;
|
||||
};
|
||||
|
||||
var driver = new TextBlock { Text = "驱动组件:未安装", Style = Ui.St("Dim") };
|
||||
var install = Ui.Btn("安装驱动组件", "Primary", 150);
|
||||
install.Click += async (_, __) =>
|
||||
{
|
||||
driver.Text = "驱动组件:正在准备…";
|
||||
install.IsEnabled = false;
|
||||
await Task.Delay(900);
|
||||
driver.Text = "驱动组件:演示版未安装内核驱动(真实版按需下载)";
|
||||
install.IsEnabled = true;
|
||||
if (dlg.ShowDialog() == true)
|
||||
{
|
||||
gamePath.Text = dlg.FolderName;
|
||||
AppSettings.Current.GameDir = dlg.FolderName;
|
||||
AppSettings.Current.Save();
|
||||
}
|
||||
};
|
||||
|
||||
var root = new StackPanel();
|
||||
@@ -430,19 +495,63 @@ namespace ZNTechClone
|
||||
Ui.H(10, unbind, logout),
|
||||
PageHelper.Hint("解绑会扣 24 小时时长,旧会话需要重新登录才能下线。")
|
||||
)));
|
||||
root.Children.Add(Ui.Section("安全", "修改本机账号密码",
|
||||
Ui.Card(
|
||||
Ui.Row("原密码", oldPwd),
|
||||
Ui.Row("新密码", newPwd),
|
||||
Ui.Row("确认新密码", newPwd2),
|
||||
Ui.H(10, changePwd),
|
||||
pwdStatus
|
||||
)));
|
||||
root.Children.Add(Ui.Section("会话记录", "最近 20 次登录(本机)",
|
||||
Ui.Card(_sessions, Ui.H(10, MakeRefreshSessions()))));
|
||||
root.Children.Add(Ui.Section("游戏", "选择游戏安装目录,换肤与宏都依赖它",
|
||||
Ui.Card(
|
||||
Ui.Row("目录", Ui.H(8, gamePath, pick)),
|
||||
Ui.Row("驱动状态", Ui.H(10, driver, install)),
|
||||
PageHelper.Hint("演示版不会加载任何内核驱动;宏、覆盖层均运行在用户态。")
|
||||
PageHelper.Hint("换肤会复制到 <游戏目录>\\ZNTechSkins\\<id>;宏与覆盖层都在用户态运行。")
|
||||
)));
|
||||
root.Children.Add(Ui.Section("关于", null,
|
||||
Ui.Card(
|
||||
new TextBlock { Text = "ZNTechClone 1.0.0 · 本地复刻演示", FontWeight = FontWeights.SemiBold },
|
||||
new TextBlock { Text = "ZNTechClone 1.1.1 · 本地复刻演示", FontWeight = FontWeights.SemiBold },
|
||||
new TextBlock { Text = "参考原版 ZNTech V1.3 的功能与界面复刻:连跳 / 刀喷 / 地图 / 匿名 / 换肤 / 公告 + 卡密授权。", Style = Ui.St("Dim"), TextWrapping = TextWrapping.Wrap },
|
||||
new TextBlock { Text = "技术栈:.NET 8 + WPF,内置 HttpListener 本地授权服务,无第三方依赖。", Style = Ui.St("Faint"), TextWrapping = TextWrapping.Wrap }
|
||||
new TextBlock { Text = "技术栈:.NET 8 + WPF,内置 TcpListener 本地授权服务,无第三方依赖。", Style = Ui.St("Faint"), TextWrapping = TextWrapping.Wrap }
|
||||
)));
|
||||
Content = root;
|
||||
Loaded += async (_, __) => await LoadSessionsAsync();
|
||||
}
|
||||
|
||||
private Button MakeRefreshSessions()
|
||||
{
|
||||
var b = Ui.Btn("刷新", "Ghost", 80);
|
||||
b.Click += async (_, __) => await LoadSessionsAsync();
|
||||
return b;
|
||||
}
|
||||
|
||||
private async Task LoadSessionsAsync()
|
||||
{
|
||||
_sessions.Children.Clear();
|
||||
if (!App.Session.IsLoggedIn)
|
||||
{
|
||||
_sessions.Children.Add(new TextBlock { Text = "未登录", Style = Ui.St("Faint") });
|
||||
return;
|
||||
}
|
||||
var items = await AccountApi.Sessions(App.Session.Token);
|
||||
if (items.Count == 0)
|
||||
{
|
||||
_sessions.Children.Add(new TextBlock { Text = "暂无记录", Style = Ui.St("Faint") });
|
||||
return;
|
||||
}
|
||||
foreach (var s in items)
|
||||
{
|
||||
var row = new Grid { Margin = new Thickness(0, 3, 0, 3) };
|
||||
row.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });
|
||||
row.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto });
|
||||
row.Children.Add(new TextBlock { Text = s.StartedAt.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss"), Style = Ui.St("Dim") });
|
||||
var hw = new TextBlock { Text = "设备 " + (string.IsNullOrEmpty(s.Hwid) ? "—" : s.Hwid.Substring(0, Math.Min(8, s.Hwid.Length))), Style = Ui.St("Faint") };
|
||||
Grid.SetColumn(hw, 1);
|
||||
row.Children.Add(hw);
|
||||
_sessions.Children.Add(row);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
| 刀喷 KNIFE | 启用、触发键(与连跳同键时红字冲突提示)、开关热键、上坡、按住时长 30–500ms、日志 |
|
||||
| 地图 MAP | 透明覆盖层、安全区圆、路线、标记点、遮挡后仍显示、截图/录屏隐藏(`SetWindowDisplayAffinity`)、演示标记 |
|
||||
| 匿名 ANON | 名称替换规则、中文/星号/随机字母风格、长度 6–32、刷新间隔 1–3600 秒、UTF-8 字节提示、预览 |
|
||||
| 换肤 SKINS | zip 皮肤包导入(`pack.json` 清单)、分类/武器识别、同槽位冲突检测、启用开关、删除、打开目录 |
|
||||
| 换肤 SKINS | zip 皮肤包导入(`pack.json` 清单)、示例皮肤包、分类/武器识别、同槽位冲突检测、启用开关、**应用到游戏目录**、删除、打开目录 |
|
||||
| 公告 NOTICE | 从本地服务拉取公告/更新日志,置顶标记 |
|
||||
| 设置 SETTINGS | 账号信息、解绑、退出登录、游戏目录选择、驱动组件(演示占位,不落驱动)、关于 |
|
||||
| 设置 SETTINGS | 账号信息、解绑、退出登录、**修改密码**、**会话记录(最近 20 次登录)**、游戏目录选择(持久化)、关于 |
|
||||
|
||||
## 不能做什么
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
|
||||
- .NET 8 + WPF(`net8.0-windows`),**零第三方依赖**
|
||||
- 本地授权服务:`TcpListener` 上的极简 HTTP/1.1(`127.0.0.1:5210`),不用 `HttpListener`(免 URL ACL)
|
||||
- 版本:v1.1.1(移除驱动组件占位,纯用户态)
|
||||
- 单实例:端口 `5210` 已被另一个实例占用时自动复用它的服务,不重复报错
|
||||
- 存储:`accounts.json` / `remember.json` / `skins/`,数据目录优先程序目录 `data/`,其次 `%LOCALAPPDATA%\ZNTechClone`,最后 `%TEMP%\ZNTechClone`
|
||||
|
||||
## 目录
|
||||
@@ -41,7 +43,7 @@
|
||||
```
|
||||
ZNTechClone.csproj
|
||||
App.xaml(.cs) 启动本地服务、显示登录窗
|
||||
Theme.xaml 深色调色板 + 控件样式
|
||||
Theme.xaml 浅色主题(对齐原版登录页配色)+ 控件样式
|
||||
Ui.cs / Pages.cs 界面助手 + 7 个页面
|
||||
LoginWindow.xaml(.cs) 登录/注册/充值
|
||||
MainWindow.xaml(.cs) 侧栏 + 页面容器 + 账号徽章
|
||||
@@ -50,7 +52,8 @@ MapOverlayState.cs 覆盖层演示状态
|
||||
MacroEngine.cs 连跳/刀喷宏引擎(F8 急停)
|
||||
Native.cs SendInput / 置顶穿透 / 截图隐藏
|
||||
Models.cs / Services/* 授权、账号 API、皮肤库、凭据、数据目录
|
||||
shots/ 7 个页面的实机截图
|
||||
shots/ 7 个页面的实机截图(浅色主题)
|
||||
assets/demo-skin.zip 示例皮肤包(导入后可直接“应用”到游戏目录)
|
||||
```
|
||||
|
||||
## 构建运行
|
||||
@@ -95,13 +98,12 @@ zip 内建议包含 `pack.json`:
|
||||
1. **授权协议**:原版走 `ZNTech.Account.exe` 的加密协议(字符串加密 + 方法体保护 + SHA1 自校验),
|
||||
本复刻用 `127.0.0.1:5210` 上的本地 mock,语义对齐(注册/登录/充值/刷新/解绑/登出)。
|
||||
2. **前端**:原版是 WebView2 + React,本复刻用 WPF 重画,配色/间距/文案尽量贴近截图与 JS 文案。
|
||||
3. **驱动**:原版「驱动安装状态」会按需安装驱动;复刻只保留状态与演示按钮,不落任何 `.sys`。
|
||||
4. **公告/皮肤目录**:原版从服务端拉取;复刻从本地服务返回固定数据。
|
||||
3. **公告/皮肤目录**:原版从服务端拉取;复刻从本地服务返回固定数据。
|
||||
|
||||
## 用途说明
|
||||
|
||||
本项目是**互操作与界面研究**用的复刻演示:验证一个付费工具在界面上到底暴露了哪些能力、
|
||||
这些能力如果去掉服务端与驱动后还剩下什么。请只用于自己的环境与合法用途。
|
||||
这些能力如果去掉服务端后还剩下什么。请只用于自己的环境与合法用途。
|
||||
|
||||
## License
|
||||
|
||||
|
||||
@@ -150,6 +150,42 @@ namespace ZNTechClone.Services
|
||||
catch { return new List<Announcement>(); }
|
||||
}
|
||||
|
||||
public static async Task<LoginResult> ChangePassword(string token, string oldPwd, string newPwd)
|
||||
{
|
||||
try
|
||||
{
|
||||
var e = await Post("/api/account/password", new { token, oldPassword = oldPwd, newPassword = newPwd }).ConfigureAwait(false);
|
||||
return new LoginResult
|
||||
{
|
||||
Ok = e.TryGetProperty("ok", out var ok) && ok.GetBoolean(),
|
||||
Message = Str(e, "message")
|
||||
};
|
||||
}
|
||||
catch (Exception ex) { return new LoginResult { Ok = false, Message = "修改失败:" + ex.Message }; }
|
||||
}
|
||||
|
||||
public static async Task<List<SessionRecord>> Sessions(string token)
|
||||
{
|
||||
var list = new List<SessionRecord>();
|
||||
try
|
||||
{
|
||||
var e = await Post("/api/account/sessions", new { token }).ConfigureAwait(false);
|
||||
if (e.TryGetProperty("items", out var items) && items.ValueKind == JsonValueKind.Array)
|
||||
{
|
||||
foreach (var it in items.EnumerateArray())
|
||||
{
|
||||
list.Add(new SessionRecord
|
||||
{
|
||||
StartedAt = Time(it, "startedAt") ?? DateTime.UtcNow,
|
||||
Hwid = Str(it, "hwid")
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
return list;
|
||||
}
|
||||
|
||||
public static string MachineId()
|
||||
{
|
||||
string seed;
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace ZNTechClone.Services
|
||||
{
|
||||
/// <summary>本地小设置(游戏目录、界面偏好),存在数据目录下,不联网。</summary>
|
||||
public class AppSettings
|
||||
{
|
||||
public string GameDir { get; set; } = "";
|
||||
public string AvatarColor { get; set; } = "#2563EB";
|
||||
|
||||
private static AppSettings _current;
|
||||
private static string PathFile => System.IO.Path.Combine(DataRoot.Dir, "settings.json");
|
||||
private static readonly JsonSerializerOptions Opt = new()
|
||||
{
|
||||
PropertyNameCaseInsensitive = true,
|
||||
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
|
||||
WriteIndented = true
|
||||
};
|
||||
|
||||
public static AppSettings Current => _current ??= Load();
|
||||
|
||||
private static AppSettings Load()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (File.Exists(PathFile))
|
||||
{
|
||||
var s = JsonSerializer.Deserialize<AppSettings>(File.ReadAllText(PathFile, Encoding.UTF8), Opt);
|
||||
if (s != null) return s;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
return new AppSettings();
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
try
|
||||
{
|
||||
Directory.CreateDirectory(DataRoot.Dir);
|
||||
File.WriteAllText(PathFile, JsonSerializer.Serialize(this, Opt), Encoding.UTF8);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,13 @@ namespace ZNTechClone.Services
|
||||
public DateTime? SessionStarted { get; set; }
|
||||
public DateTime? LastSeen { get; set; }
|
||||
public List<string> Cards { get; set; } = new();
|
||||
public List<SessionRecord> Sessions { get; set; } = new();
|
||||
}
|
||||
|
||||
public class SessionRecord
|
||||
{
|
||||
public DateTime StartedAt { get; set; }
|
||||
public string Hwid { get; set; }
|
||||
}
|
||||
|
||||
public class CardRecord
|
||||
@@ -64,11 +71,24 @@ namespace ZNTechClone.Services
|
||||
|
||||
public string DataDir => _dir;
|
||||
|
||||
/// <summary>端口已被另一个实例占用(服务由那个实例提供)。</summary>
|
||||
public bool AlreadyRunning { get; private set; }
|
||||
|
||||
public void Start()
|
||||
{
|
||||
Load();
|
||||
_tcp = new TcpListener(IPAddress.Loopback, Port);
|
||||
_tcp.Start();
|
||||
try
|
||||
{
|
||||
_tcp.Start();
|
||||
}
|
||||
catch (System.Net.Sockets.SocketException)
|
||||
{
|
||||
// 单实例:另一个 ZNTechClone 已在提供本地授权服务,直接复用
|
||||
AlreadyRunning = true;
|
||||
_tcp = null;
|
||||
return;
|
||||
}
|
||||
_thread = new Thread(Loop) { IsBackground = true, Name = "zntech-local-auth" };
|
||||
_thread.Start();
|
||||
}
|
||||
@@ -249,6 +269,8 @@ namespace ZNTechClone.Services
|
||||
"/api/account/refresh" => Refresh(body),
|
||||
"/api/account/unbind" => Unbind(body),
|
||||
"/api/account/logout" => Logout(body),
|
||||
"/api/account/password" => ChangePassword(body),
|
||||
"/api/account/sessions" => Sessions(body),
|
||||
"/api/announcements" => Announcements(),
|
||||
"/api/skins/catalog" => Skins(),
|
||||
_ => new { ok = false, message = "not found" }
|
||||
@@ -323,6 +345,8 @@ namespace ZNTechClone.Services
|
||||
u.Token = Guid.NewGuid().ToString("N");
|
||||
u.SessionStarted = DateTime.UtcNow;
|
||||
u.LastSeen = DateTime.UtcNow;
|
||||
u.Sessions.Insert(0, new SessionRecord { StartedAt = DateTime.UtcNow, Hwid = hwid });
|
||||
if (u.Sessions.Count > 20) u.Sessions.RemoveRange(20, u.Sessions.Count - 20);
|
||||
Save();
|
||||
return new
|
||||
{
|
||||
@@ -398,6 +422,30 @@ namespace ZNTechClone.Services
|
||||
|
||||
private object Announcements() => new { ok = true, items = _db.Announcements.OrderByDescending(a => a.Pinned).ThenByDescending(a => a.PublishedAt).ToList() };
|
||||
|
||||
private object ChangePassword(string body)
|
||||
{
|
||||
var f = Parse(body);
|
||||
var u = ByToken(f);
|
||||
if (u == null) return Fail("登录已失效,请重新登录");
|
||||
var oldPwd = f.GetValueOrDefault("oldPassword") ?? "";
|
||||
var newPwd = f.GetValueOrDefault("newPassword") ?? "";
|
||||
if (Hash(oldPwd, u.Salt) != u.PwdHash) return Fail("原密码不正确");
|
||||
if (newPwd.Length < 6) return Fail("新密码至少 6 位");
|
||||
if (newPwd == oldPwd) return Fail("新密码不能与原密码相同");
|
||||
u.Salt = Rand(16);
|
||||
u.PwdHash = Hash(newPwd, u.Salt);
|
||||
Save();
|
||||
return new { ok = true, message = "密码已修改" };
|
||||
}
|
||||
|
||||
private object Sessions(string body)
|
||||
{
|
||||
var f = Parse(body);
|
||||
var u = ByToken(f);
|
||||
if (u == null) return Fail("登录已失效,请重新登录");
|
||||
return new { ok = true, items = u.Sessions ?? new List<SessionRecord>() };
|
||||
}
|
||||
|
||||
private static object Skins() => new
|
||||
{
|
||||
ok = true,
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<!-- palette -->
|
||||
<Color x:Key="C.Window">#FF161618</Color>
|
||||
<Color x:Key="C.Sidebar">#FF111113</Color>
|
||||
<Color x:Key="C.Card">#FF1F1F23</Color>
|
||||
<Color x:Key="C.CardHover">#FF25252B</Color>
|
||||
<Color x:Key="C.Border">#FF2C2C33</Color>
|
||||
<Color x:Key="C.BorderSoft">#FF232329</Color>
|
||||
<Color x:Key="C.Text">#FFF3F3F7</Color>
|
||||
<Color x:Key="C.TextDim">#FF9A9AA8</Color>
|
||||
<Color x:Key="C.TextFaint">#FF6A6A78</Color>
|
||||
<Color x:Key="C.Accent">#FF8B5CF6</Color>
|
||||
<Color x:Key="C.Accent2">#FFD946EF</Color>
|
||||
<Color x:Key="C.Ok">#FF4ADE80</Color>
|
||||
<Color x:Key="C.Warn">#FFFBBF24</Color>
|
||||
<Color x:Key="C.Danger">#FFF87171</Color>
|
||||
<!-- ===== 调色板(取自原版前端 CSS:#F3F5F8 底 + #DCEBFF 蓝) ===== -->
|
||||
<Color x:Key="C.Window">#FFF7F8FA</Color>
|
||||
<Color x:Key="C.Sidebar">#FFFFFFFF</Color>
|
||||
<Color x:Key="C.Card">#FFFFFFFF</Color>
|
||||
<Color x:Key="C.CardHover">#FFF3F6FB</Color>
|
||||
<Color x:Key="C.Border">#FFE3E7ED</Color>
|
||||
<Color x:Key="C.BorderSoft">#FFEDF0F5</Color>
|
||||
<Color x:Key="C.Text">#FF111827</Color>
|
||||
<Color x:Key="C.TextDim">#FF6B7280</Color>
|
||||
<Color x:Key="C.TextFaint">#FF9AA3AF</Color>
|
||||
<Color x:Key="C.Accent">#FF2563EB</Color>
|
||||
<Color x:Key="C.AccentSoft">#FFDCEBFF</Color>
|
||||
<Color x:Key="C.Ok">#FF059669</Color>
|
||||
<Color x:Key="C.Warn">#FFB45309</Color>
|
||||
<Color x:Key="C.Danger">#FFDC2626</Color>
|
||||
|
||||
<SolidColorBrush x:Key="B.Window" Color="{StaticResource C.Window}"/>
|
||||
<SolidColorBrush x:Key="B.Sidebar" Color="{StaticResource C.Sidebar}"/>
|
||||
@@ -32,103 +32,116 @@
|
||||
<SolidColorBrush x:Key="B.Danger" Color="{StaticResource C.Danger}"/>
|
||||
|
||||
<LinearGradientBrush x:Key="B.AccentGradient" StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#FF7C4DFF" Offset="0"/>
|
||||
<GradientStop Color="#FFE040FB" Offset="1"/>
|
||||
<GradientStop Color="#FF2F6FED" Offset="0"/>
|
||||
<GradientStop Color="#FF2563EB" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
|
||||
<FontFamily x:Key="F.Ui">Microsoft YaHei UI, Segoe UI</FontFamily>
|
||||
<FontFamily x:Key="F.Ui">Microsoft YaHei UI</FontFamily>
|
||||
|
||||
<!-- window chrome -->
|
||||
<Style x:Key="WinChrome" TargetType="Window">
|
||||
<Setter Property="Background" Value="{StaticResource B.Window}"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource B.Text}"/>
|
||||
<Setter Property="FontFamily" Value="{StaticResource F.Ui}"/>
|
||||
<Setter Property="FontSize" Value="13"/>
|
||||
<Setter Property="TextOptions.TextFormattingMode" Value="Display"/>
|
||||
<Setter Property="UseLayoutRounding" Value="True"/>
|
||||
<Setter Property="WindowStartupLocation" Value="CenterScreen"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource B.Text}"/>
|
||||
<Setter Property="Background" Value="{StaticResource B.Window}"/>
|
||||
</Style>
|
||||
|
||||
<!-- text -->
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="{StaticResource B.Text}"/>
|
||||
<Setter Property="FontFamily" Value="{StaticResource F.Ui}"/>
|
||||
<Setter Property="TextOptions.TextFormattingMode" Value="Display"/>
|
||||
</Style>
|
||||
<Style x:Key="H1" TargetType="TextBlock">
|
||||
<Setter Property="FontSize" Value="26"/>
|
||||
<Setter Property="FontFamily" Value="{StaticResource F.Ui}"/>
|
||||
<Setter Property="FontSize" Value="27"/>
|
||||
<Setter Property="FontWeight" Value="Bold"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource B.Text}"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="H2" TargetType="TextBlock">
|
||||
<Setter Property="FontSize" Value="18"/>
|
||||
<Setter Property="FontFamily" Value="{StaticResource F.Ui}"/>
|
||||
<Setter Property="FontSize" Value="16"/>
|
||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource B.Text}"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="Dim" TargetType="TextBlock">
|
||||
<Setter Property="FontFamily" Value="{StaticResource F.Ui}"/>
|
||||
<Setter Property="FontSize" Value="13"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource B.TextDim}"/>
|
||||
<Setter Property="FontSize" Value="12"/>
|
||||
</Style>
|
||||
<Style x:Key="Faint" TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="{StaticResource B.TextFaint}"/>
|
||||
<Setter Property="FontSize" Value="12"/>
|
||||
</Style>
|
||||
|
||||
<!-- card -->
|
||||
<Style x:Key="Faint" TargetType="TextBlock">
|
||||
<Setter Property="FontFamily" Value="{StaticResource F.Ui}"/>
|
||||
<Setter Property="FontSize" Value="12"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource B.TextFaint}"/>
|
||||
</Style>
|
||||
|
||||
<!-- 卡片 -->
|
||||
<Style x:Key="Card" TargetType="Border">
|
||||
<Setter Property="Background" Value="{StaticResource B.Card}"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource B.Border}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="CornerRadius" Value="12"/>
|
||||
<Setter Property="Padding" Value="16"/>
|
||||
<Setter Property="Padding" Value="18"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="CardTight" TargetType="Border" BasedOn="{StaticResource Card}">
|
||||
<Setter Property="Padding" Value="12"/>
|
||||
<Setter Property="Padding" Value="14"/>
|
||||
<Setter Property="CornerRadius" Value="10"/>
|
||||
</Style>
|
||||
|
||||
<!-- primary button -->
|
||||
<!-- 按钮 -->
|
||||
<Style x:Key="Primary" TargetType="Button">
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="Foreground" Value="#FF1E3A8A"/>
|
||||
<Setter Property="Background" Value="#FFD8E8FE"/>
|
||||
<Setter Property="FontFamily" Value="{StaticResource F.Ui}"/>
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||
<Setter Property="Height" Value="40"/>
|
||||
<Setter Property="Padding" Value="18,0"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<Setter Property="SnapsToDevicePixels" Value="True"/>
|
||||
<Setter Property="Padding" Value="16,0"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border x:Name="bd" CornerRadius="9" Background="{StaticResource B.AccentGradient}" BorderThickness="1" BorderBrush="#33FFFFFF">
|
||||
<Border x:Name="bd" Background="{TemplateBinding Background}" CornerRadius="8"
|
||||
BorderBrush="#FFC7DDF8" BorderThickness="1" SnapsToDevicePixels="True">
|
||||
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Margin="{TemplateBinding Padding}"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True"><Setter TargetName="bd" Property="Opacity" Value="0.92"/></Trigger>
|
||||
<Trigger Property="IsPressed" Value="True"><Setter TargetName="bd" Property="Opacity" Value="0.8"/></Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False"><Setter TargetName="bd" Property="Opacity" Value="0.35"/></Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="bd" Property="Background" Value="#FFC9DFFD"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter TargetName="bd" Property="Background" Value="#FFB9D6FC"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter TargetName="bd" Property="Opacity" Value="0.5"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- secondary / outline button -->
|
||||
<Style x:Key="Ghost" TargetType="Button">
|
||||
<Setter Property="Foreground" Value="{StaticResource B.Text}"/>
|
||||
<Setter Property="Foreground" Value="#FF374151"/>
|
||||
<Setter Property="Background" Value="#FFFFFFFF"/>
|
||||
<Setter Property="FontFamily" Value="{StaticResource F.Ui}"/>
|
||||
<Setter Property="FontSize" Value="13"/>
|
||||
<Setter Property="Height" Value="34"/>
|
||||
<Setter Property="Padding" Value="14,0"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<Setter Property="Padding" Value="14,0"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border x:Name="bd" CornerRadius="8" Background="#FF26262C" BorderThickness="1" BorderBrush="#FF33333C">
|
||||
<Border x:Name="bd" Background="{TemplateBinding Background}" CornerRadius="8"
|
||||
BorderBrush="{StaticResource B.Border}" BorderThickness="1" SnapsToDevicePixels="True">
|
||||
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Margin="{TemplateBinding Padding}"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True"><Setter TargetName="bd" Property="Background" Value="#FF2E2E36"/><Setter TargetName="bd" Property="BorderBrush" Value="#FF4A4A56"/></Trigger>
|
||||
<Trigger Property="IsPressed" Value="True"><Setter TargetName="bd" Property="Background" Value="#FF202026"/></Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False"><Setter TargetName="bd" Property="Opacity" Value="0.4"/></Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="bd" Property="Background" Value="#FFF2F6FC"/>
|
||||
<Setter TargetName="bd" Property="BorderBrush" Value="#FFC7D8F2"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter TargetName="bd" Property="Background" Value="#FFE8F0FD"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter TargetName="bd" Property="Opacity" Value="0.5"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
@@ -139,29 +152,26 @@
|
||||
<Setter Property="Foreground" Value="{StaticResource B.Danger}"/>
|
||||
</Style>
|
||||
|
||||
<!-- nav item -->
|
||||
<!-- 侧栏项 -->
|
||||
<Style x:Key="Nav" TargetType="RadioButton">
|
||||
<Setter Property="Foreground" Value="{StaticResource B.TextDim}"/>
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
<Setter Property="Height" Value="44"/>
|
||||
<Setter Property="Foreground" Value="#FF4B5563"/>
|
||||
<Setter Property="FontFamily" Value="{StaticResource F.Ui}"/>
|
||||
<Setter Property="FontSize" Value="13"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<Setter Property="Margin" Value="0,1"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="RadioButton">
|
||||
<Grid>
|
||||
<Border x:Name="bd" CornerRadius="9" Background="Transparent"/>
|
||||
<Border x:Name="bar" Width="3" HorizontalAlignment="Left" Margin="0,10" CornerRadius="2" Background="Transparent"/>
|
||||
<ContentPresenter VerticalAlignment="Center" Margin="16,0,12,0"/>
|
||||
</Grid>
|
||||
<Border x:Name="bd" Background="Transparent" CornerRadius="8" Padding="12,9">
|
||||
<ContentPresenter VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="bd" Property="Background" Value="#FF1B1B20"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource B.Text}"/>
|
||||
<Setter TargetName="bd" Property="Background" Value="#FFF0F4FA"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter TargetName="bd" Property="Background" Value="#FF23232B"/>
|
||||
<Setter TargetName="bar" Property="Background" Value="{StaticResource B.AccentGradient}"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource B.Text}"/>
|
||||
<Setter TargetName="bd" Property="Background" Value="#FFE8F0FE"/>
|
||||
<Setter Property="Foreground" Value="#FF1D4ED8"/>
|
||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
@@ -170,25 +180,31 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- textbox -->
|
||||
<!-- 输入框 -->
|
||||
<Style x:Key="Input" TargetType="TextBox">
|
||||
<Setter Property="Height" Value="38"/>
|
||||
<Setter Property="Padding" Value="12,0"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource B.Text}"/>
|
||||
<Setter Property="Background" Value="#FF1A1A1F"/>
|
||||
<Setter Property="BorderBrush" Value="#FF303038"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="CaretBrush" Value="{StaticResource B.Text}"/>
|
||||
<Setter Property="Background" Value="#FFFFFFFF"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource B.Border}"/>
|
||||
<Setter Property="FontFamily" Value="{StaticResource F.Ui}"/>
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
<Setter Property="CaretBrush" Value="{StaticResource B.Accent}"/>
|
||||
<Setter Property="Padding" Value="10,9"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="SelectionBrush" Value="{StaticResource B.Accent}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="TextBox">
|
||||
<Border x:Name="bd" CornerRadius="8" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
|
||||
<ScrollViewer x:Name="PART_ContentHost" Margin="{TemplateBinding Padding}" VerticalAlignment="Center"/>
|
||||
<Border x:Name="bd" Background="{TemplateBinding Background}" CornerRadius="8" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" Padding="10,0"
|
||||
SnapsToDevicePixels="True">
|
||||
<ScrollViewer x:Name="PART_ContentHost" Focusable="False"
|
||||
HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsKeyboardFocused" Value="True"><Setter TargetName="bd" Property="BorderBrush" Value="#FF7C4DFF"/></Trigger>
|
||||
<Trigger Property="IsKeyboardFocused" Value="True">
|
||||
<Setter TargetName="bd" Property="BorderBrush" Value="#FF93C5FD"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter TargetName="bd" Property="Opacity" Value="0.6"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
@@ -196,42 +212,47 @@
|
||||
</Style>
|
||||
|
||||
<Style x:Key="InputPwd" TargetType="PasswordBox">
|
||||
<Setter Property="Height" Value="38"/>
|
||||
<Setter Property="Padding" Value="12,0"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource B.Text}"/>
|
||||
<Setter Property="Background" Value="#FF1A1A1F"/>
|
||||
<Setter Property="BorderBrush" Value="#FF303038"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="CaretBrush" Value="{StaticResource B.Text}"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="Background" Value="#FFFFFFFF"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource B.Border}"/>
|
||||
<Setter Property="FontFamily" Value="{StaticResource F.Ui}"/>
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
<Setter Property="CaretBrush" Value="{StaticResource B.Accent}"/>
|
||||
<Setter Property="Padding" Value="10,9"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="PasswordBox">
|
||||
<Border x:Name="bd" CornerRadius="8" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
|
||||
<ScrollViewer x:Name="PART_ContentHost" Margin="{TemplateBinding Padding}" VerticalAlignment="Center"/>
|
||||
<Border x:Name="bd" Background="{TemplateBinding Background}" CornerRadius="8" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" Padding="10,0"
|
||||
SnapsToDevicePixels="True">
|
||||
<ScrollViewer x:Name="PART_ContentHost" Focusable="False"
|
||||
HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsKeyboardFocused" Value="True"><Setter TargetName="bd" Property="BorderBrush" Value="#FF7C4DFF"/></Trigger>
|
||||
<Trigger Property="IsKeyboardFocused" Value="True">
|
||||
<Setter TargetName="bd" Property="BorderBrush" Value="#FF93C5FD"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- toggle switch -->
|
||||
<!-- 开关 -->
|
||||
<Style x:Key="Switch" TargetType="CheckBox">
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="CheckBox">
|
||||
<Grid Width="42" Height="24">
|
||||
<Border x:Name="track" CornerRadius="12" Background="#FF3A3A44" BorderThickness="1" BorderBrush="#FF44444F"/>
|
||||
<Ellipse x:Name="knob" Width="18" Height="18" Fill="#FFF0F0F5" HorizontalAlignment="Left" Margin="3,0,0,0"/>
|
||||
</Grid>
|
||||
<Border x:Name="track" Width="42" Height="23" CornerRadius="11.5" Background="#FFD8DEE8">
|
||||
<Ellipse x:Name="knob" Width="17" Height="17" Fill="White" HorizontalAlignment="Left" Margin="3,0,0,0">
|
||||
<Ellipse.Effect>
|
||||
<DropShadowEffect BlurRadius="4" ShadowDepth="1" Opacity="0.18"/>
|
||||
</Ellipse.Effect>
|
||||
</Ellipse>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter TargetName="track" Property="Background" Value="{StaticResource B.AccentGradient}"/>
|
||||
<Setter TargetName="track" Property="BorderBrush" Value="#00000000"/>
|
||||
<Setter TargetName="track" Property="Background" Value="{StaticResource B.Accent}"/>
|
||||
<Setter TargetName="knob" Property="HorizontalAlignment" Value="Right"/>
|
||||
<Setter TargetName="knob" Property="Margin" Value="0,0,3,0"/>
|
||||
</Trigger>
|
||||
@@ -241,22 +262,27 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- 复选 -->
|
||||
<Style x:Key="Check" TargetType="CheckBox">
|
||||
<Setter Property="Foreground" Value="{StaticResource B.TextDim}"/>
|
||||
<Setter Property="Foreground" Value="#FF374151"/>
|
||||
<Setter Property="FontFamily" Value="{StaticResource F.Ui}"/>
|
||||
<Setter Property="FontSize" Value="13"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="CheckBox">
|
||||
<StackPanel Orientation="Horizontal" Background="Transparent">
|
||||
<Border x:Name="box" Width="16" Height="16" CornerRadius="4" Background="#FF1A1A1F" BorderThickness="1" BorderBrush="#FF3A3A44" VerticalAlignment="Center">
|
||||
<TextBlock x:Name="tick" Text="✓" FontSize="11" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed"/>
|
||||
<Border x:Name="box" Width="17" Height="17" CornerRadius="4" Margin="0,0,8,0"
|
||||
BorderBrush="#FFC7D0DC" BorderThickness="1" Background="White" VerticalAlignment="Center">
|
||||
<Path x:Name="tick" Data="M 3,8 L 7,12 L 13,4" Stroke="White" StrokeThickness="2"
|
||||
Visibility="Collapsed" StrokeStartLineCap="Round" StrokeEndLineCap="Round"/>
|
||||
</Border>
|
||||
<ContentPresenter Margin="8,0,0,0" VerticalAlignment="Center"/>
|
||||
<ContentPresenter VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter TargetName="box" Property="Background" Value="{StaticResource B.AccentGradient}"/>
|
||||
<Setter TargetName="box" Property="BorderBrush" Value="#00000000"/>
|
||||
<Setter TargetName="box" Property="Background" Value="{StaticResource B.Accent}"/>
|
||||
<Setter TargetName="box" Property="BorderBrush" Value="{StaticResource B.Accent}"/>
|
||||
<Setter TargetName="tick" Property="Visibility" Value="Visible"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
@@ -265,19 +291,24 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- combo -->
|
||||
<!-- 下拉 -->
|
||||
<Style x:Key="ComboItem" TargetType="ComboBoxItem">
|
||||
<Setter Property="Foreground" Value="{StaticResource B.Text}"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Padding" Value="10,7"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ComboBoxItem">
|
||||
<Border x:Name="bd" Background="Transparent" Padding="{TemplateBinding Padding}" CornerRadius="6" Margin="4,1">
|
||||
<Border x:Name="bd" Background="{TemplateBinding Background}" CornerRadius="6" Padding="{TemplateBinding Padding}">
|
||||
<ContentPresenter/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsHighlighted" Value="True"><Setter TargetName="bd" Property="Background" Value="#FF2A2A34"/></Trigger>
|
||||
<Trigger Property="IsSelected" Value="True"><Setter TargetName="bd" Property="Background" Value="{StaticResource B.AccentGradient}"/></Trigger>
|
||||
<Trigger Property="IsHighlighted" Value="True">
|
||||
<Setter TargetName="bd" Property="Background" Value="#FFEDF3FE"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter TargetName="bd" Property="Background" Value="#FFDCE9FD"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
@@ -285,12 +316,12 @@
|
||||
</Style>
|
||||
|
||||
<Style x:Key="Combo" TargetType="ComboBox">
|
||||
<Setter Property="Height" Value="36"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource B.Text}"/>
|
||||
<Setter Property="Background" Value="#FF1A1A1F"/>
|
||||
<Setter Property="BorderBrush" Value="#FF303038"/>
|
||||
<Setter Property="Padding" Value="10,0"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="Background" Value="White"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource B.Border}"/>
|
||||
<Setter Property="FontFamily" Value="{StaticResource F.Ui}"/>
|
||||
<Setter Property="FontSize" Value="13.5"/>
|
||||
<Setter Property="Height" Value="38"/>
|
||||
<Setter Property="ItemContainerStyle" Value="{StaticResource ComboItem}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
@@ -300,30 +331,33 @@
|
||||
IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<ToggleButton.Template>
|
||||
<ControlTemplate TargetType="ToggleButton">
|
||||
<Border x:Name="bd" CornerRadius="8" Background="#FF1A1A1F"
|
||||
BorderBrush="#FF303038" BorderThickness="1">
|
||||
<Border x:Name="bd" Background="White" CornerRadius="8"
|
||||
BorderBrush="{StaticResource B.Border}" BorderThickness="1">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="28"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Grid.Column="0" Margin="10,0,0,0" VerticalAlignment="Center"
|
||||
Foreground="{StaticResource B.Text}" FontSize="12"
|
||||
Text="{Binding SelectionBoxItem, RelativeSource={RelativeSource AncestorType=ComboBox}, FallbackValue=''}"
|
||||
TextTrimming="CharacterEllipsis"/>
|
||||
<Path Grid.Column="1" Data="M0,0 L4,4 8,0" Stroke="#FF9A9AA8" StrokeThickness="1.4"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
<ContentPresenter x:Name="sel" Margin="10,0,30,0" VerticalAlignment="Center"
|
||||
Content="{Binding SelectionBoxItem, RelativeSource={RelativeSource AncestorType=ComboBox}}"
|
||||
ContentTemplate="{Binding SelectionBoxItemTemplate, RelativeSource={RelativeSource AncestorType=ComboBox}}"/>
|
||||
<Path Data="M 0,0 L 5,5 L 10,0" Stroke="#FF8A94A3" StrokeThickness="1.6"
|
||||
HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,12,0"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="bd" Property="BorderBrush" Value="#FF93C5FD"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</ToggleButton.Template>
|
||||
</ToggleButton>
|
||||
<Popup x:Name="PART_Popup" AllowsTransparency="True" Placement="Bottom" Focusable="False"
|
||||
PopupAnimation="Slide" IsOpen="{TemplateBinding IsDropDownOpen}">
|
||||
<Border Background="#FF1F1F26" BorderBrush="#FF3A3A45" BorderThickness="1" CornerRadius="8"
|
||||
Margin="0,4,0,0" MinWidth="{Binding ActualWidth, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
MaxHeight="{TemplateBinding MaxDropDownHeight}">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
|
||||
<Popup Name="PART_Popup" IsOpen="{TemplateBinding IsDropDownOpen}" Placement="Bottom"
|
||||
AllowsTransparency="True" Focusable="False" PopupAnimation="Fade">
|
||||
<Border Background="White" BorderBrush="{StaticResource B.Border}" BorderThickness="1"
|
||||
CornerRadius="8" Margin="0,4,0,0" Padding="4"
|
||||
MinWidth="{Binding ActualWidth, RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect BlurRadius="14" ShadowDepth="2" Opacity="0.14"/>
|
||||
</Border.Effect>
|
||||
<ScrollViewer MaxHeight="260" VerticalScrollBarVisibility="Auto">
|
||||
<ItemsPresenter/>
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
@@ -334,31 +368,27 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- list container -->
|
||||
<Style x:Key="ListBoxDark" TargetType="ListBox">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource B.Text}"/>
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="Chip" TargetType="RadioButton">
|
||||
<Setter Property="Foreground" Value="{StaticResource B.TextDim}"/>
|
||||
<Setter Property="FontSize" Value="12"/>
|
||||
<Setter Property="Height" Value="30"/>
|
||||
<!-- 页签胶囊(登录页分段) -->
|
||||
<Style x:Key="TabChip" TargetType="RadioButton">
|
||||
<Setter Property="Foreground" Value="#FF374151"/>
|
||||
<Setter Property="FontFamily" Value="{StaticResource F.Ui}"/>
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<Setter Property="Height" Value="34"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="RadioButton">
|
||||
<Border x:Name="bd" CornerRadius="15" Background="#FF1E1E24" BorderThickness="1" BorderBrush="#FF30303A" Padding="14,0">
|
||||
<ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||
<Border x:Name="bd" Background="Transparent" CornerRadius="7">
|
||||
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True"><Setter TargetName="bd" Property="BorderBrush" Value="#FF45454F"/></Trigger>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter TargetName="bd" Property="Background" Value="#FF2A2340"/>
|
||||
<Setter TargetName="bd" Property="BorderBrush" Value="#FF7C4DFF"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource B.Text}"/>
|
||||
<Setter TargetName="bd" Property="Background" Value="#FFD9E9FE"/>
|
||||
<Setter Property="Foreground" Value="#FF1D4ED8"/>
|
||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="bd" Property="Background" Value="#FFF0F5FD"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
@@ -366,26 +396,25 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- 登录页签 -->
|
||||
<Style x:Key="TabChip" TargetType="RadioButton">
|
||||
<Setter Property="Foreground" Value="{StaticResource B.TextDim}"/>
|
||||
<Setter Property="FontSize" Value="13"/>
|
||||
<Setter Property="Height" Value="30"/>
|
||||
<!-- 筛选胶囊 -->
|
||||
<Style x:Key="Chip" TargetType="RadioButton">
|
||||
<Setter Property="Foreground" Value="#FF4B5563"/>
|
||||
<Setter Property="FontFamily" Value="{StaticResource F.Ui}"/>
|
||||
<Setter Property="FontSize" Value="12.5"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<Setter Property="Margin" Value="0,0,8,0"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="RadioButton">
|
||||
<Border x:Name="bd" CornerRadius="7" Background="Transparent" Padding="18,0">
|
||||
<ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||
<Border x:Name="bd" Background="White" BorderBrush="{StaticResource B.Border}" BorderThickness="1"
|
||||
CornerRadius="14" Padding="13,5">
|
||||
<ContentPresenter/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Foreground" Value="{StaticResource B.Text}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter TargetName="bd" Property="Background" Value="{StaticResource B.AccentGradient}"/>
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||
<Setter TargetName="bd" Property="Background" Value="#FFDCECFF"/>
|
||||
<Setter TargetName="bd" Property="BorderBrush" Value="#FF97C9FB"/>
|
||||
<Setter Property="Foreground" Value="#FF1D4ED8"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
@@ -393,9 +422,57 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- 列表 -->
|
||||
<Style x:Key="ListBoxDark" TargetType="ListBox">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
|
||||
<Setter Property="ItemContainerStyle">
|
||||
<Setter.Value>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
<Setter Property="Margin" Value="0,0,0,8"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListBoxItem">
|
||||
<ContentPresenter/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ScrollBarThin" TargetType="ScrollBar">
|
||||
<Setter Property="Width" Value="8"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ScrollBar">
|
||||
<Grid Background="Transparent">
|
||||
<Track x:Name="PART_Track" IsDirectionReversed="True" Margin="2,0">
|
||||
<Track.DecreaseRepeatButton>
|
||||
<RepeatButton Command="ScrollBar.PageUpCommand" Opacity="0" Focusable="False"/>
|
||||
</Track.DecreaseRepeatButton>
|
||||
<Track.Thumb>
|
||||
<Thumb>
|
||||
<Thumb.Template>
|
||||
<ControlTemplate TargetType="Thumb">
|
||||
<Border Background="#FFC7D0DC" CornerRadius="3"/>
|
||||
</ControlTemplate>
|
||||
</Thumb.Template>
|
||||
</Thumb>
|
||||
</Track.Thumb>
|
||||
<Track.IncreaseRepeatButton>
|
||||
<RepeatButton Command="ScrollBar.PageDownCommand" Opacity="0" Focusable="False"/>
|
||||
</Track.IncreaseRepeatButton>
|
||||
</Track>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -91,6 +91,11 @@ namespace ZNTechClone
|
||||
Style = St("Input"), Text = text, Width = width, HorizontalAlignment = HorizontalAlignment.Left
|
||||
};
|
||||
|
||||
public static PasswordBox InputPwd(double width = 200) => new()
|
||||
{
|
||||
Style = St("InputPwd"), Width = width, HorizontalAlignment = HorizontalAlignment.Left
|
||||
};
|
||||
|
||||
public static ComboBox Combo(params string[] items)
|
||||
{
|
||||
var c = new ComboBox { Style = St("Combo"), Width = 200, HorizontalAlignment = HorizontalAlignment.Left };
|
||||
@@ -112,7 +117,7 @@ namespace ZNTechClone
|
||||
{
|
||||
CornerRadius = new CornerRadius(10),
|
||||
Padding = new Thickness(10, 3, 10, 3),
|
||||
Background = new SolidColorBrush(Color.FromArgb(30, 255, 255, 255)),
|
||||
Background = (Brush)Application.Current.FindResource("B.BorderSoft"),
|
||||
Child = new TextBlock { Text = text, FontSize = 11, Foreground = Br(fg) }
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
@@ -9,9 +9,13 @@
|
||||
<AssemblyName>ZNTechClone</AssemblyName>
|
||||
<RootNamespace>ZNTechClone</RootNamespace>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
<Version>1.0.0</Version>
|
||||
<Version>1.1.1</Version>
|
||||
<Product>ZNTechClone</Product>
|
||||
<Company>local</Company>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="assets\demo-skin.zip" CopyToOutputDirectory="PreserveNewest" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
|
After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 42 KiB |