|
7 | 7 | xmlns:langs="clr-namespace:HandyControl.Properties.Langs"> |
8 | 8 |
|
9 | 9 | <Style x:Key="Tag4CheckComboBoxStyle" BasedOn="{StaticResource TagBaseStyle}" TargetType="hc:Tag"> |
10 | | - <Setter Property="Margin" Value="0,3,3,0"/> |
11 | 10 | <Setter Property="Padding" Value="6,3,4,3"/> |
12 | 11 | <Setter Property="Height" Value="Auto"/> |
13 | 12 | <Setter Property="Template"> |
|
49 | 48 | <ColumnDefinition Width="30"/> |
50 | 49 | </Grid.ColumnDefinitions> |
51 | 50 | <Border Grid.ColumnSpan="2" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true"/> |
52 | | - <Path Grid.Column="1" x:Name="arrow" Data="{StaticResource DownGeometry}" Stretch="Uniform" Fill="{TemplateBinding BorderBrush}" HorizontalAlignment="Center" Margin="7" VerticalAlignment="Center"/> |
| 51 | + <Path Grid.Column="1" x:Name="arrow" Data="{StaticResource DownGeometry}" Stretch="Uniform" Fill="{TemplateBinding BorderBrush}" HorizontalAlignment="Center" Width="16" VerticalAlignment="Center"/> |
53 | 52 | <Border Margin="1" Grid.Column="0" Visibility="{Binding SelectedItem,RelativeSource={RelativeSource AncestorType=hc:CheckComboBox},Converter={StaticResource Object2VisibilityReConverter}}"> |
54 | 53 | <ContentPresenter Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> |
55 | 54 | </Border> |
|
124 | 123 | </Popup> |
125 | 124 | <ToggleButton Grid.Column="0" x:Name="toggleButton" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen,RelativeSource={RelativeSource TemplatedParent},Mode=TwoWay}" Style="{StaticResource CheckComboBoxToggleButton}"/> |
126 | 125 | <Border Grid.Column="0" Margin="-1,1"> |
127 | | - <WrapPanel Name="PART_Panel" Margin="5,0,5,3"/> |
| 126 | + <hc:UniformSpacingPanel x:Name="PART_Panel" Margin="{TemplateBinding Padding}" Spacing="4" ChildWrapping="Wrap" ItemVerticalAlignment="Center"/> |
128 | 127 | </Border> |
129 | 128 | </Grid> |
130 | 129 | <ControlTemplate.Triggers> |
|
162 | 161 | <Setter Property="Background" Value="{DynamicResource RegionBrush}"/> |
163 | 162 | <Setter Property="ItemContainerStyle" Value="{StaticResource CheckComboBoxItemBaseStyle}"/> |
164 | 163 | <Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}"/> |
| 164 | + <Setter Property="hc:TitleElement.MarginOnTheLeft" Value="0,8,6,8"/> |
165 | 165 | <Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/> |
166 | 166 | <Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/> |
167 | 167 | <Setter Property="BorderThickness" Value="1"/> |
|
171 | 171 | <Setter Property="ScrollViewer.CanContentScroll" Value="true"/> |
172 | 172 | <Setter Property="ScrollViewer.PanningMode" Value="Both"/> |
173 | 173 | <Setter Property="Stylus.IsFlicksEnabled" Value="False"/> |
174 | | - <Setter Property="Padding" Value="{StaticResource DefaultInputPadding}"/> |
| 174 | + <Setter Property="Padding" Value="6,3"/> |
175 | 175 | <Setter Property="Template" Value="{StaticResource CheckComboBoxTemplate}"/> |
176 | 176 | <Setter Property="VerticalContentAlignment" Value="Center"/> |
177 | 177 | <Setter Property="Validation.ErrorTemplate" Value="{x:Null}"/> |
|
215 | 215 | </Decorator> |
216 | 216 | </Popup> |
217 | 217 | <ToggleButton Grid.Row="1" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" Content="{Binding Path=(hc:InfoElement.Placeholder),RelativeSource={RelativeSource TemplatedParent}}" Grid.Column="0" x:Name="toggleButton" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource CheckComboBoxWatermarkToggleButton}"/> |
218 | | - <Border Grid.Row="1" Grid.Column="0" Margin="1,0"> |
219 | | - <WrapPanel Name="PART_Panel" Margin="3,1,3,4"/> |
| 218 | + <Border Grid.Row="1" Grid.Column="0" Margin="-1,1"> |
| 219 | + <hc:UniformSpacingPanel x:Name="PART_Panel" Margin="{TemplateBinding Padding}" Spacing="4" ChildWrapping="Wrap" ItemVerticalAlignment="Center"/> |
220 | 220 | </Border> |
221 | 221 | </Grid> |
222 | 222 | <ControlTemplate.Triggers> |
|
254 | 254 | <ColumnDefinition/> |
255 | 255 | <ColumnDefinition Width="30"/> |
256 | 256 | </Grid.ColumnDefinitions> |
257 | | - <DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="0,7,6,7"> |
| 257 | + <DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="{Binding Path=(hc:TitleElement.MarginOnTheLeft),RelativeSource={RelativeSource TemplatedParent}}"> |
258 | 258 | <ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/> |
259 | 259 | <TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/> |
260 | 260 | </DockPanel> |
|
282 | 282 | </Decorator> |
283 | 283 | </Popup> |
284 | 284 | <ToggleButton Grid.Column="1" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" Content="{Binding Path=(hc:InfoElement.Placeholder),RelativeSource={RelativeSource TemplatedParent}}" x:Name="toggleButton" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource CheckComboBoxWatermarkToggleButton}"/> |
285 | | - <Border Grid.Column="1" Margin="1,0"> |
286 | | - <WrapPanel Name="PART_Panel" Margin="3,1,3,4"/> |
| 285 | + <Border Grid.Column="1" Margin="-1,1"> |
| 286 | + <hc:UniformSpacingPanel x:Name="PART_Panel" Margin="{TemplateBinding Padding}" Spacing="4" ChildWrapping="Wrap" ItemVerticalAlignment="Center"/> |
287 | 287 | </Border> |
288 | 288 | </Grid> |
289 | 289 | <ControlTemplate.Triggers> |
|
374 | 374 | </Popup> |
375 | 375 | <TextBlock Grid.Column="0" Grid.ColumnSpan="2" FontSize="12" Text="{TemplateBinding ErrorStr}" Name="TextBlockError" VerticalAlignment="Bottom" Margin="9,0,0,4" Foreground="{DynamicResource DangerBrush}" Grid.Row="1"/> |
376 | 376 | <ToggleButton Grid.Row="1" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" Content="{Binding Path=(hc:InfoElement.Placeholder),RelativeSource={RelativeSource TemplatedParent}}" Grid.Column="0" x:Name="toggleButton" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource CheckComboBoxWatermarkToggleButton}"/> |
377 | | - <Border Grid.Row="1" Grid.Column="0" Margin="1,0"> |
378 | | - <WrapPanel Name="PART_Panel" Margin="3,1,3,4"/> |
| 377 | + <Border Grid.Row="1" Grid.Column="0" Margin="-1,1"> |
| 378 | + <hc:UniformSpacingPanel x:Name="PART_Panel" Margin="{TemplateBinding Padding}" Spacing="4" ChildWrapping="Wrap" ItemVerticalAlignment="Center"/> |
379 | 379 | </Border> |
380 | | - <Button Grid.Row="1" Command="interactivity:ControlCommands.Clear" Margin="0,0,26,0" Visibility="Collapsed" Name="ButtonClear" Width="16" Grid.Column="1" Style="{StaticResource ButtonIcon}" Padding="0,6" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}" Foreground="{TemplateBinding BorderBrush}"/> |
| 380 | + <Button Height="{x:Static system:Double.NaN}" Grid.Row="1" Command="interactivity:ControlCommands.Clear" Margin="0,0,26,0" Visibility="Collapsed" Name="ButtonClear" Width="16" Grid.Column="1" Style="{StaticResource ButtonIcon}" Padding="0" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}" Foreground="{TemplateBinding BorderBrush}"/> |
381 | 381 | </Grid> |
382 | 382 | <ControlTemplate.Triggers> |
383 | 383 | <Trigger Property="HasItems" Value="false"> |
|
452 | 452 | <ColumnDefinition/> |
453 | 453 | <ColumnDefinition Width="Auto" MinWidth="30"/> |
454 | 454 | </Grid.ColumnDefinitions> |
455 | | - <DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="0,7,6,7"> |
| 455 | + <DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="{Binding Path=(hc:TitleElement.MarginOnTheLeft),RelativeSource={RelativeSource TemplatedParent}}"> |
456 | 456 | <ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/> |
457 | 457 | <TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/> |
458 | 458 | </DockPanel> |
|
481 | 481 | </Popup> |
482 | 482 | <TextBlock Grid.Column="1" Grid.ColumnSpan="2" FontSize="12" Text="{TemplateBinding ErrorStr}" Name="TextBlockError" VerticalAlignment="Bottom" Margin="9,0,0,4" Foreground="{DynamicResource DangerBrush}"/> |
483 | 483 | <ToggleButton Grid.Column="1" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" Content="{Binding Path=(hc:InfoElement.Placeholder),RelativeSource={RelativeSource TemplatedParent}}" x:Name="toggleButton" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource CheckComboBoxWatermarkToggleButton}"/> |
484 | | - <Border Grid.Column="1" Margin="1,0"> |
485 | | - <WrapPanel Name="PART_Panel" Margin="3,1,3,4"/> |
| 484 | + <Border Grid.Column="1" Margin="-1,1"> |
| 485 | + <hc:UniformSpacingPanel x:Name="PART_Panel" Margin="{TemplateBinding Padding}" Spacing="4" ChildWrapping="Wrap" ItemVerticalAlignment="Center"/> |
486 | 486 | </Border> |
487 | | - <Button Command="interactivity:ControlCommands.Clear" Margin="0,0,26,0" Visibility="Collapsed" Name="ButtonClear" Width="16" Grid.Column="2" Style="{StaticResource ButtonIcon}" Padding="0,6" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}" Foreground="{TemplateBinding BorderBrush}"/> |
| 487 | + <Button Height="{x:Static system:Double.NaN}" Command="interactivity:ControlCommands.Clear" Margin="0,0,26,0" Visibility="Collapsed" Name="ButtonClear" Width="16" Grid.Column="2" Style="{StaticResource ButtonIcon}" Padding="0" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}" Foreground="{TemplateBinding BorderBrush}"/> |
488 | 488 | </Grid> |
489 | 489 | <ControlTemplate.Triggers> |
490 | 490 | <Trigger Property="HasItems" Value="false"> |
|
0 commit comments