Fix: binding errors in Generic.xaml for VS2013 theme#507
Open
AhmadovMahammad wants to merge 1 commit into
Open
Fix: binding errors in Generic.xaml for VS2013 theme#507AhmadovMahammad wants to merge 1 commit into
AhmadovMahammad wants to merge 1 commit into
Conversation
Fixed binding errors in Generic.xaml causing 'Cannot find governing FrameworkElement' errors. Replaced ElementName bindings with direct resource references in AnchorablePaneTitle and LayoutAnchorableFloatingWindowControl styles. ISSUES Dirkster99#337: Binding failure when using AvalonDock.Themes.VS2013 Dirkster99#377 Changes: 1. Line number: 2161, 2. Line number: 619
Author
|
ISSUE #377 |
Collaborator
|
@AhmadovMahammad Thanks for the PR. Unfortunately the diff is too big too review (probably styling). Can you simplify it? |
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.
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.xamlin 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