开发者

Silverlight 3 DataGrid - Rounded Corners

开发者 https://www.devze.com 2022-12-16 16:36 出处:网络
Is there an ea开发者_JAVA技巧sy way to give rounded corners to the boundary of a DataGrid in Silverlight 3?

Is there an ea开发者_JAVA技巧sy way to give rounded corners to the boundary of a DataGrid in Silverlight 3?

Thanks a bunch!


I just answered a similar question here for giving rounded corners to any FrameworkElement by attaching a Blend clipping behavior with a specified CornerRadius.

You could write your own logic for the clipping behavior or use the one from the Expression Blend Samples CodePlex page. It would then be as simple referencing System.Windows.Interactivity.dll from the Blend SDK and dropping the behavior on the element in Blend or writing out the XAML:

<data:DataGrid>
    <i:Interaction.Behaviors>
        <samples:ClippingBehavior CornerRadius="15"/>
    </i:Interaction.Behaviors>
</data:DataGrid>

Its a nice reusable way to give rounded corners to any element without relying on a border or an element with corner radii properties.


<Border.Background>
  <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
     <GradientStop Color="Black" Offset="0"/>
     <GradientStop Color="#FF508EB1" Offset="1"/>
  </LinearGradientBrush>
</Border.Background>

<Grid Background="{x:Null}"  x:Name="MainGrid" >
<Grid.Effect>
  <DropShadowEffect />
</Grid.Effect>

    <...>
</Grid>
</Border>


<Border CornerRadius="5">
    <toolkit:DataGrid />
</Border>
0

精彩评论

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

关注公众号