summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core
diff options
context:
space:
mode:
authorMarko B. Ludolph <MarkoBL@users.noreply.github.com>2017-10-03 13:46:41 (GMT)
committerKangho Hur <kangho.hur@samsung.com>2017-10-23 04:33:58 (GMT)
commit250d04e0bf50705b7fadfd1ff4a703b5607d22b8 (patch)
tree4212d8a715fe2b350539070f77c3e047e748d49f /Xamarin.Forms.Core
parent7accccfc353bda9088d4e9f1be780cc6624d5eca (diff)
downloadxamarin-forms-250d04e0bf50705b7fadfd1ff4a703b5607d22b8.zip
xamarin-forms-250d04e0bf50705b7fadfd1ff4a703b5607d22b8.tar.gz
xamarin-forms-250d04e0bf50705b7fadfd1ff4a703b5607d22b8.tar.bz2
[MacOS] Navigation Transition Style (#1168)
Diffstat (limited to 'Xamarin.Forms.Core')
-rw-r--r--Xamarin.Forms.Core/PlatformConfiguration/macOSSpecific/NavigationPage.cs56
-rw-r--r--Xamarin.Forms.Core/PlatformConfiguration/macOSSpecific/NavigationTransitionStyle.cs14
-rw-r--r--Xamarin.Forms.Core/Xamarin.Forms.Core.csproj2
3 files changed, 72 insertions, 0 deletions
diff --git a/Xamarin.Forms.Core/PlatformConfiguration/macOSSpecific/NavigationPage.cs b/Xamarin.Forms.Core/PlatformConfiguration/macOSSpecific/NavigationPage.cs
new file mode 100644
index 0000000..1e424b3
--- /dev/null
+++ b/Xamarin.Forms.Core/PlatformConfiguration/macOSSpecific/NavigationPage.cs
@@ -0,0 +1,56 @@
+´╗┐namespace Xamarin.Forms.PlatformConfiguration.macOSSpecific
+{
+ using FormsElement = Forms.NavigationPage;
+
+ public static class NavigationPage
+ {
+ public static readonly BindableProperty NavigationTransitionPushStyleProperty = BindableProperty.Create("NavigationTransitionPushStyle", typeof(NavigationTransitionStyle), typeof(NavigationPage), NavigationTransitionStyle.SlideForward);
+ public static readonly BindableProperty NavigationTransitionPopStyleProperty = BindableProperty.Create("NavigationTransitionPopStyle", typeof(NavigationTransitionStyle), typeof(NavigationPage), NavigationTransitionStyle.SlideBackward);
+
+ #region PushStyle
+ public static NavigationTransitionStyle GetNavigationTransitionPushStyle(BindableObject element)
+ {
+ return (NavigationTransitionStyle)element.GetValue(NavigationTransitionPushStyleProperty);
+ }
+
+ public static void SetNavigationTransitionPushStyle(BindableObject element, NavigationTransitionStyle value)
+ {
+ element.SetValue(NavigationTransitionPushStyleProperty, value);
+ }
+
+ public static NavigationTransitionStyle GetNavigationTransitionPushStyle(this IPlatformElementConfiguration<macOS, FormsElement> config)
+ {
+ return GetNavigationTransitionPushStyle(config.Element);
+ }
+ #endregion
+
+ #region PopStyle
+ public static NavigationTransitionStyle GetNavigationTransitionPopStyle(BindableObject element)
+ {
+ return (NavigationTransitionStyle)element.GetValue(NavigationTransitionPopStyleProperty);
+ }
+
+ public static void SetNavigationTransitionPopStyle(BindableObject element, NavigationTransitionStyle value)
+ {
+ element.SetValue(NavigationTransitionPopStyleProperty, value);
+ }
+
+ public static NavigationTransitionStyle GetNavigationTransitionPopStyle(this IPlatformElementConfiguration<macOS, FormsElement> config)
+ {
+ return GetNavigationTransitionPopStyle(config.Element);
+ }
+ #endregion
+
+ public static void SetNavigationTransitionStyle(BindableObject element, NavigationTransitionStyle pushStyle, NavigationTransitionStyle popStyle)
+ {
+ SetNavigationTransitionPushStyle(element, pushStyle);
+ SetNavigationTransitionPopStyle(element, popStyle);
+ }
+
+ public static IPlatformElementConfiguration<macOS, FormsElement> SetNavigationTransitionStyle(this IPlatformElementConfiguration<macOS, FormsElement> config, NavigationTransitionStyle pushStyle, NavigationTransitionStyle popStyle)
+ {
+ SetNavigationTransitionStyle(config.Element, pushStyle, popStyle);
+ return config;
+ }
+ }
+}
diff --git a/Xamarin.Forms.Core/PlatformConfiguration/macOSSpecific/NavigationTransitionStyle.cs b/Xamarin.Forms.Core/PlatformConfiguration/macOSSpecific/NavigationTransitionStyle.cs
new file mode 100644
index 0000000..06d80de
--- /dev/null
+++ b/Xamarin.Forms.Core/PlatformConfiguration/macOSSpecific/NavigationTransitionStyle.cs
@@ -0,0 +1,14 @@
+´╗┐namespace Xamarin.Forms.PlatformConfiguration.macOSSpecific
+{
+ public enum NavigationTransitionStyle
+ {
+ None,
+ Crossfade,
+ SlideUp,
+ SlideDown,
+ SlideLeft,
+ SlideRight,
+ SlideForward,
+ SlideBackward
+ }
+}
diff --git a/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj b/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj
index ebe3ca4..0522a92 100644
--- a/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj
+++ b/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj
@@ -464,6 +464,8 @@
<Compile Include="Xaml\ValueConverterProvider.cs" />
<Compile Include="PlatformConfiguration\macOSSpecific\Page.cs" />
<Compile Include="CompressedLayout.cs" />
+ <Compile Include="PlatformConfiguration\macOSSpecific\NavigationPage.cs" />
+ <Compile Include="PlatformConfiguration\macOSSpecific\NavigationTransitionStyle.cs" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<ItemGroup>