© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago
hugeman

✅ Invalidating inherited Properties Tree in WPF

I'm trying to implement an inherited list property (called
InheritedCustomContextList
InheritedCustomContextList
) which merged all of the values for my property called
CustomContext
CustomContext
in the visual tree (e.g. if window has ObjA, Grid has ObjB, then the value of
InheritedCustomContextList
InheritedCustomContextList
for a child inside of the grid will contain ObjA and ObjB).

I managed to get it to work by setting the value for
InheritedCustomContextList
InheritedCustomContextList
to the parent's value + the
CustomContext
CustomContext
value (if available), and I do basically the same the Coerce callback for
InheritedCustomContextList
InheritedCustomContextList


My problem though is that, If I change
CustomContext
CustomContext
for the window, then that child inside the grid will still reference ObjA, because WPF's tree walker thing that updates inherited values does not continue walking once it sees a DP has a local value set (in this case, it reaches the Grid, sees that it has a local value for
InheritedCustomContextList
InheritedCustomContextList
and stops).

I'm not sure how to fix this, maybe if there was a way to regenerate all inherited values for the entire visual tree (starting at the window's content element). Any help would be great 😄
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

WPF Dependancy Properties
C#CC# / help
15mo ago
✅ WPF UI (lepoco/wpfui) Questions
C#CC# / help
2y ago
WPF how display a list of properties
C#CC# / help
3y ago
❔ wpf styling/templating with custom dependency properties?
C#CC# / help
3y ago