Diogo Mendonça
Diogo Mendonça

Reputation: 488

Animation on the ItemsSource binding on a ListView

I have a Universal App solution and on the Windows project I'm using a master-detail view similar to the split-page template. ListView on the left with the items and ListView on the right with the items details.

The binding from the second ListView is done through

ItemsSource="{Binding Path=SelectedItem.Stages, ElementName=itemListView}"

and it works perfectly, when changing selected items (itemListView is the name of the first ListView).

The problem I'm having is with the animation the 2nd ListView does when I select an item with a bigger list of details, let's say from 5 to 8.

When I select the item with the 8 "details", 3 items are added to the end of the ListView on the right and the first 5 swap out (by fading and moving to the right) with the new 5 half a second later. This looks odd and the visual effect is not pleasent.

The same thing happens when changing to a list with fewer items: the last 3 are immediately removed and the remaining 5 fade away to the new ones, but this effect is not that prominent.

Is there anything I can do?

Update

Video

Upvotes: 0

Views: 267

Answers (1)

user3346310
user3346310

Reputation:

To disable ListViewItems animations all you need to do is clear TransitionCollection or declare it in xaml as empty:

<ListView>
 <ListView.ItemContainerTransitions>
  <TransitionCollection />
 </ListView.ItemContainerTransitions>
<ListView>

Upvotes: 1

Related Questions