如何在 UWP windows 应用程序中更改 My ToolKit Data Grid 的前景色(文本)

How to change the foreground(Text) color of My ToolKit Data Grid in UWP windows app

我在我的通用 Windows 应用程序中使用我的工具包数据网格(您可以在此处 https://github.com/MyToolkit/MyToolkit/wiki/DataGrid 找到)。因为我希望网格背景为黑色,前景只有白色文本。我可以更改背景颜色,但无法更改前景色。 请任何人给我建议。

提前致谢。

使用项目模板属性:

<controls:DataGrid.ItemDetailsTemplate>
    <DataTemplate>
        <Grid d:DataContext="{Type=models:Person}">
            <TextBlock Text="{Binding something}"
                       Foregroun="White"/>
        </StackPanel>
    </DataTemplate>
</controls:DataGrid.ItemDetailsTemplate>

如果有效请告诉我!

<controls:DataGridTextColumn Width="200" Header="Firstname" 
              Binding="{Binding Firstname}"
              d:DataContext="{d:DesignInstance Type=models:Person}" Foreground="White">

试试这个:

<controls:DataGridTextColumn Width="*" Header="SomeHeader" Binding="{Binding Property}"  >
    <controls:DataGridTextColumn.Header>
        <TextBlock Text="SomeHeader" Foreground="Green" />
    </controls:DataGridTextColumn.Header>
</controls:DataGridTextColumn>