단순히 컬렉션에 바인딩하는 목록 상자가 있습니다. 컬렉션에는 하위 컬렉션 (StepDatas)이 있습니다. 하위 컬렉션의 수에 바인딩하고 싶지만 WHERE 문을 사용하고 싶습니다. ChildCollection.Count에 바인딩 할 수 있지만 람다 식을 추가해야 할 때 손실됩니다. 여기 XAML는 다음과 같습니다Silverlight에서 람다 식에 바인딩 할 수 있습니까?
<ListBox Height="Auto" Style="{StaticResource ListBoxStyle1}" Margin="4,46,4,4" x:Name="lstLeftNavigation" Background="{x:Null}" SelectionChanged="lstLeftNavigation_SelectionChanged">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Width="180" Margin="2,2,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" d:LayoutOverrides="Width" MinHeight="36">
<TextBlock Text="{Binding StepNm}" x:Name="tbStepNm" Margin="10,0,34,0" TextWrapping="Wrap" FontFamily="Portable User Interface" Foreground="White" FontSize="10" FontWeight="Bold" VerticalAlignment="Center"/>
<Image Height="37" HorizontalAlignment="Right" Margin="0" VerticalAlignment="Center" Width="37" Source="Images/imgIcoChecked.png" Stretch="Fill"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
은 위의 하위 집합의 개수에 결합하기 위해 노력하고 있습니다. 그러나 특정 조건이 충족되는 경우 하위 컬렉션 수를 표시하려고합니다. 이 특정 경우 하위 컬렉션에는 완료된 속성 (bool)이 있습니다. 그래서 ... CountDatas.Where (x => x.Completed == true) .Count를 보여주고 싶습니다.
어떤 방식 으로든 가능합니까? 어떤 도움을 주셔서 감사합니다!
당신이 받아 들여야하는 대답의 코멘트 여야합니다. –