Fix ItemContainer SelectedBrush with custom BorderBrush#279
Open
marko1olo wants to merge 1 commit into
Open
Conversation
Owner
|
This fix is a breaking change because it will require everyone who overrides the |
marko1olo
force-pushed
the
fix-itemcontainer-selected-brush
branch
from
June 7, 2026 15:08
a8c67ba to
6f8a0b0
Compare
Contributor
Author
|
Thanks for calling that out. I updated the branch so the default template still has the inner That keeps derived Local checks:
|
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.
Fixes #70
Description of the Change
This updates the default
ItemContainertemplate so selection, preview-selection, and pending-connection highlight brush changes are applied to the named border inside the control template instead of settingItemContainer.BorderBrushfrom inherited style triggers.That keeps a custom
BorderBrushsetter in aBasedOnItemContainerstyle from overriding the selected visual state, while still allowing an explicitly configuredSelectedBrushto control the selected border color.Verification performed:
dotnet build Nodify\Nodify.csproj -f net8-windowsdotnet build Nodify\Nodify.csproj -f net9-windows --no-restoredotnet build Nodify\Nodify.csproj -f net10.0-windows --no-restoreItemContainerstyle withBorderBrush=BlueandSelectedBrush=Redrendered the inner border blue when unselected and red when selected.git diff --checkPossible Drawbacks
The selected, preview-selected, and highlight states now change the template border's
BorderBrushrather than the effectiveItemContainer.BorderBrushdependency property value. This preserves the visual behavior and avoidsBasedOnstyle precedence issues, but code that readItemContainer.BorderBrushwhile selected would now continue to see the configured base brush.dotnet build Examples\Nodify.Calculator\Nodify.Calculator.csproj -f net8-windowsdotnet build Examples\Nodify.Playground\Nodify.Playground.csproj -f net8-windowsdotnet build Examples\Nodify.Shapes\Nodify.Shapes.csproj -f net8-windowsdotnet build Examples\Nodify.StateMachine\Nodify.StateMachine.csproj -f net8-windows