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.
- SLUnity.zip (2.26 MB) – Unity For Silverlight + StopLight Quick Start Sample
- SLUnity_Src.zip (797 KB) – Unity For Silverlight Source Code
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.
- 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. :)