Page 1 of 1

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

Posted: 25 Nov 2022, 15:25
by manuel
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" />

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

Posted: 25 Nov 2022, 19:32
by sfernandez
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}"

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

Posted: 28 Nov 2022, 17:46
by manuel
Bugticket is created: https://www.noesisengine.com/bugs/view.php?id=2471

The workaround seems to work. Thank you.