summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core
diff options
context:
space:
mode:
authorPaul DiPietro <pauldipietro@users.noreply.github.com>2016-11-16 10:02:54 (GMT)
committerRui Marinho <me@ruimarinho.net>2016-11-16 10:02:54 (GMT)
commit98235e0eea8b540ac10a71b97ee08a5842abd664 (patch)
tree83856b6c24d0b8730946cd3241f550623a0d7f7b /Xamarin.Forms.Core
parent107ed5e545698a647b9cd1be22745a2c35aeebc4 (diff)
downloadxamarin-forms-98235e0eea8b540ac10a71b97ee08a5842abd664.zip
xamarin-forms-98235e0eea8b540ac10a71b97ee08a5842abd664.tar.gz
xamarin-forms-98235e0eea8b540ac10a71b97ee08a5842abd664.tar.bz2
[iOS] Add Platform Specific features for PrefersStatusBarHidden/UIStatusBarAnimation (#463)
* [iOS] Add Platform Specific features for PrefersStatusBarHidden/UIStatusBarAnimation * Update docs
Diffstat (limited to 'Xamarin.Forms.Core')
-rw-r--r--Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/Page.cs60
-rw-r--r--Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/StatusBarHiddenMode.cs9
-rw-r--r--Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/UIStatusBarAnimation.cs9
-rw-r--r--Xamarin.Forms.Core/Xamarin.Forms.Core.csproj3
4 files changed, 81 insertions, 0 deletions
diff --git a/Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/Page.cs b/Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/Page.cs
new file mode 100644
index 0000000..a32a152
--- /dev/null
+++ b/Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/Page.cs
@@ -0,0 +1,60 @@
+´╗┐namespace Xamarin.Forms.PlatformConfiguration.iOSSpecific
+{
+ using FormsElement = Forms.Page;
+
+ public static class Page
+ {
+ public static readonly BindableProperty PrefersStatusBarHiddenProperty =
+ BindableProperty.Create("PrefersStatusBarHidden", typeof(StatusBarHiddenMode), typeof(Page), StatusBarHiddenMode.Default);
+
+ public static StatusBarHiddenMode GetPrefersStatusBarHidden(BindableObject element)
+ {
+ return (StatusBarHiddenMode)element.GetValue(PrefersStatusBarHiddenProperty);
+ }
+
+ public static void SetPrefersStatusBarHidden(BindableObject element, StatusBarHiddenMode value)
+ {
+ element.SetValue(PrefersStatusBarHiddenProperty, value);
+ }
+
+ public static StatusBarHiddenMode PrefersStatusBarHidden(this IPlatformElementConfiguration<iOS, FormsElement> config)
+ {
+ return GetPrefersStatusBarHidden(config.Element);
+ }
+
+ public static IPlatformElementConfiguration<iOS, FormsElement> SetPrefersStatusBarHidden(this IPlatformElementConfiguration<iOS, FormsElement> config, StatusBarHiddenMode value)
+ {
+ SetPrefersStatusBarHidden(config.Element, value);
+ return config;
+ }
+
+ public static readonly BindableProperty PreferredStatusBarUpdateAnimationProperty =
+ BindableProperty.Create("PreferredStatusBarUpdateAnimation", typeof(UIStatusBarAnimation), typeof(Page), UIStatusBarAnimation.None);
+
+ public static UIStatusBarAnimation GetPreferredStatusBarUpdateAnimation(BindableObject element)
+ {
+ return (UIStatusBarAnimation)element.GetValue(PreferredStatusBarUpdateAnimationProperty);
+ }
+
+ public static void SetPreferredStatusBarUpdateAnimation(BindableObject element, UIStatusBarAnimation value)
+ {
+ if (value == UIStatusBarAnimation.Fade)
+ element.SetValue(PreferredStatusBarUpdateAnimationProperty, value);
+ else if (value == UIStatusBarAnimation.Slide)
+ element.SetValue(PreferredStatusBarUpdateAnimationProperty, value);
+ else
+ element.SetValue(PreferredStatusBarUpdateAnimationProperty, value);
+ }
+
+ public static UIStatusBarAnimation PreferredStatusBarUpdateAnimation(this IPlatformElementConfiguration<iOS, FormsElement> config)
+ {
+ return GetPreferredStatusBarUpdateAnimation(config.Element);
+ }
+
+ public static IPlatformElementConfiguration<iOS, FormsElement> SetPreferredStatusBarUpdateAnimation(this IPlatformElementConfiguration<iOS, FormsElement> config, UIStatusBarAnimation value)
+ {
+ SetPreferredStatusBarUpdateAnimation(config.Element, value);
+ return config;
+ }
+ }
+}
diff --git a/Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/StatusBarHiddenMode.cs b/Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/StatusBarHiddenMode.cs
new file mode 100644
index 0000000..57c54b8
--- /dev/null
+++ b/Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/StatusBarHiddenMode.cs
@@ -0,0 +1,9 @@
+´╗┐namespace Xamarin.Forms.PlatformConfiguration.iOSSpecific
+{
+ public enum StatusBarHiddenMode
+ {
+ Default,
+ True,
+ False
+ }
+}
diff --git a/Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/UIStatusBarAnimation.cs b/Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/UIStatusBarAnimation.cs
new file mode 100644
index 0000000..ac594d1
--- /dev/null
+++ b/Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/UIStatusBarAnimation.cs
@@ -0,0 +1,9 @@
+´╗┐namespace Xamarin.Forms.PlatformConfiguration.iOSSpecific
+{
+ public enum UIStatusBarAnimation
+ {
+ None,
+ Slide,
+ Fade
+ }
+}
diff --git a/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj b/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj
index 48bed53..eae36a4 100644
--- a/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj
+++ b/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj
@@ -94,6 +94,9 @@
<Compile Include="PlatformConfiguration\iOSSpecific\BlurEffectStyle.cs" />
<Compile Include="PlatformConfiguration\iOSSpecific\Entry.cs" />
<Compile Include="PlatformConfiguration\iOSSpecific\NavigationPage.cs" />
+ <Compile Include="PlatformConfiguration\iOSSpecific\Page.cs" />
+ <Compile Include="PlatformConfiguration\iOSSpecific\StatusBarHiddenMode.cs" />
+ <Compile Include="PlatformConfiguration\iOSSpecific\UIStatusBarAnimation.cs" />
<Compile Include="PlatformConfiguration\iOSSpecific\VisualElement.cs" />
<Compile Include="PlatformConfiguration\WindowsSpecific\MasterDetailPage.cs" />
<Compile Include="PlatformConfiguration\WindowsSpecific\CollapseStyle.cs" />