开发者

Adding a gradient to a border or stackpanel silverlight

How do i add a bit of a gradient to a border or stackpanel so the front part of it looks like it has a bit of a gradient or a curve making it look a bit 3d

Thanks, Jan开发者_StackOverflow社区e


You can define a custom LinearGradientBrush for the border like so

<LinearGradientBrush StartPoint="0,0" EndPoint="0,1" x:Key="MyBorderBrush">
    <GradientStop Offset="0" Color="#FFFFFF"/>
    <GradientStop Offset="1" Color="#FFFFFF"/>
</LinearGradientBrush>

To apply the border you add a border brush to the border

<Border BorderBrush="{StaticResource MyBorderBrush}" BorderThickness="1" CornerRadius="4">
    <!-- Content -->
</Border>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜