Silverlight Grid 边界线处理

方案: 使用Rectangle填充,Rectangle的属性设置如下:HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" Stroke="#FF008BFF"

Demo:

<Border Height="480" Width="640"  BorderBrush="#FFFF0000" BorderThickness="2,2,2,2">

  <Grid x:Name="LayoutRoot">
  <Grid.ColumnDefinitions>
  <ColumnDefinition Width="1*"/>
  <ColumnDefinition Width="1*"/>
  </Grid.ColumnDefinitions>
  <Grid.RowDefinitions>
  <RowDefinition Height="1*"/>
  <RowDefinition Height="1*"/>
  </Grid.RowDefinitions>
  <Rectangle HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" Stroke="#FF008BFF"/>
  <Rectangle HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" Stroke="#FF008BFF" Grid.Column="1"/>
  <Rectangle HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" Stroke="#FF008BFF" Grid.Row="1"/>
  <Rectangle HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" Stroke="#FF008BFF" Grid.Row="1" Grid.Column="1"/>
    </Grid>
  </Border>

原文地址:https://www.cnblogs.com/luxiaofeng54/p/1916951.html