整理代码
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:assists="clr-namespace:Melskin.Assists"
|
||||
xmlns:controls="clr-namespace:Melskin.Controls"
|
||||
xmlns:converters="clr-namespace:Melskin.Converters"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
xmlns:converters="clr-namespace:Melskin.Converters">
|
||||
<!--<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="FlattenTextBox.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>-->
|
||||
@@ -16,27 +16,27 @@
|
||||
<ControlTemplate TargetType="{x:Type controls:AutoComplete}">
|
||||
<Grid>
|
||||
<TextBox
|
||||
Text="{Binding Text, RelativeSource={RelativeSource TemplatedParent}, UpdateSourceTrigger=PropertyChanged}"
|
||||
x:Name="PART_TextBox"
|
||||
assists:InputAssist.Clearable="{TemplateBinding assists:InputAssist.Clearable}"
|
||||
assists:InputAssist.PlaceholderText="{TemplateBinding assists:InputAssist.PlaceholderText}"
|
||||
x:Name="PART_TextBox" />
|
||||
Text="{Binding Text, RelativeSource={RelativeSource TemplatedParent}, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<Popup
|
||||
x:Name="PART_Popup"
|
||||
MinWidth="{Binding ActualWidth, ElementName=PART_TextBox}"
|
||||
assists:BehaviorAssist.SimulateNativeBehavior="True"
|
||||
AllowsTransparency="True"
|
||||
IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
MinWidth="{Binding ActualWidth, ElementName=PART_TextBox}"
|
||||
PlacementTarget="{Binding ElementName=PART_TextBox}"
|
||||
PopupAnimation="Slide"
|
||||
StaysOpen="True"
|
||||
assists:BehaviorAssist.SimulateNativeBehavior="True"
|
||||
x:Name="PART_Popup">
|
||||
StaysOpen="True">
|
||||
<Border
|
||||
MinHeight="30"
|
||||
Margin="0,8,0,0"
|
||||
Background="{DynamicResource BackgroundFloatingBrush}"
|
||||
BorderBrush="{DynamicResource BorderNormalBrush}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="6"
|
||||
Effect="{DynamicResource PopupShadow}"
|
||||
Margin="0,8,0,0"
|
||||
MinHeight="30">
|
||||
Effect="{DynamicResource PopupShadow}">
|
||||
<!--<Border.Effect>
|
||||
<DropShadowEffect
|
||||
BlurRadius="10"
|
||||
@@ -45,9 +45,9 @@
|
||||
Color="Black" />
|
||||
</Border.Effect>-->
|
||||
<ListBox
|
||||
x:Name="PART_ListBox"
|
||||
BorderThickness="0"
|
||||
ItemsSource="{Binding ItemsSource, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
x:Name="PART_ListBox">
|
||||
ItemsSource="{Binding ItemsSource, RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="Padding" Value="12,5,12,5" />
|
||||
@@ -55,21 +55,21 @@
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListBoxItem">
|
||||
<Border
|
||||
Background="{TemplateBinding Background}"
|
||||
x:Name="Bd"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
SnapsToDevicePixels="true"
|
||||
x:Name="Bd">
|
||||
Background="{TemplateBinding Background}"
|
||||
SnapsToDevicePixels="true">
|
||||
<ContentPresenter
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="true">
|
||||
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource ControlBackgroundHoverBrush}" />
|
||||
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource ControlBackgroundHoverBrush}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsSelected" Value="true">
|
||||
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource ControlBackgroundSelectedBrush}" />
|
||||
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource ControlBackgroundSelectedBrush}" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
||||
Reference in New Issue
Block a user