8000 Fix crashes in TextBox(es) in Fluent theme by harshit7962 · Pull Request #10841 · dotnet/wpf · GitHub
[go: up one dir, main page]

Skip to content

Fix crashes in TextBox(es) in Fluent theme #10841

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

Merged
merged 2 commits into from
May 12, 2025
Merged

Conversation

harshit7962
Copy link
Member
@harshit7962 harshit7962 commented May 12, 2025

Description

Since Preview 4, the creation of TextBox, PasswordBox and RichTextBox was crashing when using System theme. This was due to the assignment of it's BorderThickness as StaticResource and the resource being declared in Variables.xaml which is a sibling of TextBox.xaml and other files in Fluent.xaml and hence resulting in the crash. The changes here aims to resolve this using the DynamicResource.

Customer Impact

Crash free fluent applications when using System theme.

Regression

Yes

Testing

Local Build Pass,
Verified the working using a sample application

Risk

Low

Microsoft Reviewers: Open in CodeFlow

@harshit7962 harshit7962 self-assigned this May 12, 2025
@Copilot Copilot AI review requested due to automatic review settings May 12, 2025 08:53
@harshit7962 harshit7962 requested a review from a team as a code owner May 12, 2025 08:53
Copy link
Contributor
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

The purpose of this PR is to eliminate crashes in Fluent-themed TextBox, RichTextBox, and PasswordBox controls when using the System theme by replacing StaticResource references with DynamicResource for BorderThickness.

  • Updated Resource references in TextBox.xaml
  • Updated Resource references in RichTextBox.xaml
  • Updated Resource references in PasswordBox.xaml

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
TextBox.xaml Replaced StaticResource with DynamicResource for BorderThickness in multiple triggers and setters
RichTextBox.xaml Replaced StaticResource with DynamicResource for BorderThickness in control and focused state setters
PasswordBox.xaml Replaced StaticResource with DynamicResource for BorderThickness in focused state setters

@dotnet-policy-service dotnet-policy-service bot added the PR metadata: Label to tag PRs, to facilitate with triage label May 12, 2025
Copy link
codecov bot commented May 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 13.43457%. Comparing base (1d5cd94) to head (8e361db).
Report is 1 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #10841         +/-   ##
===================================================
- Coverage   13.62876%   13.43457%   -0.19419%     
===================================================
  Files           3316        3316                 
  Lines         664822      664822                 
  Branches       74651       74651                 
===================================================
- Hits           90607       89316       -1291     
- Misses        571519      572908       +1389     
+ Partials        2696        2598         -98     
Flag Coverage Δ
Debug 13.43457% <ø> (-0.19419%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dipeshmsft
Copy link
Member

LGTM

@dipeshmsft dipeshmsft merged commit bcdf1d6 into dotnet:main May 12, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR metadata: Label to tag PRs, to facilitate with triage Win 11 Theming
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0