Interception of calls to constructor aspect
Add an aspect type to allow to intercept constructor calls and replace them by a factory method.
Planned for PostSharp 5.1.
Whoa! I did not see this until now, due to not getting any notifications!
The scenario is simple, really. Xaml only allows objects with parameterless, default constructors, and this feature would be a great way to work around this restriction. With this aspect, I could define my Xaml in such a way that it reads like regular Xaml, but I could also have the item get created through IoC/Service location (factory method) when it gets constructed, instead. There are factory mechanisms in (WPF) Xaml, but they are messy and verbose. Using an aspect, I could make this transparent and stick with cleaner Xaml.
FWIW, I am speaking in Xaml as a serialization mechanism, and not a way of describing UI as most developers associate its use. I use it to describe everything in my application, including module initializers, as provided by your awesome platform. :) Here's an example Xaml-defined module initializer:
@Mike-EEE - could you describe your scenario for XAML and serialized entities?
This is a wicked idea. This would be incredibly useful for Xaml/serialized entities as well.
We didn't decide to implement so no ETA.
Over 4 months and still no ETA ?