filip
filip

Reputation: 1503

ListView - Selected Item in the middle

I'm building a Windows Store app using XAML. I have a scrollable ListView that has its SelectedItem set on start. Now, I have two requirements:

  1. I would like the selected item to be always visible
  2. In addition it should be displayed in the middle of the list when possible (it's not possible for the first element).

The first requirement I can partially fulfill by using list's LayoutUpdated event and list.ScrollIntoView(item) method, but this doesn't allow me to scroll down the list manually until the item is unselected.

For the 2nd requirement I have no ideas.

Upvotes: 0

Views: 313

Answers (1)

filip
filip

Reputation: 1503

Ok, found out how to achieve that: http://fczaja.blogspot.com/2013/05/xaml-listview-scroll-selecteditem-to.html

Upvotes: 1

Related Questions