在我的XAML我有:在Silverlight 4:如何獲得出彩的填充屬性
<Canvas Grid.Row="1" Background="#FFF2F2F2" Width="78" HorizontalAlignment="Left">
<Rectangle Height="67" x:Name="rectFront" Width="70" Fill="#FF000000" Stroke="#FFB9B9B9" StrokeThickness="3" StrokeLineJoin="Miter" StrokeStartLineCap="Flat" Stretch="Uniform" Canvas.Left="4"/>
</Canvas>
在CS代碼
:
someColor = rectFront.Fill; // <-- error here, can't convert Brush to Color
這完全是有道理的。但是,我怎樣才能從毛筆的顏色屬性轉換出填充?
感謝
簡單代碼