From bc7755ca56e3958318434263d74611c249a59aff Mon Sep 17 00:00:00 2001 From: "E.Z. Hart" Date: Wed, 16 Nov 2016 10:14:17 -0700 Subject: [PATCH] Use static method syntax to prevent mono compiler error (#538) --- .../Renderers/NavigationRenderer.cs | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs index 676c73a..0d6601c 100644 --- a/Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs +++ b/Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs @@ -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() -- 2.7.4