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

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

Open
redsolo opened this issue May 16, 2017 · 3 comments
Open

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

redsolo opened this issue May 16, 2017 · 3 comments

Comments

@redsolo
Copy link

redsolo commented May 16, 2017

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.

@TFTomSun
Copy link

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

@AnotherKiwi
Copy link

Me too.

@TFTomSun
Copy link

TFTomSun commented Oct 2, 2017

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

dbdkmezz added a commit to reincubate/MultiSelectTreeView that referenced this issue Apr 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants