So I’m working on a Windows Store app, I want to create a Path object, but do it in code instead of in XAML because I’ll be adding more than one and a few other reasons. I figured this should be easy.

new Path { Data = ... } and Data property is a Geometry class - not a string like in XAML. Doh.Well, maybe not the end of the world. Let’s look at Geometry, but after a moment isn’t non-trivial to turn what I have into a small block of code. So then we ask Stackoverflow. There’s a great answer, use Geometry.Parse, which hides out in System.Windows.Media. No problem. Turns out you can’t access that namespace in store apps.

Yeah. Not helpful. But you can bind to the property once the object is created. This I was able to do.

So, Geometry.Parse is obviously used in Windows Store apps, but it’s not accessible. I’m not sure exactly why, but now I have a way to get around it. Maybe it will help you too.


Travis Smith

Polyglot software craftsman. Knowledge disseminator. Awesome maker.