|
|
|
@ -44,105 +44,107 @@ |
|
|
|
<Setter Property="PlaceholderForeground" Value="{DynamicResource ComboBoxPlaceHolderForeground}" /> |
|
|
|
<Setter Property="Template"> |
|
|
|
<ControlTemplate> |
|
|
|
<Grid RowDefinitions="Auto, *, Auto" |
|
|
|
ColumnDefinitions="*,32"> |
|
|
|
<ContentPresenter x:Name="HeaderContentPresenter" |
|
|
|
Grid.Row="0" |
|
|
|
<DataValidationErrors> |
|
|
|
<Grid RowDefinitions="Auto, *, Auto" |
|
|
|
ColumnDefinitions="*,32"> |
|
|
|
<ContentPresenter x:Name="HeaderContentPresenter" |
|
|
|
Grid.Row="0" |
|
|
|
Grid.Column="0" |
|
|
|
Grid.ColumnSpan="2" |
|
|
|
IsVisible="False" |
|
|
|
TextBlock.FontWeight="{DynamicResource ComboBoxHeaderThemeFontWeight}" |
|
|
|
Margin="{DynamicResource ComboBoxTopHeaderMargin}" |
|
|
|
VerticalAlignment="Top" /> |
|
|
|
<Border x:Name="Background" |
|
|
|
Grid.Row="1" |
|
|
|
Grid.Column="0" |
|
|
|
Grid.ColumnSpan="2" |
|
|
|
Background="{TemplateBinding Background}" |
|
|
|
BorderBrush="{TemplateBinding BorderBrush}" |
|
|
|
BorderThickness="{TemplateBinding BorderThickness}" |
|
|
|
MinWidth="{DynamicResource ComboBoxThemeMinWidth}" /> |
|
|
|
|
|
|
|
<Border x:Name="HighlightBackground" |
|
|
|
Grid.Row="1" |
|
|
|
Grid.Column="0" |
|
|
|
Grid.ColumnSpan="2" |
|
|
|
Background="{DynamicResource ComboBoxBackgroundUnfocused}" |
|
|
|
BorderBrush="{DynamicResource ComboBoxBackgroundBorderBrushUnfocused}" |
|
|
|
BorderThickness="{TemplateBinding BorderThickness}" /> |
|
|
|
<TextBlock x:Name="PlaceholderTextBlock" |
|
|
|
Grid.Row="1" |
|
|
|
Grid.Column="0" |
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|
|
|
Margin="{TemplateBinding Padding}" |
|
|
|
Text="{TemplateBinding PlaceholderText}" |
|
|
|
Foreground="{TemplateBinding PlaceholderForeground}" |
|
|
|
IsVisible="{TemplateBinding SelectionBoxItem, Converter={x:Static ObjectConverters.IsNull}}" /> |
|
|
|
<ContentControl x:Name="ContentPresenter" |
|
|
|
Content="{TemplateBinding SelectionBoxItem}" |
|
|
|
ContentTemplate="{TemplateBinding ItemTemplate}" |
|
|
|
Grid.Row="1" |
|
|
|
Grid.Column="0" |
|
|
|
Grid.ColumnSpan="2" |
|
|
|
IsVisible="False" |
|
|
|
TextBlock.FontWeight="{DynamicResource ComboBoxHeaderThemeFontWeight}" |
|
|
|
Margin="{DynamicResource ComboBoxTopHeaderMargin}" |
|
|
|
VerticalAlignment="Top" /> |
|
|
|
<Border x:Name="Background" |
|
|
|
Grid.Row="1" |
|
|
|
Grid.Column="0" |
|
|
|
Grid.ColumnSpan="2" |
|
|
|
Background="{TemplateBinding Background}" |
|
|
|
BorderBrush="{TemplateBinding BorderBrush}" |
|
|
|
BorderThickness="{TemplateBinding BorderThickness}" |
|
|
|
MinWidth="{DynamicResource ComboBoxThemeMinWidth}" /> |
|
|
|
|
|
|
|
<Border x:Name="HighlightBackground" |
|
|
|
Grid.Row="1" |
|
|
|
Grid.Column="0" |
|
|
|
Grid.ColumnSpan="2" |
|
|
|
Background="{DynamicResource ComboBoxBackgroundUnfocused}" |
|
|
|
BorderBrush="{DynamicResource ComboBoxBackgroundBorderBrushUnfocused}" |
|
|
|
BorderThickness="{TemplateBinding BorderThickness}" /> |
|
|
|
<TextBlock x:Name="PlaceholderTextBlock" |
|
|
|
Margin="{TemplateBinding Padding}" |
|
|
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|
|
|
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" /> |
|
|
|
|
|
|
|
<Border x:Name="DropDownOverlay" |
|
|
|
Grid.Row="1" |
|
|
|
Grid.Column="1" |
|
|
|
Background="Transparent" |
|
|
|
Margin="0,1,1,1" |
|
|
|
Width="30" |
|
|
|
IsVisible="False" |
|
|
|
HorizontalAlignment="Right" /> |
|
|
|
|
|
|
|
<Viewbox UseLayoutRounding="False" |
|
|
|
MinHeight="{DynamicResource ComboBoxMinHeight}" |
|
|
|
Grid.Row="1" |
|
|
|
Grid.Column="0" |
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|
|
|
Margin="{TemplateBinding Padding}" |
|
|
|
Text="{TemplateBinding PlaceholderText}" |
|
|
|
Foreground="{TemplateBinding PlaceholderForeground}" |
|
|
|
IsVisible="{TemplateBinding SelectionBoxItem, Converter={x:Static ObjectConverters.IsNull}}" /> |
|
|
|
<ContentControl x:Name="ContentPresenter" |
|
|
|
Content="{TemplateBinding SelectionBoxItem}" |
|
|
|
ContentTemplate="{TemplateBinding ItemTemplate}" |
|
|
|
Grid.Row="1" |
|
|
|
Grid.Column="0" |
|
|
|
Margin="{TemplateBinding Padding}" |
|
|
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|
|
|
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" /> |
|
|
|
|
|
|
|
<Border x:Name="DropDownOverlay" |
|
|
|
Grid.Row="1" |
|
|
|
Grid.Column="1" |
|
|
|
Background="Transparent" |
|
|
|
Margin="0,1,1,1" |
|
|
|
Width="30" |
|
|
|
IsVisible="False" |
|
|
|
HorizontalAlignment="Right" /> |
|
|
|
|
|
|
|
<Viewbox UseLayoutRounding="False" |
|
|
|
MinHeight="{DynamicResource ComboBoxMinHeight}" |
|
|
|
Grid.Row="1" |
|
|
|
Grid.Column="1" |
|
|
|
IsHitTestVisible="False" |
|
|
|
Margin="0,0,10,0" |
|
|
|
Height="12" |
|
|
|
Width="12" |
|
|
|
HorizontalAlignment="Right" |
|
|
|
VerticalAlignment="Center"> |
|
|
|
<Panel> |
|
|
|
<Panel Height="12" |
|
|
|
Width="12" /> |
|
|
|
<Path x:Name="DropDownGlyph" |
|
|
|
Stretch="Uniform" |
|
|
|
VerticalAlignment="Center" |
|
|
|
Data="M1939 486L2029 576L1024 1581L19 576L109 486L1024 1401L1939 486Z" /> |
|
|
|
</Panel> |
|
|
|
</Viewbox> |
|
|
|
<Popup Name="PART_Popup" |
|
|
|
WindowManagerAddShadowHint="False" |
|
|
|
IsOpen="{TemplateBinding IsDropDownOpen, Mode=TwoWay}" |
|
|
|
MinWidth="{Binding Bounds.Width, RelativeSource={RelativeSource TemplatedParent}}" |
|
|
|
MaxHeight="{TemplateBinding MaxDropDownHeight}" |
|
|
|
PlacementTarget="{TemplateBinding}" |
|
|
|
IsLightDismissEnabled="True"> |
|
|
|
<Border x:Name="PopupBorder" |
|
|
|
Background="{DynamicResource ComboBoxDropDownBackground}" |
|
|
|
BorderBrush="{DynamicResource ComboBoxDropDownBorderBrush}" |
|
|
|
BorderThickness="{DynamicResource ComboBoxDropdownBorderThickness}" |
|
|
|
Margin="0,-1,0,-1" |
|
|
|
Padding="{DynamicResource ComboBoxDropdownBorderPadding}" |
|
|
|
HorizontalAlignment="Stretch" |
|
|
|
CornerRadius="{DynamicResource OverlayCornerRadius}"> |
|
|
|
<ScrollViewer HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" |
|
|
|
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"> |
|
|
|
<ItemsPresenter Name="PART_ItemsPresenter" |
|
|
|
Items="{TemplateBinding Items}" |
|
|
|
Margin="{DynamicResource ComboBoxDropdownContentMargin}" |
|
|
|
ItemsPanel="{TemplateBinding ItemsPanel}" |
|
|
|
ItemTemplate="{TemplateBinding ItemTemplate}" |
|
|
|
VirtualizationMode="{TemplateBinding VirtualizationMode}" /> |
|
|
|
</ScrollViewer> |
|
|
|
</Border> |
|
|
|
</Popup> |
|
|
|
</Grid> |
|
|
|
Grid.Column="1" |
|
|
|
IsHitTestVisible="False" |
|
|
|
Margin="0,0,10,0" |
|
|
|
Height="12" |
|
|
|
Width="12" |
|
|
|
HorizontalAlignment="Right" |
|
|
|
VerticalAlignment="Center"> |
|
|
|
<Panel> |
|
|
|
<Panel Height="12" |
|
|
|
Width="12" /> |
|
|
|
<Path x:Name="DropDownGlyph" |
|
|
|
Stretch="Uniform" |
|
|
|
VerticalAlignment="Center" |
|
|
|
Data="M1939 486L2029 576L1024 1581L19 576L109 486L1024 1401L1939 486Z" /> |
|
|
|
</Panel> |
|
|
|
</Viewbox> |
|
|
|
<Popup Name="PART_Popup" |
|
|
|
WindowManagerAddShadowHint="False" |
|
|
|
IsOpen="{TemplateBinding IsDropDownOpen, Mode=TwoWay}" |
|
|
|
MinWidth="{Binding Bounds.Width, RelativeSource={RelativeSource TemplatedParent}}" |
|
|
|
MaxHeight="{TemplateBinding MaxDropDownHeight}" |
|
|
|
PlacementTarget="Background" |
|
|
|
IsLightDismissEnabled="True"> |
|
|
|
<Border x:Name="PopupBorder" |
|
|
|
Background="{DynamicResource ComboBoxDropDownBackground}" |
|
|
|
BorderBrush="{DynamicResource ComboBoxDropDownBorderBrush}" |
|
|
|
BorderThickness="{DynamicResource ComboBoxDropdownBorderThickness}" |
|
|
|
Margin="0,-1,0,-1" |
|
|
|
Padding="{DynamicResource ComboBoxDropdownBorderPadding}" |
|
|
|
HorizontalAlignment="Stretch" |
|
|
|
CornerRadius="{DynamicResource OverlayCornerRadius}"> |
|
|
|
<ScrollViewer HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" |
|
|
|
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"> |
|
|
|
<ItemsPresenter Name="PART_ItemsPresenter" |
|
|
|
Items="{TemplateBinding Items}" |
|
|
|
Margin="{DynamicResource ComboBoxDropdownContentMargin}" |
|
|
|
ItemsPanel="{TemplateBinding ItemsPanel}" |
|
|
|
ItemTemplate="{TemplateBinding ItemTemplate}" |
|
|
|
VirtualizationMode="{TemplateBinding VirtualizationMode}" /> |
|
|
|
</ScrollViewer> |
|
|
|
</Border> |
|
|
|
</Popup> |
|
|
|
</Grid> |
|
|
|
</DataValidationErrors> |
|
|
|
</ControlTemplate> |
|
|
|
</Setter> |
|
|
|
</Style> |
|
|
|
@ -232,4 +234,9 @@ |
|
|
|
<Style Selector="ComboBox /template/ Border#HighlightBackground"> |
|
|
|
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|
|
|
</Style> |
|
|
|
|
|
|
|
<!-- Error State --> |
|
|
|
<Style Selector="ComboBox:error /template/ Border#Background"> |
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource SystemControlErrorTextForegroundBrush}"/> |
|
|
|
</Style> |
|
|
|
</Styles> |
|
|
|
|