December 2018
Intermediate to advanced
416 pages
10h 30m
English
To be able to calculate a percentage of how far the user has dragged the image, we need to know the size of the control. This is not determined until the control is laid out by Xamarin.Forms.
We will override the OnSizeAllocated() method and add a field in the class called _screenWidth to keep track of the current width of the window by following these few steps:
private double _screenWidth = -1;protected override void OnSizeAllocated(double width, double height){ base.OnSizeAllocated(width, height); if (Application.Current.MainPage == null) { return; ...
Read now
Unlock full access