Fix: binding errors in Generic.xaml for VS2013 theme #507
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.
Fix: Resolve XAML binding errors in VS2013 theme
Fixed XAML binding errors in Generic.xaml that were causing "Cannot find governing FrameworkElement" errors.
The issue occurred in the AnchorablePaneTitle and LayoutAnchorableFloatingWindowControl styles, where the GeometryDrawing
was using an ElementName binding to reference DragHandleGeometryPlaceholder's Fill property.
Solution: Replaced the element bindings with direct DynamicResource references to the same resource keys.
The issue is caused in
./Themes/Generic.xaml
in two styles:<Style TargetType="avalonDockControls:AnchorablePaneTitle">
<Style x:Key="{x:Type avalonDockControls:LayoutAnchorableFloatingWindowControl}" TargetType="{x:Type avalonDockControls:LayoutAnchorableFloatingWindowControl}">
Both styles contain a GeometryDrawing element that attempts to bind to the Fill property of another element named "DragHandleGeometryPlaceholder" using an ElementName binding, which fails due to element relationship issues in the visual tree.
Solution
Fixed the problem by replacing the ElementName bindings with direct resource references:
Testing
Tested with .NET 6 and VS2022
Confirmed binding errors no longer appear
Verified that theme styling appears correctly