Custom Fill Property on PathGeometry in Silverlight

Posted by Otaku on Stack Overflow See other posts from Stack Overflow or by Otaku
Published on 2010-06-01T16:21:09Z Indexed on 2010/06/01 16:23 UTC
Read the original article Hit count: 720

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)

© Stack Overflow or respective owner

Related posts about wpf

Related posts about Silverlight