How to change the color of a SolidColorBrush...

I have no problems setting the color of a Brush element to a specific color ex. orange,

JavaScript Code:
var oNewBrush = agControl.findName("Brush_" + pNewID);
strTextColor = oNewBrush.Color; (used to store original color for later reset)
oNewBrush.Color = "orange";

XAML element:
<TextBlock x:Name="Text_1" FontSize="12" FontFamily="Georgia" Canvas.Left="428" Canvas.Top="322">Text 1<TextBlock.Foreground><SolidColorBrush x:Name="Brush_1" Color="Red"></SolidColorBrush></TextBlock.Foreground></TextBlock>

But when I try to use (strTextColor = oNewBrush.Color) in order to later reset the color I get an error and I see that the value of this strTextColor is some string containing an 10 number digit?

How can I read the brush color (original color), set a standard color and then later reset it to its original color - Thanks.

Kind Regards
Hans P. Dramstad

[1322 byte] By [HPD] at [2007-12-31]
# 1

This is a bug that we are working to address by the next CTP. To work-around, you may have to hard-code the original color name:

if (!nextColor) {

nextColor = “orange”;

lastColor = “red”;

}

oNewBrush.Color = nextColor;

var tmpColor = nextColor;

nextColor = lastColor;

lastColor = tmpColor;

Joe

JoeStegman at 2007-9-7 > top of Msdn Tech,Silverlight (formerly WPF/E),Silverlight (formerly WPF/E) Developer Issues...