views:

81

answers:

1

I have a requirement to change the background colour of the active control (to make it easier to identify where the cursor is).

I've tried using a style with a trigger on the IsFocused property but I'm not having any luck at all; it doesn't seem to fire.

A XAML solution is most preferred.

Any ideas?

A: 

I kept playing and this seems to work well :)

<Style TargetType="{x:Type TextBox}">
  <Style.Triggers>
      <Trigger Property="IsFocused" Value="True">
          <Setter Property="TextBox.Background" Value="Gray" />
      </Trigger>
  </Style.Triggers>
</Style>
Michael