I have an Itemscontrol in my xaml inside a ScrollViewer.
<ScrollViewer Margin="0,0,0,0" BorderThickness="0"> <ItemsControl x:Name="itemsStackPanel"> <ItemsControl.ItemTemplate> <DataTemplate> <controls:UserItem Margin="0, 5, 0, 3"></controls:UserItem> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> </ScrollViewer>
and here is the list I am assigning to ItemsControl,
this.itemsStackPanel.ItemsSource = usersList;
now whenever new items are added in usersList, the UI updates and the scrollbar of ScrollViewer reaches at bottom. how do I stick it to top??
--EDIT--
one more issue I found, is that when ever the scrollviewer is resized horizontally, the scrollbars reach at bottom. how to keep the scrollbars on top while resizing?