Loading libraries run-time

code, silverlight — Szili @ 12:16 pm

I’m working on an application with the ability to upload and run Silverlight 1.1 gadgets. This means my program needs to be able to load assemblies in run-time.

After several tests and an e-mail exchange with an MS Evangelist it seams like it’s impossible.

UPDATE: Here is how I managed to do it. The trick is that the xaml downloads and loads its assembly automatically.
void DownloadXamlFile()
{
GadgetXamlDownloader.Completed +=
new EventHandler(GadgetXamlDownloader_Completed);
GadgetXamlDownloader.Open(
“GET”, new Uri(“./Gadgets/TestGadget/Page.xaml”, UriKind.Relative));
GadgetXamlDownloader.Send();
}


void
GadgetXamlDownloader_Completed(object sender, EventArgs e)
{
ObjectFromXamlString(GadgetXamlDownloader.ResponseText);
}


void
ObjectFromXamlString(string XamlString)
{
DependencyObject Gadget = XamlReader.Load(XamlString,true); //Namescoping is turned on
Gadget.SetValue(
Canvas.TopProperty,this.Height/2-(Gadget as Canvas).Height/2);
Gadget.SetValue(
Canvas.LeftProperty, this.Width / 2 - (Gadget as Canvas).Width / 2);
this.Children.Add(Gadget as Visual);
}

My old failed tests after the jump, they might be useful.

(more…)

Pictoplasma Animation Festival

Uncategorized — Szili @ 10:40 am

Pictoplasma Animation Festival

An extended weekend of outstanding character design in animation, motion graphics and music visuals on the big screen,
with artist presentations, lectures and VJ parties.

Add the event to your Google Calendar or to your Facebook Events and see you there between 23th and 25th of November!

If you don’t have time to come, you can still order their most excellent book The Character Encyclopaedia which made me a fan in the first place.

My work and Madrid

personal, silverlight — Szili @ 6:46 pm

Monkey Invasion!

draw, silverlight — Szili @ 11:02 pm

Monkey Invasion screenshot

Grab and throw the monkeys before they reach the paintings!

My friend and I wrote this Silverlight game for an MS competition.

Check out the game here:
http://www.szili.net/sourcesofhope

And if you like it please vote for it:
http://www.flickr.com/photos/szili/1518833612/

Thanks, Szili

PS. The source code will be available next week.

UPDATE1: There seams to be a problem with the Silverlight Streaming service. I will check the code as fast as I can.

UPDATE2: Streaming had a short hick up but it seams ok now.

UPDATE3: The source. A junk and in Hungarian. There will be an Update4 with a polished English version with comments and stuff..

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
(c) 2010 Szili | powered by WordPress with Barecity