summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Xaml
diff options
context:
space:
mode:
authorStephane Delcroix <stephane@delcroix.org>2017-01-12 21:05:41 +0100
committerJason Smith <jason.smith@xamarin.com>2017-01-12 12:05:41 -0800
commitb6cb64e4930de9b16309f2d30c6bb0a2177048fd (patch)
treeae15f36d3e0e60cac6305f90520ad778de9c6ee3 /Xamarin.Forms.Xaml
parent3af99cbbe145a876cc9839af0adead83695b5445 (diff)
downloadxamarin-forms-b6cb64e4930de9b16309f2d30c6bb0a2177048fd.tar.gz
xamarin-forms-b6cb64e4930de9b16309f2d30c6bb0a2177048fd.tar.bz2
xamarin-forms-b6cb64e4930de9b16309f2d30c6bb0a2177048fd.zip
[C] new OnPlatform mechanism (#658)
* [C] Obsolete TargetPlatform * [Xaml] support and test the new syntax * blind fix windows platforms
Diffstat (limited to 'Xamarin.Forms.Xaml')
-rw-r--r--Xamarin.Forms.Xaml/ValueConverterProvider.cs2
-rw-r--r--Xamarin.Forms.Xaml/XamlParser.cs7
2 files changed, 6 insertions, 3 deletions
diff --git a/Xamarin.Forms.Xaml/ValueConverterProvider.cs b/Xamarin.Forms.Xaml/ValueConverterProvider.cs
index 0f3871b5..57570803 100644
--- a/Xamarin.Forms.Xaml/ValueConverterProvider.cs
+++ b/Xamarin.Forms.Xaml/ValueConverterProvider.cs
@@ -15,4 +15,4 @@ namespace Xamarin.Forms.Xaml
return value.ConvertTo(toType, minfoRetriever, serviceProvider);
}
}
-} \ No newline at end of file
+}
diff --git a/Xamarin.Forms.Xaml/XamlParser.cs b/Xamarin.Forms.Xaml/XamlParser.cs
index 594d1c6b..e5c49804 100644
--- a/Xamarin.Forms.Xaml/XamlParser.cs
+++ b/Xamarin.Forms.Xaml/XamlParser.cs
@@ -263,9 +263,12 @@ namespace Xamarin.Forms.Xaml
XmlnsHelper.ParseXmlns(kvp.Value, out typeName, out ns, out asm, out targetPlatform);
if (targetPlatform == null)
continue;
- TargetPlatform os;
- if (Enum.TryParse<TargetPlatform>(targetPlatform, out os) && os != Device.OS)
+ try {
+ if (targetPlatform != Device.RuntimePlatform)
+ prefixes.Add(prefix);
+ } catch (InvalidOperationException) {
prefixes.Add(prefix);
+ }
}
return prefixes;
}