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.

BindingExpression path error: '(Controls:MultiSelectTreeView.*)' #41

Open

Description

@redsolo

WpfTreeview.zip

Im getting BindingExpression errors for every item I add to the MultiSelectTreeView. I have a very simple tree view where all I have done is set the ItemSource and SelectedItems in the XAML.
But when I add 1000 entries into it, I get the following binding expression failures for each and every item:

System.Windows.Data Warning: 40 : BindingExpression path error: '(Controls:MultiSelectTreeView.HoverHighlighting)' property not found on 'object' ''MultiSelectTreeView' (Name='')'. BindingExpression:Path=(Controls:MultiSelectTreeView.HoverHighlighting); DataItem='MultiSelectTreeView' (Name=''); target element is 'MultiSelectTreeViewItem' (Name=''); target property is 'HoverHighlighting' (type 'Boolean')
System.Windows.Data Warning: 40 : BindingExpression path error: '(Controls:MultiSelectTreeView.ItemIndent)' property not found on 'object' ''MultiSelectTreeView' (Name='')'. BindingExpression:Path=(Controls:MultiSelectTreeView.ItemIndent); DataItem='MultiSelectTreeView' (Name=''); target element is 'MultiSelectTreeViewItem' (Name=''); target property is 'ItemIndent' (type 'Int32')
System.Windows.Data Warning: 40 : BindingExpression path error: '(Controls:MultiSelectTreeView.IsKeyboardMode)' property not found on 'object' ''MultiSelectTreeView' (Name='')'. BindingExpression:Path=(Controls:MultiSelectTreeView.IsKeyboardMode); DataItem='MultiSelectTreeView' (Name=''); target element is 'MultiSelectTreeViewItem' (Name=''); target property is 'IsKeyboardMode' (type 'Boolean')

Im not sure what I should do to remove these, as those seems to be TreeView related and not related to my view models.

Activity

  1. TFTomSun commented on May 27, 2017

    @TFTomSun

    I have the same issue and would also appreciate a solution for it.

  2. AnotherKiwi commented on Jul 10, 2017

    @AnotherKiwi

    Me too.

  3. TFTomSun commented on Oct 2, 2017

    @TFTomSun

    For everyone who wants to fix that issue on his own:
    search for:

    	<!-- Pass on the MultiSelectTreeView' HoverHighlighting value to each item because we couldn't access it otherwise in the triggers -->
    	<Setter Property="HoverHighlighting"
    		Value="{Binding (Controls:MultiSelectTreeView.HoverHighlighting), RelativeSource={RelativeSource AncestorType={x:Type Controls:MultiSelectTreeView}}, Mode=OneWay, FallbackValue=False}"/>
    	<Setter Property="ItemIndent"
    		Value="{Binding (Controls:MultiSelectTreeView.ItemIndent), RelativeSource={RelativeSource AncestorType={x:Type Controls:MultiSelectTreeView}}, Mode=OneWay, FallbackValue=13}"/>
    	<Setter Property="IsKeyboardMode"
    		Value="{Binding (Controls:MultiSelectTreeView.IsKeyboardMode), RelativeSource={RelativeSource AncestorType={x:Type Controls:MultiSelectTreeView}}, Mode=OneWay, FallbackValue=False}"/>
    

    and replace with:

    	<!-- Pass on the MultiSelectTreeView' HoverHighlighting value to each item because we couldn't access it otherwise in the triggers -->
    	<Setter Property="HoverHighlighting"
    		Value="{Binding Path=HoverHighlighting, RelativeSource={RelativeSource AncestorType={x:Type Controls:MultiSelectTreeView}}, Mode=OneWay, FallbackValue=False}"/>
    	<Setter Property="ItemIndent"
    		Value="{Binding Path=ItemIndent, RelativeSource={RelativeSource AncestorType={x:Type Controls:MultiSelectTreeView}}, Mode=OneWay, FallbackValue=13}"/>
    	<Setter Property="IsKeyboardMode"
    		Value="{Binding Path=IsKeyboardMode, RelativeSource={RelativeSource AncestorType={x:Type Controls:MultiSelectTreeView}}, Mode=OneWay, FallbackValue=False}"/>
    

    The files that contain that xaml code are:
    MultiSelectTreeViewItem.Aero2.xaml
    MultiSelectTreeViewItem.Classic.xaml
    MultiSelectTreeViewItem.Luna.xaml
    MultiSelectTreeViewItem.Aero.xaml

  4. added a commit that references this issue on Apr 2, 2020
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