Skip to content

Dynmically loading XAML content

March 14, 2012

So I have had a few tight deadlines with work over the last month working many 12 hour days, but now I’m free and travelling for the next 4 months. So while I have continued to work on the project I havent really been discussing my progress. I have a few break through and a few dead ends which taught me a lot although I dumped a lot of code.

But now that I feel that the engine is matching reasonably accurately on small data sets in real-time, I wanted to get a more end to end experience before I spend more time scaling out the system. So I have a known match, let’s get something on the screen. This is something that has been in the back of my mind for a while, I wanted it to be dynamic content that did not have to be preloaded on the phone. Ideally something that the phone could say to a web service I have found this object, you got anything we can show on the screen that is informative ?

So in comes XamlReader.Load(), the answer to my needs. It takes a string of XAML code and spits out XAML parsed code which appears to work for my little test demo. I have simple test class that spits out an Ellipse wrapped in a Grid that gets moved across the screen each time it matches per cycle of the engine. Nothing to exciting but an adequate proof of concept. I found the code here http://blogs.msdn.com/b/christophputz/archive/2010/10/24/windows-phone-7-dynamically-load-xaml.aspx and the author clearly knows more about it then me at the moment. One thing that is essential is having the top-level element contains “xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation.

So I guess I had better get working on writing a web service to store the xaml animations, it also builds a platform to create a more scalable image matching engine……

So little time, so much code to write…..

Advertisements
No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: