Animated panel and ListCollectionView filter

Views for WPF Forum

Posted 9 years ago by Kasper
Avatar
We have a problem getting an animated wrappanel to animate when the items is filtered using a ListCollectionView, instead of animating the filtered items the entire panel just blinks and the new layout is shown.

The animation works fine when Adding / Removing items, but hiding items using the filter does not. What are we doing wrong?

XAML from out test project:

     <ListBox ItemsSource="{Binding Path=Items}"
             SelectedItem="{Binding Path=SelectedItem}"
             ScrollViewer.HorizontalScrollBarVisibility="Disabled">
      <ListBox.ItemsPanel>
        <ItemsPanelTemplate>
          <views:AnimatedWrapPanel />
        </ItemsPanelTemplate>
      </ListBox.ItemsPanel>
      <ListBox.ItemTemplate>
        <DataTemplate>
          ...
        </DataTemplate>
      </ListBox.ItemTemplate>
    </ListBox>
Where; Items is a ListCollectionView on where we call Refresh() when the filter logic changes and we expects the filter/unfiltered items to be animated.

Comments (2)

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Kaspar,

When applying a filter to a ListCollectionView, it sends a "reset" notification for the collection. This effectively removes all the items from the ListBox, then re-adds the new non-filtered items. When adding/removing individual items, only those items are affected.

More information can be found here: http://drwpf.com/blog/2008/10/20/itemscontrol-e-is-for-editable-collection/


Actipro Software Support

Posted 9 years ago by Kasper
Avatar
Forgot to reply and say thanks, using the IEditableObject worked. Thanks.
The latest build of this product (v2019.1 build 0683) was released 19 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.