Feb 052013
 

How many times you had to build a console application that must receive various input arguments? I know I did a lot of times – from small development tools to various applications. And every time there was a big PITA to handle the input arguments. Every time I have reinvented the wheel, every time I had to check for the arguments, parse them, output various help messages etc.

Continue reading »

Jan 152013
 

This a post that I’ve postponed for over one month now and the main reason is that I have mixed feelings about it and it’s hard to settle on something.

Just to give some context, I am a long-term .NET developer. I’ve been working with technologies such as Silverlight and WPF for the past years on a day-to-day basis so my first natural instinct has been to go for the XAML development for WinRT. I also have relative well knowledge of Javascript, but that is not a platform that I really enjoy working on at a professional level.

The Good

The good part about XAML development on WinRT is that if you come from Silverlight or WPF, you are already in touch with the technology, the framework around it and the whole development ecosystem. With no WinRT knowledge, I was able after a few hours of studying the templates that come with Visual Studio to jump directly into the problem and work my way in there.

Another good thing is that Visual Studio 2012 now comes together with Blend and this allows you to switch easily between the two and to handle both development and design-related tasks with ease.

I have to give a big plus to the fact that VS2012 comes with a set of pre-defined project templates that get you started quickly and also gives you a straight up contact with the new user experience that Windows 8 tries to push to the market.

The framework is designed in such a way that you can make your application fit with relative ease to all the differences between resolutions, sizes and orientation of the devices. Also it is very easy to access hardware functionality from the code.

Another plus is the decision of providing standard contracts for standard operations. Search, share, settings and other functionality is regulated using standard contracts so that all applications have a common look & feel that makes it natural for end users to jump into them.

I also like the fact that the applications make good use of the horizontal scrolling, which I think is a better use of the screen real estate.

Things like asynchronous API design, integrated licensing & windows store API as well as many others are really welcome features that show a more modern approach to modern application development.

There are more things to say here, but overall I thin the good things are the ones you don’t notice so much, but instead they just blend in into your day-to-day work.

The Bad

On the bad side, I have a lot of things to comment. First of which is the fact that I was really disappointed with the maturity of the framework. My initial impression was that this is a beta or a preview of the framework.

Silverlight has matured at an incredible pace and has become a mature full-featured environment. I cannot say the same for WinRT XAML.

First of all, the list of available controls is really a joke. There are standard controls which are available in the main SL/WPF toolset and you can’t find them in WinRT XAML library. I am not talking about fancy things, but basic ones such as a Date/Time picker control (or calendar for that matter), auto complete boxes.

A design decision which really makes me unhappy (and not just me) is the removal of the grid concept from the UI. While this might make sense for twitter clients or other social or multimedia oriented applications, business apps make heavy use of this usage pattern. This is because in real life there are a lot of things that need to be displayed in tables. In my case I had to work on an invoicing application. Try to design an invoice, which is by nature a list of tabular data, without using tables. I really feel that Microsoft should come back to this decision and add support for such data, otherwise they have lost by default a lot of their customer and developer base.

Another remarkably frustrating design decision is the lack of support for binding validation. While this was one of the great things about Silverlight and WPF, in WinRT XAML you have to handle validation and feedback completely manually (this is actually the reason why I wrote the previous article regarding WinRT validation).

There are a lot of small details which are missing and cause a lot of frustration. In the Silverlight world, developers have asked several years Microsoft to include an event which gets triggered when the DataContext changes. Finally they got it. Well guess what? There is no such event in WinRT XAML. While there are workarounds, this is very frustrating.

The context menu system is also implemented in a very non-developer-friendly way. The context menu is shown asynchronously, which is ok, but you don’t really have control over its positioning and size.

Finally, one of the biggest things that the framework is missing is database support. There is a library for working with SQLite, but it has the main drawback that it makes your application platform-dependent. There are also some other options such as a database engine that uses serialization for storage. This one has been a life-saver for me, although it suffers a lot of issues caused by async file system access.

In ending, the other thing that is annoying is the lack of consistency in the XAML API. While it is maybe a bit more clear than the Silverilght/WPF api, you will find a different format for specifying assembly and namespace references, as well as the format used for specifying resource paths.

Overall, I would say that the lack of controls is the most annoying one. Of course you can create your own. Of course that there are open source projects out there that provide various control libraries (I will cover a few of them in the next posts), but for someone that just wants to start doing something, this can be a big road block.

In the next post I will provide a list of links to various tools and libraries that hopefully will make your life easier when developing WinRT XAML apps.

Oct 162012
 

UPDATE: due to many requests, I have compiled the code below into a project that you can download from here: Validation.zip

To my big surprise the Microsoft team behind the WinRT XAML framework has decided not to include the built-in support for validation that exists in the WPF and Silverlight frameworks. Anyway, for anyone that needs an alternative, I have created a set of helper classes to make things easier.

 Implementing INotifyDataErrorInfo validation in Windows 8 WinRT XAML applications

Continue reading »

Apr 092012
 

In Visual Studio 2010, depending on the project type you get different options when you want to add new items to a project. If you have created a class library and later you figure out that you want to add WPF custom controls, you will need to change the project so that it supports this functionality.

Continue reading »

Oct 052011
 

In one of my recent projects I have reached the need to validate that I have all dependencies correctly registered in my UnityContainer. For those that are not familiar with Unity, it is a dependency injection container that allows constructor, property and method call dependency injection.

You can get more information about how Unity works and also download the latest release from Codeplex: http://unity.codeplex.com/

 Validating UnityContainer configuration

 

Continue reading »

Aug 242011
 

There are situations in which you need to do some processing when an event fires but you don’t want to do it every time if the event happens in a very short time interval. Such a situation can occur for example when handling MouseMove events – you want to do the processing when the mouse stops for a certain amount of time, but not for every intermediate position of the mouse.

 Reusable deferred action execution mechanism

Continue reading »

Aug 022011
 

Snoop A must have for any WPF developer As a WPF developer, I often find myself trying to debug the visual structure of my applications or to find out why something doesn’t work as expected. The Visual Studio debugger can help up to a certain point, but for runtime visual debugging it lacks the necessary features. Luckily, there is an awesome free tool that you can use for this – Snoop. The tool itself is very straightforward – you select your running application press a button and you can see the whole visual tree:

Continue reading »

Feb 122011
 

 

Pentru cei care nu au reusit sa ajunga la intalnirea Ronua Sibiu din Noiembrie, puteti gasi aici slide-urile de la prezentarea pe care am tinut-o legat de dezvoltarea de aplicatii complexe Silverlight si/sau WPF folosind Microsoft Patterns & Practices PRISM. In slide-uri sunt prezentate recomandarile ce constituie PRISM, precum si elemente arhitecturale ce pot fi folosite in realizarea aplicatiilor composite.

Continue reading »

Feb 122011
 

 

In this blog post I am presenting a simple validation framework that you can reuse in your code. Also I will be putting here two code snippets that will make it easier for you to add preconditions to your code.

When Visual Studio 2010 was first realeased, one of the features that I expected the most was code contracts. Unfortunately after including them in one of my large projects, it became more clear that at this moment it is not mature enough to be used. Build time increases rapidly when having a lot of source code files and using the code contracts. Enabling static contract validation is even worse, almost doubling the build time on an average development machine.

All that being said, I really like the code contracts way of specifying preconditions. Most of the time I don’t use post-conditions, but being able to specify validation criteria means that the code will be more robust.

Continue reading »