开发者

Adding a gradient to a border or stackpanel silverlight

开发者 https://www.devze.com 2023-03-13 07:05 出处:网络
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

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

精彩评论

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

关注公众号