Skip to main content

Help:how to conver String to PathGeometryRSS Feed

(0)

snowwaft
snowwaft

Member

Member

0 points

3 Posts

Help:how to conver String to PathGeometry

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!

fullsailrick
fullsail...

Contributor

Contributor

3699 points

829 Posts

Re: Help:how to conver String to PathGeometry

I think you have to set the Data property in XAML only.

snowwaft
snowwaft

Member

Member

0 points

3 Posts

Re: Help:how to conver String to PathGeometry

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
TomGiam

Participant

Participant

852 points

246 Posts

Re: Help:how to conver String to PathGeometry

This may do what you want.

http://www.codeplex.com/StringToPathGeometry

 

Tom

fullsailrick
fullsail...

Contributor

Contributor

3699 points

829 Posts

Re: Help:how to conver String to PathGeometry

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.

  • Unanswered Question
  • Answered Question
  • Announcement