Event bubbling changes in Silverlight 2.0 Beta 2 controls

I got another question about an issue in Silverlight 2.0 Beta 2. My collegue who is at the moment working on a video-player came to me and asked me why MouseLeftButtonDown- and Up didn't work on the slider and after 2 minutes of Googling we found out that he wasn't the only one faced with this problem. I started by Googling a bit more. Google is a developers best friend, but I couldn't find a solution. I found the reason for the problem, which I confirmed by checking the sliders code in Reflector. It is actually not a change in Silverlight as such, but in the controls that ship with Silverlight. For some reason Microsoft changed the implementation of their controls from Beta 1 to 2 and started letting each individual template part handle their on mouse events.So each part of the control encapsulates itsfunctionality nicely and sets the Handled-property of the EventArgs to true in their eventhandlers. This causes the event to stop bubbling and also renders the MouseLeftButtonDown, Up and so on the control more or less useless.

More...

And the solution is AssemblyPart...

A couple of weeks ago I had a look at a "module" for EPiServer CMS 5. It's going to be a part of our new package called Create+, and is called InteractiveScene. It basically gives the editor the ability to add and configure Flash-based content using EPiServer.

So, how does this end up being an entry on my blog? Well, it got me thinking. But first off I have is to say that I'm not here to replace InteractiveScene in any way. Neither am I here to tell you to do it. My concept builds on top of InteractiveScene, using it, not replacing it. It would of course be possible to use my thoughts to use this outside of EPiServer, in which case you would have to build the parts that I use from InteractiveScene manually.

So, back to the question, why am I blogging about a third party application for EPiServer? And why the @#!*% am I blogging about something that is using Flash? Everybody knows what I think about Flash... I love it, but don't know how to use it. The whole idea about how to use Flash is built around people who have minds that don't work in the same way as mine. So...thats actually the answer to the question. The "education" I got in "IS" was mostly based around the editors interface. All the cool development is actually made in Flash and just configured through EPiServer and thats no good for me. So I do of course have to find a way to tweak the system to use Silverlight instead of Flash.

More...

InitParams...a good way to start

A feature that is often missed in Silvelright is the possibility to give the application information at start up. Sort of like sending parameters to a constructor. This is done by passing values through the InitParams property. This feature has been available since Silverlight 1.0, but it has changed in 2.0. A 2.0 application is split in two parts, an Application class and a UserControl, and the InitParams is sent to the Application part. If you listen to the Application.Startup event, you will get hold of an StartupEventArgs object. This control contains a InitParams property containing the values sent to the control. The InitParams is a comma separated string when added in markup, but a IDictionary<string,string> when in code. How you pass it from the Application object to the UserControl is up to the developer. There are several ways of doing this. The simplest is to add a parameter to the contructor of the UserControl and pass in the Dictionary there. Another is to add a property on the Application class and "publish" the information there and let the UserControl fetch it.

This parameter is available to us if we use the <asp:Silverlight /> control. This makes it a very simple way for us to pass a certain amount of data from serverside aspx code to our clientside Silverlight application without having to use Ajax or webservices. Or maybe we could use the InitParams to tell our application the Uri to the webservice...

Globalization Demo from Developer Summit '08

At the EPiServer developer summit a couple of weeks ago I held a session about multilanguage support in EPiServer. For those of you who were there, you know why I've added this entry. I screwed up the demo completely and promised to upload the demo code to my blog. My, at that moment, not existing blog. So here it is. I've created a blog and added the code for download.

More...