summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core
diff options
context:
space:
mode:
authoradrianknight89 <adrianknight89@outlook.com>2017-01-04 13:11:09 (GMT)
committerRui Marinho <me@ruimarinho.net>2017-01-04 13:11:09 (GMT)
commit24d8dab89772eb5c8d5fa504d47870d8769dc365 (patch)
tree621cbd9ae3e67f41211679e7cd38b91de4b16e9e /Xamarin.Forms.Core
parent58909e205a6b10fd1ed834c0ea5a37950504d035 (diff)
downloadxamarin-forms-24d8dab89772eb5c8d5fa504d47870d8769dc365.zip
xamarin-forms-24d8dab89772eb5c8d5fa504d47870d8769dc365.tar.gz
xamarin-forms-24d8dab89772eb5c8d5fa504d47870d8769dc365.tar.bz2
[iOS] Platform specifics for controlling Picker SelectedIndex change behavior (#540)
* picker selected index could change when picker view is dismissed * use enum
Diffstat (limited to 'Xamarin.Forms.Core')
-rw-r--r--Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/Picker.cs30
-rw-r--r--Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/UpdateMode.cs8
-rw-r--r--Xamarin.Forms.Core/Xamarin.Forms.Core.csproj2
3 files changed, 40 insertions, 0 deletions
diff --git a/Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/Picker.cs b/Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/Picker.cs
new file mode 100644
index 0000000..74b7db6
--- /dev/null
+++ b/Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/Picker.cs
@@ -0,0 +1,30 @@
+´╗┐namespace Xamarin.Forms.PlatformConfiguration.iOSSpecific
+{
+ using FormsElement = Forms.Picker;
+
+ public static class Picker
+ {
+ public static readonly BindableProperty UpdateModeProperty = BindableProperty.Create(nameof(UpdateMode), typeof(UpdateMode), typeof(Picker), default(UpdateMode));
+
+ public static UpdateMode GetUpdateMode(BindableObject element)
+ {
+ return (UpdateMode)element.GetValue(UpdateModeProperty);
+ }
+
+ public static void SetUpdateMode(BindableObject element, UpdateMode value)
+ {
+ element.SetValue(UpdateModeProperty, value);
+ }
+
+ public static UpdateMode UpdateMode(this IPlatformElementConfiguration<iOS, FormsElement> config)
+ {
+ return GetUpdateMode(config.Element);
+ }
+
+ public static IPlatformElementConfiguration<iOS, FormsElement> SetUpdateMode(this IPlatformElementConfiguration<iOS, FormsElement> config, UpdateMode value)
+ {
+ SetUpdateMode(config.Element, value);
+ return config;
+ }
+ }
+} \ No newline at end of file
diff --git a/Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/UpdateMode.cs b/Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/UpdateMode.cs
new file mode 100644
index 0000000..c429a16
--- /dev/null
+++ b/Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/UpdateMode.cs
@@ -0,0 +1,8 @@
+´╗┐namespace Xamarin.Forms.PlatformConfiguration.iOSSpecific
+{
+ public enum UpdateMode
+ {
+ Immediately,
+ WhenFinished
+ }
+} \ No newline at end of file
diff --git a/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj b/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj
index a6540c1..dd01d4b 100644
--- a/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj
+++ b/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj
@@ -94,10 +94,12 @@
<Compile Include="PlatformConfiguration\iOSSpecific\BlurEffectStyle.cs" />
<Compile Include="PlatformConfiguration\iOSSpecific\Entry.cs" />
<Compile Include="PlatformConfiguration\iOSSpecific\NavigationPage.cs" />
+ <Compile Include="PlatformConfiguration\iOSSpecific\Picker.cs" />
<Compile Include="PlatformConfiguration\iOSSpecific\StatusBarTextColorMode.cs" />
<Compile Include="PlatformConfiguration\iOSSpecific\Page.cs" />
<Compile Include="PlatformConfiguration\iOSSpecific\StatusBarHiddenMode.cs" />
<Compile Include="PlatformConfiguration\iOSSpecific\UIStatusBarAnimation.cs" />
+ <Compile Include="PlatformConfiguration\iOSSpecific\UpdateMode.cs" />
<Compile Include="PlatformConfiguration\iOSSpecific\VisualElement.cs" />
<Compile Include="PlatformConfiguration\WindowsSpecific\MasterDetailPage.cs" />
<Compile Include="PlatformConfiguration\WindowsSpecific\CollapseStyle.cs" />