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. Wh开发者_高级运维ile 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)
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.
精彩评论