Use BooleanBoxes for default values in DependencyProperty metadata#10711
Open
h3xds1nz wants to merge 4 commits into
Open
Use BooleanBoxes for default values in DependencyProperty metadata#10711h3xds1nz wants to merge 4 commits into
h3xds1nz wants to merge 4 commits into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #10711 +/- ##
===================================================
+ Coverage 11.17950% 11.23853% +0.05902%
===================================================
Files 3314 3314
Lines 665182 665185 +3
Branches 74668 74667 -1
===================================================
+ Hits 74364 74757 +393
+ Misses 589525 589128 -397
- Partials 1293 1300 +7
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
jizc
approved these changes
Apr 6, 2025
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
While we have
SetValuespecial-cased forBooleanBoxesand a lot of bool-DPs have properly set their default values withBooleanBoxes.TrueBoxorBooleanBoxes.FalseBox, there are quite a few outliers as I've noticed today when digging through the boxed booleans on the heap.Therefore, this PR does 3 things:
MS.Internal.KnownBoxesas a global using, since it is used in most of our classes3.1) Since we have 1-3 classes there, that doesn't bring any code bloat
3.2) That means I've removed the usings in all other files
I didn't do anything in
Ribbonbecause itWindowsBasedoesn't have internals visible to the assembly.Customer Impact
Decreases number of booleans by a big amount, decreased memory usage, improved perf slightly.
Regression
No.
Testing
Local build.
Risk
I did most of the work replacement work with either MilCodeGen or regex, but there were a few manual changes, so it should be fine. Note that using the boxes is not a new thing, this just makes sure all boolean DPs use it.
Microsoft Reviewers: Open in CodeFlow