summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core/ListStringTypeConverter.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Core/ListStringTypeConverter.cs')
-rw-r--r--Xamarin.Forms.Core/ListStringTypeConverter.cs16
1 files changed, 16 insertions, 0 deletions
diff --git a/Xamarin.Forms.Core/ListStringTypeConverter.cs b/Xamarin.Forms.Core/ListStringTypeConverter.cs
new file mode 100644
index 00000000..647f0143
--- /dev/null
+++ b/Xamarin.Forms.Core/ListStringTypeConverter.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Linq;
+
+namespace Xamarin.Forms
+{
+ public class ListStringTypeConverter : TypeConverter
+ {
+ public override object ConvertFromInvariantString(string value)
+ {
+ if (value == null)
+ return null;
+
+ return value.Split(new [] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(s => s.Trim()).ToList();
+ }
+ }
+} \ No newline at end of file