This commit is contained in:
ShrlAlgo
2025-08-20 12:10:35 +08:00
parent fcd306b0f7
commit 955a01f564
962 changed files with 7893 additions and 127784 deletions

View File

@@ -1,11 +1,11 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:assists="clr-namespace:NeumUI.Assists"
xmlns:conv="clr-namespace:NeumUI.Converters"
xmlns:local="clr-namespace:NeumUI.Controls"
xmlns:assists="clr-namespace:NeoUI.Assists"
xmlns:controls="clr-namespace:NeoUI.Controls"
xmlns:conv="clr-namespace:NeoUI.Converters"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/NeumUI;component/Controls/ComboBoxStyle.xaml" />
<ResourceDictionary Source="/NeoUI;component/Controls/ComboBoxStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style TargetType="{x:Type ListBoxItem}" x:Key="NeuComboBoxItemStyle">
<Setter Property="SnapsToDevicePixels" Value="True" />
@@ -24,7 +24,7 @@
<Grid>
<ContentPresenter HorizontalAlignment="Left" VerticalAlignment="Center" />
<local:SymbolIcon
<controls:IconElement
FontWeight="Bold"
Foreground="{DynamicResource PrimaryNormalBrush}"
HorizontalAlignment="Right"
@@ -48,7 +48,7 @@
</Setter>
</Style>
<Style TargetType="{x:Type local:NeuComboBox}">
<Style TargetType="{x:Type controls:NeuComboBox}">
<!--<Setter Property="Background" Value="{DynamicResource BackgroundContainerBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource BorderNormalBrush}" />-->
<Setter Property="BorderThickness" Value="1" />
@@ -68,7 +68,7 @@
<Setter Property="Stylus.IsFlicksEnabled" Value="False" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:NeuComboBox}">
<ControlTemplate TargetType="{x:Type controls:NeuComboBox}">
<Grid>
<ToggleButton
Background="{TemplateBinding Background}"
@@ -93,21 +93,19 @@
<Setter Property="BorderBrush" TargetName="Border" Value="{DynamicResource ControlBackgroundHoverBrush}" />
</Trigger>
<Trigger Property="IsChecked" Value="True">
<Setter Property="BorderBrush" TargetName="Border" Value="{DynamicResource FocusBorderBrush}" />
<Setter Property="BorderBrush" TargetName="Border" Value="{DynamicResource AdditionalBlueColor}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</ToggleButton.Template>-->
</ToggleButton>
<!-- TODO 待处理因为箭头是否需要旋转的原因暂时保留templateRoot -->
<Grid x:Name="templateRoot">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid
ClipToBounds="True"
Grid.Column="0"
Margin="5,1,2,1">
<Grid ClipToBounds="True" Grid.Column="0">
<Grid VerticalAlignment="Center">
<!-- 占位符 水印 -->
@@ -115,7 +113,7 @@
Foreground="{DynamicResource TextSecondaryBrush}"
IsHitTestVisible="False"
Margin="{TemplateBinding Padding}"
Text="{Binding PlaceHolderText, RelativeSource={RelativeSource AncestorType=local:NeuComboBox}}"
Text="{Binding PlaceHolder, RelativeSource={RelativeSource AncestorType=controls:NeuComboBox}}"
VerticalAlignment="Center"
x:Name="PlaceholderTextBlock">
<TextBlock.Style>
@@ -125,7 +123,7 @@
<!-- 多选:无标签 -->
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding SelectionMode, RelativeSource={RelativeSource AncestorType=local:NeuComboBox}}" Value="{x:Static SelectionMode.Multiple}" />
<Condition Binding="{Binding SelectionMode, RelativeSource={RelativeSource AncestorType=controls:NeuComboBox}}" Value="{x:Static SelectionMode.Multiple}" />
<Condition Binding="{Binding HasItems, ElementName=TagItemsControl}" Value="False" />
<!--<Condition Binding="{Binding SelectedItems.Count, RelativeSource={RelativeSource AncestorType=local:NeuComboBox}, TargetNullValue=0}" Value="0" />-->
</MultiDataTrigger.Conditions>
@@ -134,8 +132,8 @@
<!-- 单选:未选 -->
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding SelectionMode, RelativeSource={RelativeSource AncestorType=local:NeuComboBox}}" Value="{x:Static SelectionMode.Single}" />
<Condition Binding="{Binding SelectedItem, RelativeSource={RelativeSource AncestorType=local:NeuComboBox}}" Value="{x:Null}" />
<Condition Binding="{Binding SelectionMode, RelativeSource={RelativeSource AncestorType=controls:NeuComboBox}}" Value="{x:Static SelectionMode.Single}" />
<Condition Binding="{Binding SelectedItem, RelativeSource={RelativeSource AncestorType=controls:NeuComboBox}}" Value="{x:Null}" />
</MultiDataTrigger.Conditions>
<Setter Property="Visibility" Value="Visible" />
</MultiDataTrigger>
@@ -151,7 +149,7 @@
<Style TargetType="ItemsControl">
<Setter Property="Visibility" Value="Collapsed" />
<Style.Triggers>
<DataTrigger Binding="{Binding SelectionMode, RelativeSource={RelativeSource AncestorType=local:NeuComboBox}}" Value="{x:Static SelectionMode.Multiple}">
<DataTrigger Binding="{Binding SelectionMode, RelativeSource={RelativeSource AncestorType=controls:NeuComboBox}}" Value="{x:Static SelectionMode.Multiple}">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
</Style.Triggers>
@@ -172,7 +170,7 @@
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<local:Tag
<controls:Tag
Closable="True"
Content="{Binding}"
Margin="2,2,4,2" />
@@ -180,17 +178,17 @@
</ItemsControl.ItemTemplate>
</ItemsControl>
<ContentPresenter
Content="{Binding SelectedItem, RelativeSource={RelativeSource AncestorType=local:NeuComboBox}}"
Content="{Binding SelectedItem, RelativeSource={RelativeSource AncestorType=controls:NeuComboBox}}"
ContentStringFormat="{Binding DisplayMemberPath, RelativeSource={RelativeSource TemplatedParent}}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
IsHitTestVisible="False"
Margin="{TemplateBinding Padding}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Visibility="{Binding SelectionMode, RelativeSource={RelativeSource AncestorType=local:NeuComboBox}, Converter={x:Static conv:IsEqualToVisibilityConverter.Instance}, ConverterParameter={x:Static SelectionMode.Single}}" />
Visibility="{Binding SelectionMode, RelativeSource={RelativeSource AncestorType=controls:NeuComboBox}, Converter={x:Static conv:ComparisionToVisibilityConverter.Instance}, ConverterParameter={x:Static SelectionMode.Single}}" />
</Grid>
</Grid>
<!-- 下拉箭头 -->
<!--<local:SymbolIcon
<!--<local:IconElement
x:Name="Arrow"
Grid.Column="1"
Margin="0,0,8,0"
@@ -199,10 +197,10 @@
Foreground="{DynamicResource TextSecondaryBrush}"
RenderTransformOrigin="0.5,0.5"
Symbol="KeyboardArrowUp">
<local:SymbolIcon.RenderTransform>
<local:IconElement.RenderTransform>
<RotateTransform x:Name="ArrowRotateTransform" CenterX="0.5" CenterY="0.5" />
</local:SymbolIcon.RenderTransform>
</local:SymbolIcon>-->
</local:IconElement.RenderTransform>
</local:IconElement>-->
<!--#region 无用代码-->
<!--<Path
x:Name="Arrow"