Navigate to specific element in long list selector after binding

I am using Longlistselector to bind chat messages. After binding, I need to show the latest message. But by default it goes to the beginning of the message. I tried scrolling to the last item "(ScrollTo (lastmessage))" but it doesn't work. can anyone provide a solution.

+3


source to share


3 answers


Others have succeeded by calling UpdateLayout () before ScrollIntoView () in the ListBox.



+2


source


You tried AnimateTo()

and passed the last item in the list to it.



Alternatively, you can poll the control's visual tree and access the ScrollViewer of the inner [Templated] ListBox and call ScrollToVerticalOffset

.

+1


source


Try setting the SelectedItemIndex to the index of the last item.

0


source







All Articles