Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix color animation bug of title bar buttons (#8649)
In dark mode (and high contrast mode), color animation of title bar button uses wrong color. Cause of this issue is using invalid data in `ColorAnimation`. I fixed this bug by changing `ColorAnimation` value in XAML layout file. According to a [forum post], `To` value of `ColorAnimation` must be frozen. But original source code uses "color binding" which makes this value dynamic. As a result, the value set by default is always used, that means, light mode. So I added new resource named `CaptionButtonStrokeColor` and `CaptionButtonBackgroundColor` which has static color value. In light mode and dark mode, I set `SystemBaseHighColor` in the color resource. `SystemBaseHighColor` is the same as `SystemControlForegroundBaseHighBrush.Color` which is originally used in animation. The background color animation happened to work correctly because its value is the same between light mode and dark mode. But I also fixed background color animation. ## Validation Steps Performed There is no need to add new test with this fix. - I changed the `theme` value in `settings.json` and confirmed that the correct color values were used. - I confirmed that it works correctly even if the Windows theme is changed. [forum post]: https://social.msdn.microsoft.com/Forums/vstudio/en-US/027c364f-5d75-424f-aafd-7fb76b10b676/templatebinding-on-storyboard?forum=wpf Closes #7314 (cherry picked from commit 713027b)
- Loading branch information