diff --git a/README.md b/README.md index 3a97ee1..5014a60 100644 --- a/README.md +++ b/README.md @@ -1 +1,46 @@ -**[View document in Syncfusion .NET MAUI Knowledge Base](https://www.syncfusion.com/kb/13575/how-to-detect-scrolling-direction-in-net-maui-listview-sflistview)** \ No newline at end of file +**[View document in Syncfusion .NET MAUI Knowledge Base](https://www.syncfusion.com/kb/13575/how-to-detect-scrolling-direction-in-net-maui-listview-sflistview)** + +## Sample + +```xaml + + + + + + . . . + . . . + + + + + + + + . . . + . . . + + + + + +C#: +scrollview.Scrolled += Scrollview_Scrolled; + +private void Scrollview_Scrolled(object sender, ScrolledEventArgs e) +{ + if (e.ScrollY == 0) + return; + + if (previousOffset >= e.ScrollY) + { + viewModel.ScrollDirection = "Up Direction"; + } + else + { + viewModel.ScrollDirection = "Down Direction"; + } + + previousOffset = e.ScrollY; +} +``` \ No newline at end of file