Skip to main content
Microsoft Silverlight
Home Forums Silverlight Programming Programming with .NET - General Help:how to conver String to PathGeometry
4 replies. Latest Post by fullsailrick on February 24, 2009.
(0)
snowwaft
Member
0 points
3 Posts
02-24-2009 9:13 PM |
Hi
In wpf,i can use PathFigureCollectionConverter to convert a string to PathGeometry:
convertor.ConvertFrom("M100.5,110L100.5,141L50.5,142L50.5,113z")
however,in silverlight,there is no such class,so how can i conver a string to a PathGeometry?
thanks!
fullsail...
Contributor
3699 points
829 Posts
02-24-2009 9:42 PM |
I think you have to set the Data property in XAML only.
02-24-2009 9:54 PM |
Here is an example: http://blogs.microsoft.co.il/blogs/alex_golesh/archive/2008/06/16/path-data-dependency-property-initialization-from-string.aspx
but i don't think the speed is quick
TomGiam
Participant
852 points
246 Posts
02-24-2009 10:36 PM |
This may do what you want.
http://www.codeplex.com/StringToPathGeometry
Tom
02-24-2009 10:57 PM |
Yeah, I was just looking at the WPF code and was about to add that it wouldn't be that big of a deal to write a parser.