dotnet / dotnet/wpf

Fluent2 datagrid cell style based on DefaultDataGridCellStyle

Open
#10,351 3 comments 0 reactions 0 assignees View on GitHub
Investigate Win 11 Theming
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

### Description

I want to adapt the .net 9 fluent theme's DefaultDataGridCellStyle so the grid cells do not look that cramped. Thus, I added a border and centered the cell's content:

```csharp

<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<Border Padding="8" Background="{TemplateBinding Background}">
<ContentPresenter VerticalAlignment="Center" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>

```
Using that code, I override the default ControlTemplate completely and loose existing functionality. Instead I want to add those changes to the existing template. How can I achieve this? Or is there an overall better way?

I need the dark and the light theme to work as they are supposed to.

Thanks in advance.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.