开发者

Silverlight change color custom control programmatically

I have this Ellipse which I turned into a custom control so I could animate it programmatically. However I am having trouble changing its color.

I know about changing a shapes color like this:

aRectangle.Fill = new SolidColorBrush(Colors.Blue)开发者_JAVA百科;

However I cannot do this with a custom control.

Anyone know how?


How you set the color would depend on the template for the control, but in general I believe there is a Foreground brush property on the Control class. You should probably have all of the parts of your template honor this property so the entire control is colored properly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜