Inside the constructor of my ContentPage I am trying to set the add-on value for the platform:
Padding = new Thickness(5, Device.OnPlatform(20, 5, 5), 5, 5);
Visual Studio emphasizes Device.OnPlatform , and when I Device.OnPlatform over a method call, I get the following warning:
Devide.OnPlatform (T, T, T) is deprecated: "Use switch (RuntimePlatform) instead.
The code originally used was from the e-book "Creating Mobile Applications Using the Xamarin.Forms Book" in 2016. I really wonder how fast this platform is evolving!
Unfortunately, I do not know how Device.OnPlatform should be replaced using the method suggested by the warning.
source share