Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Path.Data from string and resources #698

Merged
merged 2 commits into from
Mar 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/ReleaseNotes/_ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
* Fixed invalid iOS assets folder. `ImageAsset` nodes must not be `<Visible>false</Visible>` to be copied to the generated project.
* Make CollectionViewSource.View a proper DependencyProperty (#697)

* Fixed support for string support for `Path.Data` (#698)

## Release 1.43.1

Expand Down
7 changes: 7 additions & 0 deletions src/SourceGenerators/XamlGenerationTests/PathTest.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@
d:DesignHeight="300"
d:DesignWidth="400">

<UserControl.Resources>
<x:String x:Key="myPath">M 10,100.5 C 10,300 300,-200 300,100 Z</x:String>
</UserControl.Resources>

<Grid>
<Path Stroke="Black"
Fill="Gray"
Data="{StaticResource myPath}" />
<Path Stroke="Black"
Fill="Gray"
Data="M 10,100.5 C 10,300 300,-200 300,100 Z" />
Expand Down
5 changes: 5 additions & 0 deletions src/Uno.UI/UI/Xaml/Media/Geometry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 0 additions & 11 deletions src/Uno.UI/UI/Xaml/Media/Geometry.wasm.cs

This file was deleted.