Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AlternatingRowForeground is not honored #4140

Closed
1 of 2 tasks
thiago-cs opened this issue Jul 29, 2021 · 2 comments
Closed
1 of 2 tasks

AlternatingRowForeground is not honored #4140

thiago-cs opened this issue Jul 29, 2021 · 2 comments
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior

Comments

@thiago-cs
Copy link
Contributor

Describe the bug

AlternatingRowForeground is not applied when in Light theme.

  • Is this bug a regression in the toolkit? If so, what toolkit version did you last see it work:

Steps to Reproduce

  • Can this be reproduced in the Sample App?

Steps to reproduce the behavior:

  1. Open the Sample App.
  2. Go to DataGrid.
  3. Switch to Light Theme.
  4. See error: the gray AlternatingRowForeground is not applied.
  5. Change the AlternatingRowForeground to any color (e.g. Red).
  6. See error: the AlternatingRowForeground is still not applied.
  7. Switch to Dark theme
  8. See success: no two consecutive rows are the same color.

Expected behavior

no two consecutive rows having the same foreground color.

Screenshots

No need.

Environment

NuGet Package(s):

Package Version(s):

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [ ] May 2020 Update (19041)
- [X] 21H1 (19043)

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [X] May 2019 Update (18362)
- [ ] May 2020 Update (19041)
- [ ] Insider Build (xxxxx)

Device form factor:
- [X] Desktop
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio
- [ ] 2017 (version: )
- [X] 2019 (version: 16.10.4)
- [ ] 2019 Preview (version: )

Additional context

The AlternatingRowForeground is not applied when in Light theme because the default value for the dependency property DataGridRow.Foreground is #FFFFFFFF but the foreground brush itself under Light Theme is not. That causes the LOC # 1129 (see below) to always evaluate to false under Light Theme, which in turn leads to the AlternatingRowForeground brush to be ignored every time.
[1129] if (this.Foreground.Equals(defaultForeground))

@thiago-cs thiago-cs added the bug 🐛 An unexpected issue that highlights incorrect behavior label Jul 29, 2021
@ghost ghost added the needs triage 🔍 label Jul 29, 2021
@ghost
Copy link

ghost commented Jul 29, 2021

Hello thiago-cs, thank you for opening an issue with us!

I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌

@Rosuavio
Copy link
Contributor

Rosuavio commented Aug 6, 2021

Fixed by #4138

@Rosuavio Rosuavio closed this as completed Aug 6, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Nov 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants