Skip to content

Issue 614 logical children order - #617

Merged
sharpSteff merged 3 commits into
Dirkster99:masterfrom
sharpSteff:issue-614-logical-children-order
Jul 29, 2026
Merged

sharpSteff merged 3 commits into
Dirkster99:masterfrom
sharpSteff:issue-614-logical-children-order

Conversation

@sharpSteff

@sharpSteff sharpSteff commented Jul 28, 2026 •

Copy link
Copy Markdown
Collaborator

fixed #614

claude and others added 3 commits July 28, 2026 18:20
…ual tree depth

Inheritable dependency properties (FontSize, DataContext, ...) assigned to an
ancestor of the DockingManager did not always reach the controls inside the
panels.

The DockingManager keeps the Layout*Controls, every LayoutItem.View and the
content of every LayoutContent as its logical children. Most of them have a
visual parent that differs from their logical parent and are therefore
reachable from the DockingManager through two paths: directly as a logical
child and through the visual tree of another logical child.

WPF's DescendentsWalker walks logical children before visual children and
visits every node at most once. A node reached through the visual tree first
is dropped by TreeWalkHelper.OnInheritablePropertyChanged (its visual parent
differs from its logical parent) and is then skipped on the later logical
visit because it has already been seen - so both chances to apply the new
value are lost. Whether this happens depended on the insertion order of the
logical children.

Enumerating the logical children ordered by descending visual tree depth
guarantees that such a node is always reached through the logical tree first,
which is the path that actually applies the value. As a side effect the
enumeration now works on a snapshot, so the collection can no longer be
modified while a tree walk is in progress.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018UymxkWV99ZP5ca6PDcCmV
…xtElement.FontSizeProperty

ContentPresenter derives from FrameworkElement and has no FontSize property of
its own, it only takes part in the inheritance of TextElement.FontSizeProperty.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018UymxkWV99ZP5ca6PDcCmV
@sharpSteff
sharpSteff merged commit 84e0cd6 into Dirkster99:master Jul 29, 2026
1 check passed
@sharpSteff
sharpSteff deleted the issue-614-logical-children-order branch July 29, 2026 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

problem with property inheritance

2 participants