命名优化,达芬奇字体修改工具

This commit is contained in:
GG Z
2025-10-04 08:52:23 +08:00
parent 0d0afbc78e
commit 4722a4c881
121 changed files with 1801 additions and 1368 deletions

View File

@@ -33,17 +33,17 @@ namespace NeoUITest.DataModel
if (SelectedDataGridItems != null && SelectedDataGridItems.Count > 0)
{
string names = string.Join(", ", SelectedDataGridItems.ConvertAll(item => item.Name));
System.Windows.MessageBox.Show($"Selected Items: {names}");
System.Windows.MessageBox.Show($"选中项: {names}");
}
else
{
System.Windows.MessageBox.Show("No items selected.");
System.Windows.MessageBox.Show("未选择项");
}
});
}
public ICommand ShowSelectedItemsCommand { get; }
public List<DataGridItem> SelectedDataGridItems { get; set; }
public List<DataGridItem> SelectedDataGridItems { get; set; } = new List<DataGridItem>();
public DataGridItem SelectedDataGridItem { get; set; }
public ObservableCollection<DataGridItem> DataCollection { get; set; } =

View File

@@ -1,16 +1,16 @@
<n:NeoWindow
Height="450"
Title="图标预览"
Width="820"
d:DataContext="{d:DesignInstance Type=local:IconsWindow}"
mc:Ignorable="d"
x:Class="NeoUITest.IconsWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:NeoUITest"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:n="https://github.com/ShrlAlgo/NeoUI"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
Title="图标预览"
Width="820"
Height="450"
d:DataContext="{d:DesignInstance Type=local:IconsWindow}"
mc:Ignorable="d">
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@@ -20,10 +20,10 @@
<!-- 第一行: 搜索框 -->
<Border
BorderBrush="LightGray"
BorderThickness="0,0,0,1"
Grid.Row="0"
Padding="10">
Padding="10"
BorderBrush="LightGray"
BorderThickness="0,0,0,1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
@@ -31,18 +31,18 @@
</Grid.ColumnDefinitions>
<TextBox
FontSize="14"
Grid.Column="1"
Padding="5"
Text="{Binding SearchText, UpdateSourceTrigger=PropertyChanged}"
VerticalContentAlignment="Center">
VerticalContentAlignment="Center"
FontSize="14"
Text="{Binding SearchText, UpdateSourceTrigger=PropertyChanged}">
<n:InputAssist.Suffix>
<n:IconElement
Margin="0,0,10,0"
VerticalAlignment="Center"
FontSize="18"
Foreground="Gray"
Margin="0,0,10,0"
Symbol="Search"
VerticalAlignment="Center" />
Symbol="Search" />
</n:InputAssist.Suffix>
</TextBox>
</Grid>
@@ -50,44 +50,47 @@
<!-- 第二行: 选中图标信息和复制代码 -->
<Border
BorderBrush="LightGray"
BorderThickness="0,0,0,1"
Grid.Row="1"
Padding="10">
Padding="10"
BorderBrush="LightGray"
BorderThickness="0,0,0,1">
<n:FlexibleRowPanel LayoutMode="Auto">
<TextBlock Foreground="{DynamicResource TextPrimaryBrush}"
<TextBlock
VerticalAlignment="Center"
FontWeight="Bold"
Text="选中图标:"
VerticalAlignment="Center" />
Foreground="{DynamicResource TextPrimaryBrush}"
Text="选中图标:" />
<!-- 确保绑定是 OneWay因为我们只从后台更新UI -->
<TextBox
Margin="10,0"
Padding="5"
VerticalAlignment="Center"
n:FlexibleRowPanel.IsFill="True"
FontWeight="Bold"
Foreground="{DynamicResource PrimaryNormalBrush}"
IsReadOnly="True"
Margin="10,0"
Padding="5"
Text="{Binding SelectedSymbolName, Mode=OneWay, FallbackValue='请选择一个图标...'}"
VerticalAlignment="Center"
n:FlexibleRowPanel.IsFill="True" />
Text="{Binding SelectedSymbolName, Mode=OneWay, FallbackValue='请选择一个图标...'}" />
<Button
Click="CopyCode_Click"
Content="复制代码"
Padding="10,5"
VerticalAlignment="Center" />
<n:ColorPicker
Margin="10,0,0,0"
VerticalAlignment="Center"
x:Name="ColorPicker" />
Click="CopyCode_Click"
Content="复制代码" />
<n:ColorPicker
x:Name="ColorPicker"
Margin="10,0,0,0"
VerticalAlignment="Center" />
</n:FlexibleRowPanel>
</Border>
<!-- 第三行: 图标浏览器 -->
<ListBox
Name="IconItemsControl"
Grid.Row="2"
ItemsSource="{Binding SymbolCollectionView}"
Name="IconItemsControl"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
SelectionChanged="IconItemsControl_SelectionChanged">
SelectionChanged="IconItemsControl_SelectionChanged"
VirtualizingStackPanel.IsVirtualizing="True"
VirtualizingStackPanel.VirtualizationMode="Recycling">
<ListBox.Foreground>
<SolidColorBrush Color="{Binding ElementName=ColorPicker, Path=SelectedColor}" />
</ListBox.Foreground>
@@ -105,13 +108,13 @@
Symbol="{Binding}"
ToolTip="{Binding}" />
<TextBlock
FontSize="12"
HorizontalAlignment="Center"
Margin="0,5,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="12"
Text="{Binding}"
TextWrapping="Wrap"
ToolTip="{Binding}"
VerticalAlignment="Center" />
ToolTip="{Binding}" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>

View File

@@ -84,16 +84,11 @@
</ComboBoxItem>
</ComboBox>
<ToggleButton
n:ToggleSwitchAssist.OffContent="{n:Icon Nightlight}"
n:ToggleSwitchAssist.OnContent="{n:Icon Sunny}"
Checked="ThemeToggle_OnCheckedChanged"
Style="{StaticResource NeuToggleSwitch}"
Unchecked="ThemeToggle_OnCheckedChanged">
<n:ToggleSwitchAssist.OnContent>
<n:IconElement Symbol="Sunny" />
</n:ToggleSwitchAssist.OnContent>
<n:ToggleSwitchAssist.OffContent>
<n:IconElement Symbol="Nightlight" />
</n:ToggleSwitchAssist.OffContent>
</ToggleButton>
Unchecked="ThemeToggle_OnCheckedChanged" />
</UniformGrid>
</n:NeoWindow.TitleBarRightContent>
<n:NeoWindow.Resources>
@@ -233,21 +228,30 @@
<StackPanel n:AnchorAssist.Header="通知 Toast">
<StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Notification:" VerticalAlignment="Center" Margin="5"/>
<TextBlock
Margin="5"
VerticalAlignment="Center"
Text="Notification:" />
<Button Click="LeftTopButton_Click" Content="左上" />
<Button Click="RightTopButton_Click" Content="右上" />
<Button Click="LeftBottomButton_Click" Content="左下" />
<Button Click="RightBottomButton_Click" Content="右下" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Toast:" VerticalAlignment="Center" Margin="5"/>
<TextBlock
Margin="5"
VerticalAlignment="Center"
Text="Toast:" />
<Button Click="Info_Click" Content="Info" />
<Button Click="Success_Click" Content="Success" />
<Button Click="Warning_Click" Content="Warning" />
<Button Click="Error_Click" Content="Error" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Modal:" VerticalAlignment="Center" Margin="5"/>
<TextBlock
Margin="5"
VerticalAlignment="Center"
Text="Modal:" />
<Button Click="ShowBasicModal_Click" Content="基础模态框" />
<Button Click="ShowAsyncModal_Click" Content="异步模态框" />
</StackPanel>
@@ -400,7 +404,7 @@
Content="禁用按钮"
IsEnabled="False" />
<Button Content="拟态" Style="{StaticResource NeuButtonStyle}"/>
<Button Content="拟态" Style="{StaticResource NeuButtonStyle}" />
<Button
Content="禁用拟态"
IsEnabled="False"
@@ -472,8 +476,11 @@
<RepeatButton Content="RepeatButton" IsEnabled="False" />
</UniformGrid>
<UniformGrid Rows="1">
<Button Style="{StaticResource IconButton}" n:ButtonAssist.Icon="{n:Icon SymbolValue=Add}"/>
<Button IsEnabled="False" Style="{StaticResource IconButton}" n:ButtonAssist.Icon="{n:Icon SymbolValue=Add}"/>
<Button n:ButtonAssist.Icon="{n:Icon SymbolValue=Add}" Style="{StaticResource IconButton}" />
<Button
n:ButtonAssist.Icon="{n:Icon SymbolValue=Add}"
IsEnabled="False"
Style="{StaticResource IconButton}" />
</UniformGrid>
</StackPanel>
</StackPanel>
@@ -557,14 +564,16 @@
<n:NumericBox CurValue="100" Style="{StaticResource DefaultTextBox}" />
</n:FlexibleRowPanel>
<n:FlexibleRowPanel>
<TextBox Style="{StaticResource NeuTextBox}" Margin="4"/>
<TextBox Style="{StaticResource NeuTextBox}" IsEnabled="False" Margin="4"/>
<TextBox Margin="4" Style="{StaticResource NeuTextBox}" />
<TextBox
Margin="4"
IsEnabled="False"
Style="{StaticResource NeuTextBox}" />
<RichTextBox Grid.Row="2">
<FlowDocument>
<Paragraph>
<Bold>Flow Document</Bold>
in a
<Run Foreground="{StaticResource PrimaryGradientBrush}">富文本框.</Run>
in a<Run Foreground="{StaticResource PrimaryGradientBrush}">富文本框.</Run>
</Paragraph>
</FlowDocument>
</RichTextBox>
@@ -730,27 +739,17 @@
</n:FlexibleRowPanel>
<n:FlexibleRowPanel>
<ToggleButton
n:ToggleSwitchAssist.OffContent="{n:Icon SymbolValue=ToggleOff}"
n:ToggleSwitchAssist.OnContent="{n:Icon ToggleOn}"
n:ToggleSwitchAssist.ShowText="True"
IsChecked="True"
Style="{StaticResource NeuToggleSwitch}">
<n:ToggleSwitchAssist.OnContent>
<n:IconElement Symbol="ToggleOn" />
</n:ToggleSwitchAssist.OnContent>
<n:ToggleSwitchAssist.OffContent>
<n:IconElement Symbol="ToggleOff" />
</n:ToggleSwitchAssist.OffContent>
</ToggleButton>
Style="{StaticResource NeuToggleSwitch}" />
<ToggleButton
n:ToggleSwitchAssist.OffContent="{n:Icon SymbolValue=ToggleOff}"
n:ToggleSwitchAssist.OnContent="{n:Icon ToggleOn}"
IsChecked="True"
IsEnabled="False"
Style="{StaticResource NeuToggleSwitch}">
<n:ToggleSwitchAssist.OnContent>
<n:IconElement Symbol="ToggleOn" />
</n:ToggleSwitchAssist.OnContent>
<n:ToggleSwitchAssist.OffContent>
<n:IconElement Symbol="ToggleOff" />
</n:ToggleSwitchAssist.OffContent>
</ToggleButton>
Style="{StaticResource NeuToggleSwitch}" />
<ToggleButton
n:ToggleSwitchAssist.ShowText="False"
IsChecked="False"
@@ -985,8 +984,8 @@
</Calendar.BlackoutDates>
</Calendar>
<StackPanel VerticalAlignment="Center">
<n:TimePicker Header="TimerPicker" ClockIdentifier="Clock12Hour" />
<n:TimePicker Header="TimerPicker"/>
<n:TimePicker ClockIdentifier="Clock12Hour" Header="TimerPicker" />
<n:TimePicker Header="TimerPicker" />
</StackPanel>
</n:FlexibleRowPanel>
<n:FlexibleRowPanel n:AnchorAssist.Header="颜色拾取 ColorPicker">
@@ -997,9 +996,7 @@
<n:FlexibleRowPanel n:AnchorAssist.Header="树形结构 TreeView">
<TreeView Margin="4">
<TreeViewItem Header="A123" IsExpanded="True">
<TreeViewItem
Header="B123"
IsExpanded="True">
<TreeViewItem Header="B123" IsExpanded="True">
<TreeViewItem Header="C123" />
</TreeViewItem>
<TreeViewItem Header="B456" IsEnabled="False" />
@@ -1028,7 +1025,7 @@
<StackPanel n:AnchorAssist.Header="列表框 ListBox">
<n:FlexibleRowPanel>
<ListBox Margin="4" >
<ListBox Margin="4">
<ListBoxItem>SyminOmega</ListBoxItem>
<ListBoxItem>Celeron533</ListBoxItem>
<ListBoxItem>Hello World</ListBoxItem>
@@ -1036,7 +1033,10 @@
<ListBoxItem>Item Demo</ListBoxItem>
<ListBoxItem>Item Demo</ListBoxItem>
</ListBox>
<ListBox SelectionMode="Multiple" Margin="4" Style="{StaticResource ChipListBoxStyle}">
<ListBox
Margin="4"
SelectionMode="Multiple"
Style="{StaticResource ChipListBoxStyle}">
<ListBoxItem IsSelected="True">SyminOmega</ListBoxItem>
<ListBoxItem>Celeron533</ListBoxItem>
<ListBoxItem>Hello World</ListBoxItem>
@@ -1085,10 +1085,10 @@
<sys:String>Another Tab</sys:String>
</ListBox>
<ListBox
IsEnabled="False"
HorizontalAlignment="Center"
VerticalAlignment="Center"
n:ListBoxSlideBehavior.EnableSlideAnimation="True"
IsEnabled="False"
SelectedIndex="1"
Style="{StaticResource SlideTabGroupListBoxStyle}">
<!-- 这里是你的数据项 -->
@@ -1110,10 +1110,10 @@
<ListBoxItem Content="Night" />
</ListBox>
<ListBox
IsEnabled="False"
HorizontalAlignment="Center"
VerticalAlignment="Center"
n:SelectorAssist.Orientation="Vertical"
IsEnabled="False"
SelectedIndex="1"
Style="{StaticResource TabGroupListBoxStyle}">
<ListBoxItem Content="Home" />
@@ -1121,12 +1121,12 @@
<ListBoxItem Content="Night" />
</ListBox>
<ListBox
SelectionMode="Multiple"
HorizontalAlignment="Center"
VerticalAlignment="Center"
n:ListBoxSlideBehavior.EnableSlideAnimation="True"
n:SelectorAssist.Orientation="Vertical"
SelectedIndex="0"
SelectionMode="Multiple"
Style="{StaticResource SlideTabGroupListBoxStyle}">
<!-- 这里是你的数据项 -->
<sys:String>Tab 1</sys:String>
@@ -1186,9 +1186,11 @@
<Grid>
<!-- <Separator /> -->
<DataGrid
x:Name="DataGridCheckBox"
Margin="4"
DataContext="{StaticResource Dgd}"
ItemsSource="{Binding DataCollection}" />
ItemsSource="{Binding DataCollection}"
Style="{StaticResource DataGridCheckBoxHead}" />
</Grid>
</TabItem>
@@ -1198,15 +1200,17 @@
<TabControl Style="{StaticResource FlattenTabControl}" TabStripPlacement="Top">
<TabItem Header="选项卡 1">
<StackPanel Margin="4">
<DataGrid
<n:NeuDataGrid
x:Name="NeuDG1"
Margin="4"
BindableSelectedItems="{Binding SelectedDataGridItems, Mode=TwoWay}"
DataContext="{StaticResource Dgd}"
ItemsSource="{Binding DataCollection}"
SelectedItem="{Binding SelectedDataGridItems}" />
ItemsSource="{Binding DataCollection}" />
<Button
VerticalAlignment="Center"
Command="{Binding ShowSelectedItemsCommand}"
Content="显示选中项" />
Content="显示选中项"
DataContext="{StaticResource Dgd}" />
</StackPanel>
</TabItem>
<TabItem Header="选项卡 2" />
@@ -1226,6 +1230,7 @@
<TabItem Header="禁用选项卡" IsEnabled="False" />
</TabControl>
<n:NeuDataGrid
x:Name="NeuDG2"
Margin="5"
HorizontalAlignment="Left"
d:ItemsSource="{d:SampleData ItemCount=5}"

View File

@@ -37,19 +37,17 @@ public partial class MainWindow
#region
[ObservableProperty]
private TreeNodeItem selectedItem;
public partial TreeNodeItem SelectedItem { get; set; }
[ObservableProperty]
private Area area;
public partial Area Area { get; set; }
[ObservableProperty]
public partial List<Area> SelectedListAreas { get; set; } = [];
[ObservableProperty]
private string password;
public partial string Password { get; set; }
[ObservableProperty]
private string input;
public partial string Input { get; set; }
#endregion
#region
@@ -308,7 +306,7 @@ public partial class MainWindow
}
}
private async void ShowAsyncModal_Click(object sender, RoutedEventArgs e)
private void ShowAsyncModal_Click(object sender, RoutedEventArgs e)
{
bool? result = Modal.Confirm(this, "异步对话框", "对话框将在2s后关闭",
async () =>
@@ -340,11 +338,9 @@ public partial class MainWindow
iconsWindow.ShowDialog();
}
private bool _themeAnimating;
private async void ThemeToggle_OnCheckedChanged(object sender, RoutedEventArgs e)
{
if (_themeAnimating) return;
if (sender is not ToggleButton tb) return;
var targetMode = tb.IsChecked == true ? ThemeMode.Dark : ThemeMode.Light;