Use static method syntax to prevent mono compiler error (#538)
authorE.Z. Hart <hartez@users.noreply.github.com>
Wed, 16 Nov 2016 17:14:17 +0000 (10:14 -0700)
committerGitHub <noreply@github.com>
Wed, 16 Nov 2016 17:14:17 +0000 (10:14 -0700)
Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs

index 676c73a..0d6601c 100644 (file)
@@ -432,23 +432,10 @@ namespace Xamarin.Forms.Platform.iOS
 
                void UpdateCurrentPagePreferredStatusBarUpdateAnimation()
                {
-                       PageUIStatusBarAnimation animation = ((Page)Element).OnThisPlatform().PreferredStatusBarUpdateAnimation();
-                       Current.OnThisPlatform().SetPreferredStatusBarUpdateAnimation(animation);
-               }
-
-               UIKit.UIStatusBarAnimation GetPreferredStatusBarUpdateAnimation()
-               {
-                       var animation = Current.OnThisPlatform().PreferredStatusBarUpdateAnimation();
-                       switch (animation)
-                       {
-                               case (PageUIStatusBarAnimation.Fade):
-                                       return UIKit.UIStatusBarAnimation.Fade;
-                               case (PageUIStatusBarAnimation.Slide):
-                                       return UIKit.UIStatusBarAnimation.Slide;
-                               case (PageUIStatusBarAnimation.None):
-                               default:
-                                       return UIKit.UIStatusBarAnimation.None;
-                       }
+                       // Not using the extension method syntax here because for some reason it confuses the mono compiler
+                       // and throws a CS0121 error
+                       PageUIStatusBarAnimation animation = PlatformConfiguration.iOSSpecific.Page.PreferredStatusBarUpdateAnimation(((Page)Element).OnThisPlatform());
+                       PlatformConfiguration.iOSSpecific.Page.SetPreferredStatusBarUpdateAnimation(Current.OnThisPlatform(), animation);
                }
 
                void UpdateTranslucent()