标签:style class tar ext color get
1.引用命名空间
xmlns:Primitives="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls.Data"
xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
2.写样式
<Style x:Key="DataGridHeaderStyle" TargetType="Primitives:DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment" Value="Center"></Setter>
</Style>
<Style x:Key="DataGridCellStyle" TargetType="data:DataGridCell">
<Setter Property="HorizontalContentAlignment" Value="Center" ></Setter>
</Style>
3.代入
<sdk:DataGridCheckBoxColumn HeaderStyle="{StaticResource DataGridHeaderStyle}" Header="姓名"/>
Silverlight DataGrid标题行居中,布布扣,bubuko.com
标签:style class tar ext color get
原文地址:http://www.cnblogs.com/Holley/p/3790267.html