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.
精彩评论