2025-08-20 12:10:35 +08:00
|
|
|
<ResourceDictionary
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
2026-02-20 15:31:44 +08:00
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
2026-01-02 17:30:41 +08:00
|
|
|
xmlns:assists="clr-namespace:Melskin.Assists"
|
|
|
|
|
xmlns:controls="clr-namespace:Melskin.Controls"
|
2026-02-20 15:31:44 +08:00
|
|
|
xmlns:converters="clr-namespace:Melskin.Converters">
|
2025-09-06 00:36:23 +08:00
|
|
|
<!--<ResourceDictionary.MergedDictionaries>
|
|
|
|
|
<ResourceDictionary Source="FlattenTextBox.xaml" />
|
|
|
|
|
</ResourceDictionary.MergedDictionaries>-->
|
2025-12-23 21:35:54 +08:00
|
|
|
|
2025-09-06 00:36:23 +08:00
|
|
|
<Style TargetType="{x:Type controls:AutoComplete}">
|
2025-12-23 21:35:54 +08:00
|
|
|
<Setter Property="assists:InputAssist.PlaceholderText" Value="请输入..." />
|
2025-08-20 12:10:35 +08:00
|
|
|
<Setter Property="assists:InputAssist.Clearable" Value="True" />
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
2025-09-06 00:36:23 +08:00
|
|
|
<ControlTemplate TargetType="{x:Type controls:AutoComplete}">
|
2025-08-20 12:10:35 +08:00
|
|
|
<Grid>
|
|
|
|
|
<TextBox
|
2026-02-20 15:31:44 +08:00
|
|
|
x:Name="PART_TextBox"
|
2025-08-20 12:10:35 +08:00
|
|
|
assists:InputAssist.Clearable="{TemplateBinding assists:InputAssist.Clearable}"
|
2025-12-23 21:35:54 +08:00
|
|
|
assists:InputAssist.PlaceholderText="{TemplateBinding assists:InputAssist.PlaceholderText}"
|
2026-02-20 15:31:44 +08:00
|
|
|
Text="{Binding Text, RelativeSource={RelativeSource TemplatedParent}, UpdateSourceTrigger=PropertyChanged}" />
|
2025-08-20 12:10:35 +08:00
|
|
|
<Popup
|
2026-02-20 15:31:44 +08:00
|
|
|
x:Name="PART_Popup"
|
|
|
|
|
MinWidth="{Binding ActualWidth, ElementName=PART_TextBox}"
|
|
|
|
|
assists:BehaviorAssist.SimulateNativeBehavior="True"
|
2025-08-20 12:10:35 +08:00
|
|
|
AllowsTransparency="True"
|
|
|
|
|
IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}"
|
|
|
|
|
PlacementTarget="{Binding ElementName=PART_TextBox}"
|
|
|
|
|
PopupAnimation="Slide"
|
2026-02-20 15:31:44 +08:00
|
|
|
StaysOpen="True">
|
2025-08-20 12:10:35 +08:00
|
|
|
<Border
|
2026-02-20 15:31:44 +08:00
|
|
|
MinHeight="30"
|
|
|
|
|
Margin="0,8,0,0"
|
2025-08-20 12:10:35 +08:00
|
|
|
Background="{DynamicResource BackgroundFloatingBrush}"
|
|
|
|
|
BorderBrush="{DynamicResource BorderNormalBrush}"
|
|
|
|
|
BorderThickness="1"
|
|
|
|
|
CornerRadius="6"
|
2026-02-20 15:31:44 +08:00
|
|
|
Effect="{DynamicResource PopupShadow}">
|
2025-08-20 12:10:35 +08:00
|
|
|
<!--<Border.Effect>
|
|
|
|
|
<DropShadowEffect
|
|
|
|
|
BlurRadius="10"
|
|
|
|
|
Opacity="0.1"
|
|
|
|
|
ShadowDepth="0"
|
|
|
|
|
Color="Black" />
|
|
|
|
|
</Border.Effect>-->
|
|
|
|
|
<ListBox
|
2026-02-20 15:31:44 +08:00
|
|
|
x:Name="PART_ListBox"
|
2025-08-20 12:10:35 +08:00
|
|
|
BorderThickness="0"
|
2026-02-20 15:31:44 +08:00
|
|
|
ItemsSource="{Binding ItemsSource, RelativeSource={RelativeSource TemplatedParent}}">
|
2025-08-20 12:10:35 +08:00
|
|
|
<ListBox.ItemContainerStyle>
|
|
|
|
|
<Style TargetType="ListBoxItem">
|
|
|
|
|
<Setter Property="Padding" Value="12,5,12,5" />
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="ListBoxItem">
|
|
|
|
|
<Border
|
2026-02-20 15:31:44 +08:00
|
|
|
x:Name="Bd"
|
2026-01-02 17:30:30 +08:00
|
|
|
Padding="{TemplateBinding Padding}"
|
2026-02-20 15:31:44 +08:00
|
|
|
Background="{TemplateBinding Background}"
|
|
|
|
|
SnapsToDevicePixels="true">
|
2025-08-20 12:10:35 +08:00
|
|
|
<ContentPresenter
|
|
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
2026-02-20 15:31:44 +08:00
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
|
|
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
2025-08-20 12:10:35 +08:00
|
|
|
</Border>
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
<Trigger Property="IsMouseOver" Value="true">
|
2026-02-20 15:31:44 +08:00
|
|
|
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource ControlBackgroundHoverBrush}" />
|
2025-08-20 12:10:35 +08:00
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="IsSelected" Value="true">
|
2026-02-20 15:31:44 +08:00
|
|
|
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource ControlBackgroundSelectedBrush}" />
|
2025-08-20 12:10:35 +08:00
|
|
|
</Trigger>
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Style>
|
|
|
|
|
</ListBox.ItemContainerStyle>
|
|
|
|
|
<ListBox.ItemTemplate>
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
<ContentPresenter>
|
|
|
|
|
<ContentPresenter.Content>
|
|
|
|
|
<MultiBinding Converter="{x:Static converters:StringMatchConverter.Instance}">
|
|
|
|
|
<Binding />
|
2025-09-06 00:36:23 +08:00
|
|
|
<Binding Path="Text" RelativeSource="{RelativeSource AncestorType=controls:AutoComplete}" />
|
2025-08-20 12:10:35 +08:00
|
|
|
</MultiBinding>
|
|
|
|
|
</ContentPresenter.Content>
|
|
|
|
|
</ContentPresenter>
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
</ListBox.ItemTemplate>
|
|
|
|
|
</ListBox>
|
|
|
|
|
</Border>
|
|
|
|
|
</Popup>
|
|
|
|
|
</Grid>
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Style>
|
|
|
|
|
</ResourceDictionary>
|