in our WPF application we have and Listbox with a few items. We temporary need to hide some of the items but since we need to keep the item order we don't remove them. We just set the visibility to collapsed.
This works fine so far but the ScrollViewer of the ListView does not refresh. It is still as long as before and sho开发者_运维知识库ws some very strange behavior when you try to scroll.
Is there any way to refresh the ScrollViewer when items are collapsed? Or any other was to archive what we have done? Removing the items from the ListView is not an option.
Have you set the ItemContainerStyle? Just like:
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="Visibility" Value="{Binding Visibility}" />
</Style>
</ListBox.ItemContainerStyle>
精彩评论