views:

36

answers:

1

In WPF it is possible to use the IsStroked property of a PathSegment to make the Segment invisible, I'm looking for a way to replicate this behavior in Silverlight, which doesn't have this property.

Is this possible?

[EDIT] I'm looking for a way to do this in code-behind, not in Xaml.

A: 

Maybe I'm missing something, but couldn't you just set the Opacity="0" on the segment? Or maybe set the alpha channel of the stroke brush to 0? I'm not entirely sure what you are trying to accomplish with this property...

If you really needed this as a boolean property you could probably subclass whatever segment type you need to use and add a custom boolean DependencyProperty which could internally toggle the opacity or stroke brush (and possibly IsHitTestVisible) to make the segment invisible.

Dan Auclair
I forgot to specify this in the original question, but I am trying to do this in a c# file rather than in Xaml. Since PathSegment descends directly form DependencyObject, there is no Opacity or Brush property that I can set on it.
Aviv B.
Yeah sorry, I guess Opacity and the Stroke brush need to be set on the containing Path object.
Dan Auclair