我正在尝试设计自己的数据网格,这就是我正在做的事情:
<DataGrid x:Name="datagrid_1" Margin="554,92,52,373" ItemsSource="{Binding}" >
<DataGridRow>
<DataGridRow.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="Black" Offset="0"/>
<GradientStop Color="#FF878787" Offset="1"/>
</LinearGradientBrush>
</DataGridRow.Background>
</DataGridRow>
<DataGridColumnHeader>
<DataGridColumnHeader.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="Black" Offset="0"/>
<GradientStop Color="Red" Offset="1"/>
</LinearGradientBrush>
</DataGridColumnHeader.Background>
</DataGridColumnHeader>
<DataGridCell>
<DataGridCell.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="Black" Offset="0"/>
<GradientStop Color="#FF878787" Offset="1"/>
</LinearGradientBrush>
</DataGridCell.Background>
<DataGridCell.BorderBrush>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="Black" Offset="0"/>
<GradientStop Color="Red" Offset="1"/>
</LinearGradientBrush>
</DataGridCell.BorderBrush>
</DataGridCell>
<DataGridRowHeader>
<DataGridRowHeader.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="Black" Offset="0"/>
<GradientStop Color="Red" Offset="1"/>
</LinearGradientBrush>
</DataGridRowHeader.Background>
</DataGridRowHeader>
</DataGrid>
问题是它只是没有改变默认样式,我真的不知道问题出在哪里,我认为我做的一切都是正确的。请问这里有什么帮助吗?提前致谢。