Going further...

Castle/MVC - Using dependency injection with global action filters and LifestylePerWebRequest

Castle/MVC - Using dependency injection with global action filters and LifestylePerWebRequest

The initial problem is injecting dependencies in global action filters in MVC (I am considering MVC4).

Global action filter are instantiated and registered in the application start event (Application_Start).

For whatever reason you may have conponents in the container that you want to have once per web request (PerWebRequestLifeStyle) and you want to inject in a global action filter. Or you have components that depend on other ones which lifestyle is per web request, it`s basically the same case.

Silverlight carousel (almost) without code

Silverlight carousel (almost) without code

The idea was to build the carousel (and especially the animations) by using at least code as possible by using Triggers and Behaviors available trough Expression Studio (and especially Expression Blend).

I think the result is pretty good but lacks very good performance. Somehow animating the carousel items trough Storyboards seems a little slow. The approach was to use RenderTransform/CompositeTransform since using the PlaneProjection was even slower.

Modifying the providers collection at runtime

Modifying the providers collection at runtime

Usually it's not necessary to modify the providers collection as you specify it trough web.config file so why will you run into this problem?

Well, assume that you need to inject some objects into the providers (like a users or roles service) at runtime from a IoC container like Unity. Or you just need some control over how the providers are instantiated.

T4 templates at work - minify and compress js and css

T4 templates at work - minify and compress js and css

T4 template engine is a powerful tool that may prove to be very useful in some cases.

I think an appropriate use-case might be when compressing and minifying your javascript and css files (and maybe combining them) before you're ready to deploy your web application. And maybe do this from Visual Studio directly at a click of a button (yes, the transform all templates button)!

Flickr photos

Loading flickr photos...
Tracking