TextBoxValidationExtensions binding for (In)ValidBrush

Jul 6, 2012 at 7:51 PM

<view:WatermarkTextBox 
Style="{StaticResource Input}"
x:Name="ruleName"
Watermark="Rule Name..."
xyzc:TextBoxValidationExtensions.ValidBrush="{Binding ValidColor}"
xyzc:TextBoxValidationExtensions.Format="NonEmpty"/>

 

When I try using binding as above I always get the default of light red and white. When I change to using:

TextBoxValidationExtensions.SetValidBrush(ruleName, new SolidColorBrush(value));

The value given (from Windows.UI.Colors) actually shows up in the UI.

Valid color was just a basic property of the class in the .xaml.cs class backing onto this .xaml page that had the above snippet.

 

 

 

 

 

Coordinator
Jul 13, 2012 at 9:13 PM

Is ValidColor a Color type or a Brush type? It would not convert a color to a brush automatically.