Question

I tried to set color to the border of xctk:IntegerUpDown control with the following code.

<Style TargetType="{x:Type xctk:IntegerUpDown}" >
    <Setter Property="Background" Value="{StaticResource WindowBrush}" />
    <Setter Property="Foreground" Value="{StaticResource TextBrush}" />
    <Setter Property="BorderBrush" Value="Green"/>
    <Setter Property="BorderThickness" Value="5"/>
</Style>

The BorderThickness shows correctly but the border color does not show as specified. I must have missed something. Can anyone help?

Thanks,

Was it helpful?

Solution

Probably you use version below 2.0.0. This problem was solved with version 2.0.0.

Version 2.0.0 you can download here.

Below is code snippet when you can see that in version below 2.0.0 is missing binding to template BorderBrush (BorderBrush="{TemplateBinding BorderBrush}").

Version 2.0.0 implementation (source code):

<Style x:Key="NumericUpDown" TargetType="{x:Type prim:InputBase}">
  <Setter Property="Background" Value="{DynamicResource {x:Static themes:ResourceKeys.ControlNormalBackgroundKey}}" />
  <Setter Property="BorderBrush" Value="{DynamicResource {x:Static themes:ResourceKeys.ControlNormalBorderKey}}" />
  <Setter Property="BorderThickness" Value="1" />
  <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}" />
  <Setter Property="HorizontalContentAlignment" Value="Right" />
  <Setter Property="IsTabStop" Value="False" />
  <Setter Property="VerticalContentAlignment" Value="Center" />
  <Setter Property="TextAlignment" Value="Right" />
  <Setter Property="WatermarkTemplate" Value="{StaticResource DefaultWatermarkTemplate}" />
    <Setter Property="Template">
     <Setter.Value>
        <ControlTemplate TargetType="Control">
           <local:ButtonSpinner x:Name="PART_Spinner"
                                IsTabStop="False"
                                Background="{TemplateBinding Background}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                AllowSpin="{Binding AllowSpin, RelativeSource={RelativeSource TemplatedParent}}"
                                ShowButtonSpinner="{Binding ShowButtonSpinner, RelativeSource={RelativeSource TemplatedParent}}">

               ...

Version 1.9.0 implementation (source code):

<Style x:Key="NumericUpDown" TargetType="{x:Type prim:InputBase}">
      <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" />
      <Setter Property="BorderThickness" Value="1" />
      <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}" />
      <Setter Property="HorizontalContentAlignment" Value="Right" />
      <Setter Property="IsTabStop" Value="False" />
      <Setter Property="VerticalContentAlignment" Value="Center" />
      <Setter Property="TextAlignment" Value="Right" />
      <Setter Property="WatermarkTemplate" Value="{StaticResource DefaultWatermarkTemplate}" />      
      <Setter Property="Template">
         <Setter.Value>
            <ControlTemplate TargetType="Control">
               <local:ButtonSpinner x:Name="PART_Spinner"
                                    IsTabStop="False"
                                    Background="{TemplateBinding Background}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    AllowSpin="{Binding AllowSpin, RelativeSource={RelativeSource TemplatedParent}}"
                                    ShowButtonSpinner="{Binding ShowButtonSpinner, RelativeSource={RelativeSource TemplatedParent}}">
        ...                
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top