r/dotnet • u/Userware • 8d ago
Promotion OpenSilver adds native scrolling, making it the smoothest-scrolling XAML framework on the web
Hi everyone,
We just added native scrolling to the OpenSilver 3.4 Preview. ScrollViewer and virtualized lists now let the browser do the scrolling itself, which makes OpenSilver by far the smoothest-scrolling XAML framework on the web.
On desktop the difference is hard to see, because desktop computers are fast enough to hide it. On mobile, and especially on low-end phones, it's striking. To compare, we built the same app with the three major .NET cross-platform UI frameworks that run on the web:
- OpenSilver: https://opensilver-scrolling-test.azurewebsites.net/
- Uno Platform: https://uno-scrolling-test.azurewebsites.net/
- Avalonia: https://avalonia-scrolling-test.azurewebsites.net/
The source code is here: https://github.com/OpenSilver/ScrollingPerformanceBenchmark
Be sure to try them on your phone. That's where the difference really shows.
Performance isn't the only benefit. Because the browser does the scrolling, you also get:
- Ctrl+F that scrolls to the results, even inside scrollable areas
- Native scrollbars on mobile and macOS (optional), which look and behave like the platform's own
- Better accessibility: screen readers and other assistive tools can recognize real browser scroll containers and scroll them
- Browser extensions support (change fonts, dark mode, translate...)
- Auto-scrolling while selecting text, when you drag past the edge of a scrollable area
- Native touch and momentum scrolling, with the inertia and edge bounce / overscroll effects users expect on their device
This is possible because OpenSilver renders the UI as real HTML elements, while the other .NET UI frameworks that run in the browser draw into a canvas.
Existing OpenSilver apps don't need any code changes. The Silverlight/WPF ScrollViewer API stays the same, and native scrolling is on by default. If something doesn't work as expected, you can turn it off for the whole app or for a single ScrollViewer.
This is part of our goal of making OpenSilver the "web-native WPF". We'd love your feedback: try it on your own apps, and please report anything that behaves differently on GitHub: https://github.com/OpenSilver/opensilver
Happy to answer any questions!
1
u/Discordbothost 8d ago
The demo README says the article isn't virtualized. Could you add a long virtualized list with a native on/off toggle in the same OpenSilver build? I'd try a fast fling on a slower phone and watch for blank rows before they fill in.
1
u/AutoModerator 8d ago
Thanks for your post Userware. Please note that we don't allow spam, and we ask that you follow the rules available in the sidebar. We have a lot of commonly asked questions so if this post gets removed, please do a search and see if it's already been asked.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.