So, lots of people came to me asking whether there will be a WinRT version of Catel. First, I said we were seriously considering it. But lately the idea of not supporting it became more and more the idea I wanted to follow.
A little history
Instead of going with the flow, let’s first take a look at the history of Catel and why it has been created anyway. Mid 2010, I needed a (WPF) MVVM framework that would contain the following features:
- Support IDataErrorInfo for the view model so it could contain validation
- Nested user controls (because I couldn’t create big trees of hierarchy view models)
- Ease of development
With the latest I mean I didn’t want to go with the hype where everything needed to be “light”, simply because I always found myself writing extension methods and improving code. After I seriously considered Cinch, the moment I decided to write my own was when there was a “view model generator tool”.
When I started with MVVM and Xaml, all I did was WPF, which is simply the best implementation of Xaml for me. But, then people started asking: can you support Silverlight as well? Then the hell of missing features began. Lots of interfaces that Catel uses to allow property undo-ing such as INotifyPropertyChanging were not supported. It took me about 3 weeks to make sure everything in Catel also worked in Silverlight. Most of the time, I simply wrote the WPF features that were missing from Silverlight to allow the same functionality of Catel in Silverlight.
When WP7 came out, I was already prepared for the upcoming hell, but it wasn’t as bad as the transition from WPF => Silverlight. However, it again took me at least 2 weeks to create all the project and item templates and the Windows Phone specific implementations of the navigation services and tombstoning.
When the windows 8 beta came out, I quickly installed it to check out what has changed so I could convert Catel. But… it seems there are more, much more changes than I expected. For example, the whole reflection system has been changed.
Also, Catel supports a WeakEventListener and WeakActions for the MessageMediator, but this is simply not possible in WinRT because important reflection (although public) is not available.
What’s WinRT exactly?
After fighting with WinRT for about 4 weeks, I decided to take a look at the the current state and how much work there was in front of me. Then I realized I already left out the most important features (because I knew they wouldn’t compile anyway out of the box), but I couldn’t even get the Core libraries to compile (such as the WeakEventListener).
Then I thought: is Catel the way to go for WinRT anyway? And the answer is no. I see WinRT applications as a windows phone application without any specific LoB requirements. For example, checking the weather, checking facebook, etc. If you need a real LoB application, I still recommend to go for WPF or Silverlight which is the way to go.
Taking a look at the history of Catel, it was originally founded as a LoB framework, not as a framework to fit all purposes such as very light applications. I have decided to stick with the initial goal (targeting LoB applications) and the pain is just not worth the gain.
Is it definitely a no go?
For now: yes. If I am honest, apps written in WinRT are so light that a full-featured framework such as Catel is an overkill. You can better choose a light framework such as MVVM light which basically only supports property change notifications, a messenger and event to command.
I did write lots of code to allow reflection on both WinRT and not WinRT platforms in Catel , but it is not finished. Maybe, if Microsoft makes some changes so we can actually get, for example, the MethodInfo of a handler, we will re-evaluate the decision.