Skip to content
This repository was archived by the owner on May 7, 2022. It is now read-only.
This repository was archived by the owner on May 7, 2022. It is now read-only.

IsActive (Window) binding issue #44

Open

Description

@darul75

Please can you give a solution to solve all these bindings issues there...one per tree node diplayed.

Not sure to understand why it is related to a window and why in my context it does not work, but can I get rid of it?

Thx

System.Windows.Data Warning: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Window', AncestorLevel='1''. BindingExpression:Path=IsActive; DataItem=null; target element is 'MultiSelectTreeViewItem' (Name=''); target property is 'NoTarget' (type 'Object')
System.Windows.Data Warning: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Window', AncestorLevel='1''. BindingExpression:Path=IsActive; DataItem=null; target element is 'MultiSelectTreeViewItem' (Name=''); target property is 'NoTarget' (type 'Object')
System.Windows.Data Warning: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Window', AncestorLevel='1''. BindingExpression:Path=IsActive; DataItem=null; target element is 'MultiSelectTreeViewItem' (Name=''); target property is 'NoTarget' (type 'Object')
System.Windows.Data Warning: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Window', AncestorLevel='1''. BindingExpression:Path=IsActive; DataItem=null; target element is 'MultiSelectTreeViewItem' (Name=''); target property is 'NoTarget' (type 'Object')
.....

thousand of lines like that sometimes and tree rendering very slow at the end

Activity

  1. xyrus02 commented on May 10, 2018

    @xyrus02

    Your problem seems to be that the root element of your visual tree is not inheriting from System.Windows.Window.
    The four default templates contain a behavior which dims the selection brushes if the window which contains the control is inactive. In your case, the binding fails to obtain the window instance.

  2. ygoe commented on May 10, 2018

    @ygoe
    Owner

    @xyrus02 Isn't a focused control in an inactive window still "focused"? This is an issue with a lot of UI controls that just don't regard the top-level window state like good old Win32 controls did.

  3. xyrus02 commented on May 10, 2018

    @xyrus02

    Yes indeed, you are right. In the visual tree, it is still marked as focused. I still would rather rely on that than on a property of a window because in theory, you can't always be sure that the top level element is a window (what about a page?)
    Nonetheless, there shouldn't be a binding exception spamming OPs trace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions