ScrollAxisBase scrollRows;
VisualContainer visualContainer;
public MainPage()
{
InitializeComponent();
visualContainer = listView.GetType().GetRuntimeProperties().First(p => p.Name == "VisualContainer").GetValue(listView) as VisualContainer;
scrollRows = visualContainer.GetType().GetRuntimeProperties().First(p => p.Name == "ScrollRows").GetValue(visualContainer) as ScrollAxisBase;
scrollRows.Changed += ScrollRows_Changed;
}
private void ScrollRows_Changed(object sender, ScrollChangedEventArgs e)
{
…
}
|
Hi Dinesh,
this works fine but I cant figure out how to determine if user is scrolling down or up. for example, on sfdatagrid I had solution as below. this was based on VerticalOffset of container because sfdatagrid VisualContainer exposes this attribute. I cant find same attribute on sfListview VisualContainer. I appreciate for your help
private void ScrollRows_Changed(object sender, Syncfusion.GridCommon.ScrollAxis.ScrollChangedEventArgs e)
{
// Will be called when the SfDataGrid is scrolled
if (previousOffset > 0)
{
if (previousOffset > container.VerticalOffset)
{
// scrolling up
}
else if (previousOffset == container.VerticalOffset)
{
// not scrolling
}
else
{
//scrolling down
}
}
previousOffset = container.VerticalOffset;
}
private void ScrollRows_Changed(object sender, ScrollChangedEventArgs e)
{
var scrolloffset = (double)visualContainer.GetType().GetRuntimeProperties().
First(p => p.Name == "ScrollOffset").GetValue(visualContainer);
} |