views:

17

answers:

1

I've been looking at (and getting confused by) Dependency Properties - I'm not sure if this is what I need or if there is something else.

I'm looking to something very specific with <Path.Data/> children in Silverlight, in particular <PathGeometry/>, <EllipseGeometry/>, etc. While the <Path/> element has a .Fill property, I'd like to add a .Fill property to any of it's Geometries, meaning it's a different color from it's parent. It could be a <SolidColorBrush/> or <LinearGradientBrush/> color, or a percentage of the parent color (like 20% darker than <Path.Fill/>.

Is this possible? Is this a dependency property? How would <RectangleGeometry/>, for example, know that I am trying to fill it with a color? How would I get started?

(adding WPF as a tag too as someone who knows WPF may be able to help)

+2  A: 

Not its not possible, the stroke and fill brush are properties of the Path shape.

If you want to draw Rectangle, Ellipse etc shapes with their own independent Stroke and Fill properties you need to use Rectangle and Ellipse which are Shape objects in their own right.

AnthonyWJones
Oh man, that is too bad :(
Otaku