tag:blogger.com,1999:blog-2557671457352222943.post1856989309980753915..comments2023-10-10T11:24:47.869+01:00Comments on Neil Mosafi: A basic IoC container for SilverlightNeil Mosafihttp://www.blogger.com/profile/15344599241111572695noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-2557671457352222943.post-54589989570660142932008-06-09T09:38:00.000+01:002008-06-09T09:38:00.000+01:00Fantastic - good spot! I'll check it out.Fantastic - good spot! I'll check it out.Neil Mosafihttps://www.blogger.com/profile/15344599241111572695noreply@blogger.comtag:blogger.com,1999:blog-2557671457352222943.post-31804249135082077422008-06-09T09:20:00.000+01:002008-06-09T09:20:00.000+01:00I came across Bloom a silverlight IoC container on...I came across Bloom a silverlight IoC container on codeplex. Looks like silverlight is finally getting the support it needs to build apps with modern practices.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2557671457352222943.post-11636649528716833202008-04-18T13:24:00.000+01:002008-04-18T13:24:00.000+01:00Hi FredYeah the way you need to do it is to create...Hi Fred<BR/><BR/>Yeah the way you need to do it is to create a "shim" class in your codebehind, such as:<BR/><BR/>public abstract class MyViewBase : UserControlView<MyViewModel><BR/><BR/>public partial class MyView : MyViewBase, IMyView<BR/><BR/>Then in your XAML file, you can set the root element to<BR/><BR/><MyViewBase x:Class="MyView"<BR/><BR/>You also need to add an attribute to the AssemblyInfo.cs<BR/><BR/>[assembly: XmlnsDefinition("http://schemas.microsoft.com/client/2007", "MyNamespace")]<BR/><BR/>Hope that makes sense... I will explain all this in more detail in upcoming posts<BR/><BR/>Regards<BR/>NeilNeil Mosafihttps://www.blogger.com/profile/15344599241111572695noreply@blogger.comtag:blogger.com,1999:blog-2557671457352222943.post-68473897181445688802008-04-18T11:20:00.000+01:002008-04-18T11:20:00.000+01:00Thanks for that interesting post!Your base view Us...Thanks for that interesting post!<BR/><BR/>Your base view <I>UserControlView</I> uses a generic constructor. I've heard about troubles some people have with base classes other than UserControl in Silverlight 2. How can you handle that in a derived View in XAML? By using the TypeArguments? <BR/><BR/>FredAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-2557671457352222943.post-89813285802348229222008-04-16T12:56:00.000+01:002008-04-16T12:56:00.000+01:00Thanks for the feedback Nate, and that's great to ...Thanks for the feedback Nate, and that's great to know! It will be nice to have a "fully featured" Ioc framework such as Ninject working under Siverlight.<BR/><BR/>Now all we need is a Mock object framework...<BR/><BR/>NeilNeil Mosafihttps://www.blogger.com/profile/15344599241111572695noreply@blogger.comtag:blogger.com,1999:blog-2557671457352222943.post-5303981182226810102008-04-16T12:30:00.000+01:002008-04-16T12:30:00.000+01:00Interesting post. I'm planning to support Silverli...Interesting post. I'm planning to support Silverlight in version 1.0 of Ninject; likely it will be more similar to the .NET compact framework build, which is also missing things like DynamicMethod and StackTrace. Stay tuned. :)Nate Koharihttps://www.blogger.com/profile/12052323511010110369noreply@blogger.comtag:blogger.com,1999:blog-2557671457352222943.post-19403877853148691512008-04-14T22:10:00.000+01:002008-04-14T22:10:00.000+01:00Thanks Stuart. I hope you have some luck using it...Thanks Stuart. I hope you have some luck using it and if you have any questions please don't hesitate to ask.<BR/><BR/>Regarding more example posts, I am in the process of putting something together, which I hope to post up here soon.<BR/><BR/>NeilNeil Mosafihttps://www.blogger.com/profile/15344599241111572695noreply@blogger.comtag:blogger.com,1999:blog-2557671457352222943.post-84365827372393460132008-04-14T20:28:00.000+01:002008-04-14T20:28:00.000+01:00Thanks for posting this Neil, looks very useful. D...Thanks for posting this Neil, looks very useful. Do you have any plans to post an example using Silverstone? ie use the Ioc as well as the MVC stuff together.<BR/><BR/>Stuart.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2557671457352222943.post-19524389051068965062008-04-14T11:11:00.000+01:002008-04-14T11:11:00.000+01:00Not exactly. There are ways of doing it but it's ...Not exactly. There are ways of doing it but it's not really worth the effort.<BR/><BR/>For example you could put the configuration into a hidden input field and then use the HTML Bridge in Silverlight to load the configuration<BR/>from the field.<BR/><BR/>I don't personally see the need to have to set an IoC using a configuration file - what is the real advantage?<BR/><BR/>NeilNeil Mosafihttps://www.blogger.com/profile/15344599241111572695noreply@blogger.comtag:blogger.com,1999:blog-2557671457352222943.post-31491003723414668622008-04-14T11:04:00.000+01:002008-04-14T11:04:00.000+01:00Very nice, I likey! Can you have configuration fil...Very nice, I likey! Can you have configuration files with Silverlight?OneLinerhttps://www.blogger.com/profile/06603185434194850114noreply@blogger.com