1
votes

I'm using the Extended WPF Toolkit's IntegerUpDown control.

I was able to stylize the arrow buttons in a previous question.

Before Style Before

After Style After

I've run into some additional style problems:

I'm using PresentationFramework.Aero and Aero2.

<!-- RepeatButton Style -->
<Style x:Key="{x:Static theme:ResourceKeys.SpinnerButtonStyleKey}" TargetType="RepeatButton">                 
    <Style.Triggers>
        <Trigger Property="IsEnabled" Value="True">
            <Setter Property="Background" Value="Transparent" />
            <Setter Property="BorderBrush" Value="Transparent" />               
        </Trigger>

        <Trigger Property="IsEnabled" Value="False">
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderBrush" Value="Transparent" />
        </Trigger>

        <Trigger Property="IsMouseOver" Value="True">
            <Setter Property="Background" Value="DarkBlue"/>
            <Setter Property="BorderBrush" Value="Transparent" />
        </Trigger>

    </Style.Triggers>
</Style>  

Link to the full XAML: http://pastebin.com/ETYgHEpz

The IsEnabled False Trigger will not override the Disabled Background or Border Color. It always stays White, I need it Transparent. However I can override the Opacity and BorderThickness. (Windows 10):

Disabled Background Win10

Cannot change the IsMouseOver Background Color, always Light Blue. (Windows 10):

MouseOver Color

Windows 7 always displays a White Border, even if BorderThickeness is 0 and Color is Transparent or {x:Null}:

Win7 Border

I think it is being overriden by a Control Template, but IntergerUpDown doesn't have a RepeatButton Style within the Control Template and I've had trouble trying to add one. I had to create the Style outside.

1

1 Answers

1
votes

some properties won't work when you set via Style setters. This is because of Dependency Property Value Precedence. Try changing the values in ControlTemplate triggers.