Int32EditBox Background Brush for MouseOver and IsFocused

Editors for WPF Forum

Posted 5 years ago by MCRXB
Version: 13.2.0592
Avatar

Hi,

I'm trying to set the background color of the Int32EditBox via triggers, but something in the control template is overriding the MouseOver and IsFocused properties. I'm assuming you are using the default Windows chrome. I'm not sure what part of the control template I need to edit to make this happen, is it PartEditBox or...? And how do I apply this to only the Int32EditBox and not all editor controls?

This is what I've tried so far:

<Style.Triggers>
      <MultiTrigger
        x:Uid="MultiTrigger_3">
        <MultiTrigger.Conditions>
          <Condition
            x:Uid="Condition_12"
            Property="IsEnabled"
            Value="True" />
          <Condition
            x:Uid="Condition_13"
            Property="Validation.HasError"
            Value="True" />
        </MultiTrigger.Conditions>
        <Setter
          x:Uid="Setter_116"
          Property="Background"
          Value="{StaticResource ErrorBackgroundBrush}" />
        <Setter
          x:Uid="Setter_117"
          Property="BorderBrush"
          Value="{StaticResource ErrorBorderBrush}" />
      </MultiTrigger>
    </Style.Triggers>

 Thank you!

Comments (1)

Answer - Posted 5 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello, I believe your company has WPF Studio so you can have whoever is listed on the account download the default styles and templates from the organization account page.  Then you can see exactly what style and template is used for Int32EditBox. 

The default PartEditBox template makes use of an ElementChrome object that we change the state on via triggers in template.  You'd need to update that as needed for your scenario.

You could make an implicit Style with the updated Template and have it only target Int32EditBox controls.  Then put that in your app's Resources to have it apply to those controls.

[Modified 5 years ago]


Actipro Software Support

The latest build of this product (v2018.1 build 0675) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.