Closed edgarfgp closed 2 years ago
I like that idea of having a .scrollTo(x, y)
/ .scrollToAnimated(x, y)
The only problem I see with it is we need a way to make it optional, the new DSL makes it a little bit harder...
For ScrollToElement, we do need ViewRef indeed
This works as expected
[<Extension>]
static member inline scrollTo(this: WidgetBuilder<'msg, #IScrollView>, x: float, y: float, animated: bool) =
this.AddScalar(ScrollView.ScrollToAsync.WithValue((x, y, animated)))
If you are happy with my proposal we can wait for #81 to be merged and then use it here . Or we can leave for the different PR 😀
We could even enable all the animation methods in : https://docs.microsoft.com/en-us/dotnet/api/xamarin.forms.viewextensions?view=xamarin-forms
That's a good idea! :)
This PR adds ScrollView extension based on https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/layouts/scrollview
Open questions :
Using V1 :
V2 : I think we cn get acess to those animated scrolling methods like this
There is a second overload for the ScrollToAsync that receives an Xamarin.Forms.Element
For this one we could use the same approach as the ViewRef approach done in #81