[c#] Transitioning from Windows Forms to WPF


1 Answers

I know this is an old question but for the benefit of anyone else looking at this, I think I should redress the balance a bit - reading some of the other answers, I get the feeling that some of the 'don't use the designer' sentiment comes from not using it properly. This tutorial is quite good to get you going and answers some of the criticisms in the other posts.

For instance, you can switch from the Winforms-like margin-based layout that is the default when you drop a control, to a more WPF-ish style by right-clicking and selecting 'Reset Layout'

This video covers similar ground.

I still prefer the VS2010 designer on balance - VS2013 seems to be a bit buggy when dragging and dropping onto TabItems **, (which my current project uses a lot) - but the VS2013 Document Outline view lets you move things around in that view too, which can be a real plus.

Really, though, to get the most out of WPF and xaml you need to be reasonably fluent in both the designer view and the xaml view and switching between them; if you shy away from the designer, you are missing out on something that can help you a lot.

** Edit - although this seems to have been improved in Update 3 for VS 2013, and in previews of VS14, to date I still get odd behaviour at times.

Question

For a long time now, I have been stuck with Windows Forms development (started with VB6, and has continued through to C# .NET 4.5), and I have pretty much hit the limit of what Windows Forms can do, both using pure .NET, and special effects with Native Code.

I know that WPF is the future (for now), and Windows Forms is slowing becoming a deprecated technology.

I have tried to learn WPF and XAML, but I get stuck right at WPF's new designer...It really seems very difficult to use in comparison to the Windows Forms designer...of course...this is just a learning curve, and at some point I plan to go on a course to learn WPF properly.

In the meantime, I want to know if there are any alternatives to .NET's WPF designer, that are more suited to Windows Forms developers?




First of all, in WPF (XAML) in Visual Studio deisgner, you should always use the xaml code to build you UI and do not drag and drop you control! You need to keep your code clean. You can use Expression Blend to help you, it's more graphic oriented with drag and drop, but it's not free.

It's not a big learning curve, but I think you should learn how to do your xaml by hand instead of searching for alternative.




Related