From 25ee3cc11355440fc28840408508a8f1830157d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Laban?= Date: Mon, 18 Mar 2019 14:14:58 -0400 Subject: [PATCH] Add support for Path.Data from string and resources --- .../XamlGenerationTests/PathTest.xaml | 7 +++++++ src/Uno.UI/UI/Xaml/Media/Geometry.cs | 5 +++++ src/Uno.UI/UI/Xaml/Media/Geometry.wasm.cs | 11 ----------- 3 files changed, 12 insertions(+), 11 deletions(-) delete mode 100644 src/Uno.UI/UI/Xaml/Media/Geometry.wasm.cs diff --git a/src/SourceGenerators/XamlGenerationTests/PathTest.xaml b/src/SourceGenerators/XamlGenerationTests/PathTest.xaml index d82a6517365e..92aafc7c840e 100644 --- a/src/SourceGenerators/XamlGenerationTests/PathTest.xaml +++ b/src/SourceGenerators/XamlGenerationTests/PathTest.xaml @@ -8,7 +8,14 @@ d:DesignHeight="300" d:DesignWidth="400"> + + M 10,100.5 C 10,300 300,-200 300,100 Z + + + diff --git a/src/Uno.UI/UI/Xaml/Media/Geometry.cs b/src/Uno.UI/UI/Xaml/Media/Geometry.cs index 353985f1de2e..ab6a5d7d2a52 100644 --- a/src/Uno.UI/UI/Xaml/Media/Geometry.cs +++ b/src/Uno.UI/UI/Xaml/Media/Geometry.cs @@ -30,6 +30,11 @@ public Geometry() InitializeBinder(); } + public static implicit operator Geometry(string path) + { + return Parsers.ParseGeometry(path, CultureInfo.InvariantCulture); + } + #region Transform public Transform Transform diff --git a/src/Uno.UI/UI/Xaml/Media/Geometry.wasm.cs b/src/Uno.UI/UI/Xaml/Media/Geometry.wasm.cs deleted file mode 100644 index 6b55236b89fe..000000000000 --- a/src/Uno.UI/UI/Xaml/Media/Geometry.wasm.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Windows.UI.Xaml.Media -{ - partial class Geometry - { - - public static implicit operator Geometry(string data) - { - return new GeometryData(data); - } - } -}