Blinking Colored Caret Causing Other Fields To Blink

66 Views Asked by At

I work on a Silverlight application project. A recent bug I've come across and am trying to resolve is, when applying a color to a CaretBrush in a PasswordBox--whether as a straight hex number or as a static resource--the blinking of the caret causes other PasswordBoxes and some random TextBlocks on the screen to blink in unison.

 <Style TargetType="PasswordBox">
    <Setter Property="CaretBrush" Value="{StaticResource MarkerBrush}" />       <Setter Property="Background" Value="{StaticResource MainBrush}" />
    <Setter Property="Foreground" Value="{StaticResource MarkerBrush}" />
    <Setter Property="Margin" Value="0 4" />
    <Setter Property="VerticalAlignment" Value="Center" />
     <Setter Property="ToolTipService.ToolTip" Value="{Binding Text, RelativeSource={RelativeSource Self}}" />
 </Style>

The purpose for this specific StaticResource brush is the user has the option to flip to a dark screen in which black text becomes white, thus the need for the black caret to invert as well. When no color is applied to the caret there is no problem with other fields blinking, but the caret remains black--hard to see on a dark background. When a color brush is applied as shown above, or as a value such as #FF999999, then the other PasswordBoxes on the screen blink as soon as a value is inserted--as well as TextBlocks within the shell (header and footer)--from a totally different XAML document. In addition putting focus on a different field causes the values in the PasswordBoxes to totally disapper until focus is brought back to any of the blinking PasswordBoxes.

Strange behavior and ONLY happens when color is applied to the PasswordBox style. Any thoughts?

Thank you kindly, John Gnotek

0

There are 0 best solutions below