Path的Stroke和Fill属性不能指向同一个SolidColorBrush对象?

Posted on October 25, 2007 by Fdream

今天碰到这个BT的问题,对于两个Path对象,像下面这样写的时候,第二行居然无效!

SolidColorBrush scb = new SolidColorBrush(CommonApp.Instance.PathColor);
pathA.Stroke = scb;
pathB.Stroke = scb; //此句居然没有任何作用……

同样,Path的Fill属性存在同样的问题。而对于Rectangle等对象这样写则没有什么问题,真是奇怪…

SolidColorBrush scb = new SolidColorBrush(CommonApp.Instance.RectangleColor);
rectangleA.Fill = scb;
rectangleB.Fill = scb;

这是为什么呢?

分享 |
Categories:
Silverlight/C#
Tags:
Comments:
Leave a comment
Views:
19,887 Views

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>