Sharing our knowledge

Michael Sync

Unity Application Block (Unity) for Silverlight and StopLight QuickStart

July 11th, 2008 by Michael Sync

UPDATED: Unity for Silverlight, two Samples and Unit Test projects are on Codeplex now.

Yes. I have successfully ported Unity for Silverlight 2 beta2. I’d like to say “thank you” to Chris for answering my question in Unity Forum. You can download the source code of Silverlight-compatible Unity and StopLight Quick Start samples from this post.

Download

History

As I mentioned in this post, I have joined Prism Contrib open source project for porting Composite WPF (Prism) for Silverlight Application. Jared Bienz mailed us that he wants someone to research Unity for Silverlight. So, I started finding a way to port Unity for Silverlight application. I know that Chris wrote very great post for Silverlight+Unity in his blog since last two or three months but he didn’t release the sourcecode for a couple of reasons that he mentioned as below ~

I’m not going to be posting this code just yet, for a couple of reasons. The first is that the project isn’t good enough yet; I really need to reorganize the solution I have right now, for example. The second reason is that this is NOT a supported scenario, and I don’t want to give the impression it is. So you’ll never see this on the Unity codeplex site, for example. Maybe it could be put on UnityContrib eventually?

Anyway, just wanted to let folks know it’s not only possible, it was actually pretty easy!

But for me, I would like to get Unity ported before attending the meeting with Prism Contrib. I think that there might be some people who wanna play around with it so I’m sharing the code with you all. Note that you shouldn’t use those codes in production enviornment. Just play around and give me some feedbacks so we can do a bit better when we are working with Prism Contrib. I would like to say that I’m not very good at design and pattern thing but I’m learning and hope my “design and pattern” skills will be imported soon.

Limitations

  • Unity.Configuration is not available for now. If you have good suggestions for that, please drop a line in this post.
  • Non-public can’t be injected. Yes. It sucks. but this is the limitation of Silverlight. As Silverlight runs on partial trust environment, it’s limited for security reason.

Maybe more but I don’t know yet. :)

Reference:

5 Responses

  1. MichaelD! Says:

    YES! You just saved me some precious weekend time for doing this on my own. :) THANK YOU!

  2. Post: 140 - Mirrored Blogs Says:

    [...] App Bloxk for SL and Stoplight QuickStarthttp://michaelsync.net/2008/07/11/unity-application-block-unity-for-silverlight-and-stoplight-quicks…LineRider with SL 2 and Windows Live [...]

  3. Ezequiel Jadib’s Blog » Silverlight & Composite Application Guidance (Prism): Spike published Says:

    [...] didn’t ship the Unity Application Block, so I recommend you to see Michael Sync’s post in order to have Unity working on [...]

  4. Michael Sync » Unity for Silverlight, Two Samples and Test Projects are on Codeplex now. Says:

    [...] Unity Application Block (Unity) for Silverlight and StopLight QuickStart [...]

  5. WPF/Silverlight Insiders » Tutorials: Introduction of Silverlight Says:

    [...] your .NET class library in Silverlight, you will have to port it to Silverlight (like I did for Unity Framework before Microsoft release Unity 1.2 that supports Silverlight). How can we port .NET Library to [...]

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.