manuel
Topic Author
Posts: 9
Joined: 16 Aug 2022, 10:06

Can't solve PropertyPath: Type 'ItemCollection' does not contain a property named 'Count'

25 Nov 2022, 15:25

Hey everyone,

I try to bind the Items.Count of a ListBox to the Maximum and the Height of a Slider. The way I did it works perfectly in a regular WPF project but fails with Noesis.
To me, it looks like that Count is not an exposed property as it should be comparing both documentation entries. Is it just me failing or am I right with my assumption?

https://www.noesisengine.com/docs/Gui.C ... ction.html
https://learn.microsoft.com/en-us/dotne ... esktop-7.0
<ListBox x:Name="EpisodeList" ItemsSource="{Binding Episodes}" SelectionChanged="OnEpisodeSelectionChanged"/>

<Slider x:Name="EpisodeSlider" Maximum="{Binding ElementName=EpisodeList, Path=Items.Count, Converter={StaticResource ConverterSubtract}, ConverterParameter=1, Mode=OneWay}" Minimum="0" SmallChange="1" IsSnapToTickEnabled="True" Height="{Binding ElementName=EpisodeList, Path=Items.Count, Converter={StaticResource ConverterMultiply}, ConverterParameter=25, Mode=OneWay}" Width="50" Orientation="Vertical" />
 
User avatar
sfernandez
Site Admin
Posts: 2702
Joined: 22 Dec 2011, 19:20

Re: Can't solve PropertyPath: Type 'ItemCollection' does not contain a property named 'Count'

25 Nov 2022, 19:32

This is a bug, we are not exposing the Count property of the ItemCollection in the reflection.
Could you please report it in our bugtracker?

In the meantime you can workaround it by binding to the Episodes.Count property instead:
Maximum="{Binding Episodes.Count, Converter={StaticResource ConverterSubtract}, ConverterParameter=1, Mode=OneWay}"
 
manuel
Topic Author
Posts: 9
Joined: 16 Aug 2022, 10:06

Re: Can't solve PropertyPath: Type 'ItemCollection' does not contain a property named 'Count'

28 Nov 2022, 17:46

Bugticket is created: https://www.noesisengine.com/bugs/view.php?id=2471

The workaround seems to work. Thank you.

Who is online

Users browsing this forum: Google [Bot] and 4 guests