Advertisement
Guest User

WPF ComboBox XAML

a guest
Feb 24th, 2024
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 22.83 KB | None | 0 0
  1.  
  2.     <SolidColorBrush x:Key="TextBox.Static.Background" Color="#FFFFFFFF"/>
  3.  
  4.     <Style x:Key="ComboBoxEditableTextBox" TargetType="{x:Type TextBox}">
  5.         <Setter Property="OverridesDefaultStyle" Value="true"/>
  6.         <Setter Property="AllowDrop" Value="true"/>
  7.         <Setter Property="MinWidth" Value="0"/>
  8.         <Setter Property="MinHeight" Value="0"/>
  9.         <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
  10.         <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
  11.         <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
  12.         <Setter Property="Template">
  13.             <Setter.Value>
  14.                 <ControlTemplate TargetType="{x:Type TextBox}">
  15.                     <ScrollViewer x:Name="PART_ContentHost" Background="Transparent" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
  16.                 </ControlTemplate>
  17.             </Setter.Value>
  18.         </Setter>
  19.     </Style>
  20.  
  21.     <LinearGradientBrush x:Key="ComboBox.Static.Background" EndPoint="0,1" StartPoint="0,0">
  22.         <GradientStop Color="#FFF0F0F0" Offset="0.0"/>
  23.         <GradientStop Color="#FFE5E5E5" Offset="1.0"/>
  24.     </LinearGradientBrush>
  25.     <SolidColorBrush x:Key="ComboBox.Static.Border" Color="#FFACACAC"/>
  26.     <SolidColorBrush x:Key="ComboBox.Static.Glyph" Color="#FF606060"/>
  27.     <SolidColorBrush x:Key="ComboBox.Static.Editable.Background" Color="#FFFFFFFF"/>
  28.     <SolidColorBrush x:Key="ComboBox.Static.Editable.Border" Color="#FFABADB3"/>
  29.     <SolidColorBrush x:Key="ComboBox.Static.Editable.Button.Background" Color="Transparent"/>
  30.     <SolidColorBrush x:Key="ComboBox.Static.Editable.Button.Border" Color="Transparent"/>
  31.     <LinearGradientBrush x:Key="ComboBox.MouseOver.Background" EndPoint="0,1" StartPoint="0,0">
  32.         <GradientStop Color="#FFECF4FC" Offset="0.0"/>
  33.         <GradientStop Color="#FFDCECFC" Offset="1.0"/>
  34.     </LinearGradientBrush>
  35.     <SolidColorBrush x:Key="ComboBox.MouseOver.Border" Color="#FF7EB4EA"/>
  36.     <SolidColorBrush x:Key="ComboBox.MouseOver.Glyph" Color="#FF000000"/>
  37.     <SolidColorBrush x:Key="ComboBox.MouseOver.Editable.Background" Color="#FFFFFFFF"/>
  38.     <SolidColorBrush x:Key="ComboBox.MouseOver.Editable.Border" Color="#FF7EB4EA"/>
  39.     <LinearGradientBrush x:Key="ComboBox.MouseOver.Editable.Button.Background" EndPoint="0,1" StartPoint="0,0">
  40.         <GradientStop Color="#FFEBF4FC" Offset="0.0"/>
  41.         <GradientStop Color="#FFDCECFC" Offset="1.0"/>
  42.     </LinearGradientBrush>
  43.     <SolidColorBrush x:Key="ComboBox.MouseOver.Editable.Button.Border" Color="#FF7EB4EA"/>
  44.     <LinearGradientBrush x:Key="ComboBox.Pressed.Background" EndPoint="0,1" StartPoint="0,0">
  45.         <GradientStop Color="#FFDAECFC" Offset="0.0"/>
  46.         <GradientStop Color="#FFC4E0FC" Offset="1.0"/>
  47.     </LinearGradientBrush>
  48.     <SolidColorBrush x:Key="ComboBox.Pressed.Border" Color="#FF569DE5"/>
  49.     <SolidColorBrush x:Key="ComboBox.Pressed.Glyph" Color="#FF000000"/>
  50.     <SolidColorBrush x:Key="ComboBox.Pressed.Editable.Background" Color="#FFFFFFFF"/>
  51.     <SolidColorBrush x:Key="ComboBox.Pressed.Editable.Border" Color="#FF569DE5"/>
  52.     <LinearGradientBrush x:Key="ComboBox.Pressed.Editable.Button.Background" EndPoint="0,1" StartPoint="0,0">
  53.         <GradientStop Color="#FFDAEBFC" Offset="0.0"/>
  54.         <GradientStop Color="#FFC4E0FC" Offset="1.0"/>
  55.     </LinearGradientBrush>
  56.     <SolidColorBrush x:Key="ComboBox.Pressed.Editable.Button.Border" Color="#FF569DE5"/>
  57.     <SolidColorBrush x:Key="ComboBox.Disabled.Background" Color="#FFF0F0F0"/>
  58.     <SolidColorBrush x:Key="ComboBox.Disabled.Border" Color="#FFD9D9D9"/>
  59.     <SolidColorBrush x:Key="ComboBox.Disabled.Glyph" Color="#FFBFBFBF"/>
  60.     <SolidColorBrush x:Key="ComboBox.Disabled.Editable.Background" Color="#FFFFFFFF"/>
  61.     <SolidColorBrush x:Key="ComboBox.Disabled.Editable.Border" Color="#FFBFBFBF"/>
  62.     <SolidColorBrush x:Key="ComboBox.Disabled.Editable.Button.Background" Color="Transparent"/>
  63.     <SolidColorBrush x:Key="ComboBox.Disabled.Editable.Button.Border" Color="Transparent"/>
  64.  
  65.     <Style x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}">
  66.         <Setter Property="OverridesDefaultStyle" Value="true"/>
  67.         <Setter Property="IsTabStop" Value="false"/>
  68.         <Setter Property="Focusable" Value="false"/>
  69.         <Setter Property="ClickMode" Value="Press"/>
  70.         <Setter Property="Template">
  71.             <Setter.Value>
  72.                 <ControlTemplate TargetType="{x:Type ToggleButton}">
  73.                     <Border x:Name="templateRoot" Background="{DynamicResource PrimaryBrush}" BorderBrush="{StaticResource ComboBox.Static.Border}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
  74.                         <Border x:Name="splitBorder" BorderBrush="{DynamicResource SecondaryBrush}" BorderThickness="1" HorizontalAlignment="Right" Margin="0" SnapsToDevicePixels="true" Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}">
  75.                             <Path x:Name="arrow" Data="F1 M 0,0 L 2.667,2.66665 L 5.3334,0 L 5.3334,-1.78168 L 2.6667,0.88501 L0,-1.78168 L0,0 Z" Fill="{DynamicResource ForegroundBrush}" HorizontalAlignment="Center" Margin="0" VerticalAlignment="Center"/>
  76.                         </Border>
  77.                     </Border>
  78.                     <ControlTemplate.Triggers>
  79.                         <MultiDataTrigger>
  80.                             <MultiDataTrigger.Conditions>
  81.                                 <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true"/>
  82.                                 <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="false"/>
  83.                                 <Condition Binding="{Binding IsPressed, RelativeSource={RelativeSource Self}}" Value="false"/>
  84.                                 <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="true"/>
  85.                             </MultiDataTrigger.Conditions>
  86.                             <Setter Property="Background" TargetName="templateRoot" Value="{DynamicResource PrimaryBrush}"/>
  87.                             <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.Static.Editable.Border}"/>
  88.                             <Setter Property="Background" TargetName="splitBorder" Value="{DynamicResource PrimaryBrush}"/>
  89.                             <Setter Property="BorderBrush" TargetName="splitBorder" Value="{StaticResource ComboBox.Static.Editable.Button.Border}"/>
  90.                         </MultiDataTrigger>
  91.                         <Trigger Property="IsMouseOver" Value="true">
  92.                             <Setter Property="Fill" TargetName="arrow" Value="{DynamicResource ForegroundBrush}"/>
  93.                         </Trigger>
  94.                         <MultiDataTrigger>
  95.                             <MultiDataTrigger.Conditions>
  96.                                 <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
  97.                                 <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="false"/>
  98.                             </MultiDataTrigger.Conditions>
  99.                             <Setter Property="Background" TargetName="templateRoot" Value="{DynamicResource BgHighlightBrush}"/>
  100.                             <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.MouseOver.Border}"/>
  101.                         </MultiDataTrigger>
  102.                         <MultiDataTrigger>
  103.                             <MultiDataTrigger.Conditions>
  104.                                 <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
  105.                                 <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true"/>
  106.                             </MultiDataTrigger.Conditions>
  107.                             <Setter Property="Background" TargetName="templateRoot" Value="{DynamicResource BgHighlightBrush}"/>
  108.                             <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.MouseOver.Editable.Border}"/>
  109.                             <Setter Property="Background" TargetName="splitBorder" Value="{DynamicResource BgHighlightBrush}"/>
  110.                             <Setter Property="BorderBrush" TargetName="splitBorder" Value="{StaticResource ComboBox.MouseOver.Editable.Button.Border}"/>
  111.                         </MultiDataTrigger>
  112.                         <Trigger Property="IsPressed" Value="true">
  113.                             <Setter Property="Fill" TargetName="arrow" Value="{StaticResource ComboBox.Pressed.Glyph}"/>
  114.                         </Trigger>
  115.                         <MultiDataTrigger>
  116.                             <MultiDataTrigger.Conditions>
  117.                                 <Condition Binding="{Binding IsPressed, RelativeSource={RelativeSource Self}}" Value="true"/>
  118.                                 <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="false"/>
  119.                             </MultiDataTrigger.Conditions>
  120.                             <Setter Property="Background" TargetName="templateRoot" Value="{DynamicResource BgHighlightBrush}"/>
  121.                             <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.Pressed.Border}"/>
  122.                         </MultiDataTrigger>
  123.                         <MultiDataTrigger>
  124.                             <MultiDataTrigger.Conditions>
  125.                                 <Condition Binding="{Binding IsPressed, RelativeSource={RelativeSource Self}}" Value="true"/>
  126.                                 <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true"/>
  127.                             </MultiDataTrigger.Conditions>
  128.                             <Setter Property="Background" TargetName="templateRoot" Value="{DynamicResource BgHighlightBrush}"/>
  129.                             <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.Pressed.Editable.Border}"/>
  130.                             <Setter Property="Background" TargetName="splitBorder" Value="{DynamicResource BgHighlightBrush}"/>
  131.                             <Setter Property="BorderBrush" TargetName="splitBorder" Value="{StaticResource ComboBox.Pressed.Editable.Button.Border}"/>
  132.                         </MultiDataTrigger>
  133.                         <Trigger Property="IsEnabled" Value="false">
  134.                             <Setter Property="Fill" TargetName="arrow" Value="{StaticResource ComboBox.Disabled.Glyph}"/>
  135.                         </Trigger>
  136.                         <MultiDataTrigger>
  137.                             <MultiDataTrigger.Conditions>
  138.                                 <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
  139.                                 <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="false"/>
  140.                             </MultiDataTrigger.Conditions>
  141.                             <Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.Disabled.Background}"/>
  142.                             <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.Disabled.Border}"/>
  143.                         </MultiDataTrigger>
  144.                         <MultiDataTrigger>
  145.                             <MultiDataTrigger.Conditions>
  146.                                 <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
  147.                                 <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true"/>
  148.                             </MultiDataTrigger.Conditions>
  149.                             <Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.Disabled.Editable.Background}"/>
  150.                             <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.Disabled.Editable.Border}"/>
  151.                             <Setter Property="Background" TargetName="splitBorder" Value="{StaticResource ComboBox.Disabled.Editable.Button.Background}"/>
  152.                             <Setter Property="BorderBrush" TargetName="splitBorder" Value="{StaticResource ComboBox.Disabled.Editable.Button.Border}"/>
  153.                         </MultiDataTrigger>
  154.                     </ControlTemplate.Triggers>
  155.                 </ControlTemplate>
  156.             </Setter.Value>
  157.         </Setter>
  158.     </Style>
  159.  
  160.     <ControlTemplate x:Key="ComboBoxEditableTemplate" TargetType="{x:Type ComboBox}">
  161.         <Grid x:Name="templateRoot" SnapsToDevicePixels="true">
  162.             <Grid.ColumnDefinitions>
  163.                 <ColumnDefinition Width="*"/>
  164.                 <ColumnDefinition MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Width="0"/>
  165.             </Grid.ColumnDefinitions>
  166.             <Popup x:Name="PART_Popup" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}">
  167.                 <themes:SystemDropShadowChrome x:Name="shadow" Color="Transparent" MinWidth="{Binding ActualWidth, ElementName=templateRoot}" MaxHeight="{TemplateBinding MaxDropDownHeight}">
  168.                     <Border x:Name="dropDownBorder" Background="{DynamicResource  PrimaryBrush}" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1">
  169.                         <ScrollViewer x:Name="DropDownScrollViewer">
  170.                             <Grid x:Name="grid" RenderOptions.ClearTypeHint="Enabled">
  171.                                 <Canvas x:Name="canvas" HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
  172.                                     <Rectangle x:Name="opaqueRect" Fill="{Binding Background, ElementName=dropDownBorder}" Height="{Binding ActualHeight, ElementName=dropDownBorder}" Width="{Binding ActualWidth, ElementName=dropDownBorder}"/>
  173.                                 </Canvas>
  174.                                 <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
  175.                             </Grid>
  176.                         </ScrollViewer>
  177.                     </Border>
  178.                 </themes:SystemDropShadowChrome>
  179.             </Popup>
  180.             <ToggleButton x:Name="toggleButton" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ComboBoxToggleButton}"/>
  181.             <Border x:Name="border" Background="{DynamicResource PrimaryBrush}" Margin="{TemplateBinding BorderThickness}">
  182.                 <TextBox x:Name="PART_EditableTextBox" Background="{DynamicResource PrimaryBrush}" Foreground="{DynamicResource ForegroundBrush}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}" Margin="{TemplateBinding Padding}" Style="{StaticResource ComboBoxEditableTextBox}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
  183.             </Border>
  184.         </Grid>
  185.         <ControlTemplate.Triggers>
  186.             <Trigger Property="IsEnabled" Value="false">
  187.                 <Setter Property="Opacity" TargetName="border" Value="0.56"/>
  188.             </Trigger>
  189.             <Trigger Property="IsKeyboardFocusWithin" Value="true">
  190.                 <Setter Property="Foreground" Value="{DynamicResource ForegroundBrush}"/>
  191.             </Trigger>
  192.             <Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
  193.                 <Setter Property="Margin" TargetName="shadow" Value="0,0,5,5"/>
  194.                 <Setter Property="Color" TargetName="shadow" Value="#71000000"/>
  195.             </Trigger>
  196.             <Trigger Property="HasItems" Value="false">
  197.                 <Setter Property="Height" TargetName="dropDownBorder" Value="95"/>
  198.             </Trigger>
  199.             <MultiTrigger>
  200.                 <MultiTrigger.Conditions>
  201.                     <Condition Property="IsGrouping" Value="true"/>
  202.                     <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
  203.                 </MultiTrigger.Conditions>
  204.                 <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
  205.             </MultiTrigger>
  206.             <Trigger Property="ScrollViewer.CanContentScroll" SourceName="DropDownScrollViewer" Value="false">
  207.                 <Setter Property="Canvas.Top" TargetName="opaqueRect" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}"/>
  208.                 <Setter Property="Canvas.Left" TargetName="opaqueRect" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}"/>
  209.             </Trigger>
  210.         </ControlTemplate.Triggers>
  211.     </ControlTemplate>
  212.  
  213.     <ControlTemplate x:Key="ComboBoxTemplate" TargetType="{x:Type ComboBox}">
  214.         <Grid x:Name="templateRoot" SnapsToDevicePixels="true">
  215.             <Grid.ColumnDefinitions>
  216.                 <ColumnDefinition Width="*"/>
  217.                 <ColumnDefinition MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Width="0"/>
  218.             </Grid.ColumnDefinitions>
  219.             <Popup x:Name="PART_Popup" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Margin="1" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}">
  220.                 <themes:SystemDropShadowChrome x:Name="shadow" Color="Transparent" MinWidth="{Binding ActualWidth, ElementName=templateRoot}" MaxHeight="{TemplateBinding MaxDropDownHeight}">
  221.                     <Border x:Name="dropDownBorder" Background="{DynamicResource PrimaryBrush}" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1">
  222.                         <ScrollViewer x:Name="DropDownScrollViewer">
  223.                             <Grid x:Name="grid" RenderOptions.ClearTypeHint="Enabled">
  224.                                 <Canvas x:Name="canvas" HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
  225.                                     <Rectangle x:Name="opaqueRect" Fill="{Binding Background, ElementName=dropDownBorder}" Height="{Binding ActualHeight, ElementName=dropDownBorder}" Width="{Binding ActualWidth, ElementName=dropDownBorder}"/>
  226.                                 </Canvas>
  227.                                 <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
  228.                             </Grid>
  229.                         </ScrollViewer>
  230.                     </Border>
  231.                 </themes:SystemDropShadowChrome>
  232.             </Popup>
  233.             <ToggleButton x:Name="toggleButton" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ComboBoxToggleButton}"/>
  234.             <ContentPresenter x:Name="contentPresenter" ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" Content="{TemplateBinding SelectionBoxItem}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsHitTestVisible="false" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
  235.         </Grid>
  236.         <ControlTemplate.Triggers>
  237.             <Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
  238.                 <Setter Property="Margin" TargetName="shadow" Value="0,0,5,5"/>
  239.                 <Setter Property="Color" TargetName="shadow" Value="#71000000"/>
  240.             </Trigger>
  241.             <Trigger Property="HasItems" Value="false">
  242.                 <Setter Property="Height" TargetName="dropDownBorder" Value="95"/>
  243.             </Trigger>
  244.             <MultiTrigger>
  245.                 <MultiTrigger.Conditions>
  246.                     <Condition Property="IsGrouping" Value="true"/>
  247.                     <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
  248.                 </MultiTrigger.Conditions>
  249.                 <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
  250.             </MultiTrigger>
  251.             <Trigger Property="ScrollViewer.CanContentScroll" SourceName="DropDownScrollViewer" Value="false">
  252.                 <Setter Property="Canvas.Top" TargetName="opaqueRect" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}"/>
  253.                 <Setter Property="Canvas.Left" TargetName="opaqueRect" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}"/>
  254.             </Trigger>
  255.         </ControlTemplate.Triggers>
  256.     </ControlTemplate>
  257.  
  258.     <Style TargetType="{x:Type ComboBox}">
  259.         <!--<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>-->
  260.         <Setter Property="Background" Value="{DynamicResource SecondaryBrush}"/>
  261.         <Setter Property="BorderBrush" Value="{StaticResource PrimaryBrush}"/>
  262.         <Setter Property="Foreground" Value="{DynamicResource ForegroundBrush}"/>
  263.         <Setter Property="BorderThickness" Value="1"/>
  264.         <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
  265.         <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
  266.         <Setter Property="Padding" Value="6,3,5,3"/>
  267.         <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
  268.         <Setter Property="ScrollViewer.PanningMode" Value="Both"/>
  269.         <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
  270.         <Setter Property="Template" Value="{StaticResource ComboBoxTemplate}"/>
  271.         <Style.Triggers>
  272.             <Trigger Property="IsEditable" Value="true">
  273.                 <Setter Property="IsTabStop" Value="false"/>
  274.                 <Setter Property="Padding" Value="2"/>
  275.                 <Setter Property="Template" Value="{StaticResource ComboBoxEditableTemplate}"/>
  276.             </Trigger>
  277.         </Style.Triggers>
  278.     </Style>
  279.  
  280.     <Style x:Key="FocusVisual">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement