tags:

views:

261

answers:

4

I constantly feel that designing a form layout in WPF is like designing a websites layout. Is there a tool that'll let me set things visually? I'm coming from mainly a WinForms environment and it's tiresome to spend 2 hours laying out a form design and having it not come out exactly how you want it. Tweaking numbers, etc. is very tiresome.

Is there a way for me to design things more visually, a-la WinForms?

+6  A: 

You can use Expression Blend to design WPF forms/templates. It is nicer than the VS designer, but... it cost money.

** EDIT: I've heard that resharper has a good XAML support features, although didn't try it myself, it might help accomplish staff faster (better intellisence)

Dani
I can get that for free because of my college partnership. So that program let's me design forms more visually instead of hammering XAML code?
Sergio Tapia
also, no source control integration
Muad'Dib
Blend is designed to run side-by-side with Visual Studio, so it is possible to use Visual Studio's source control integration while working in Blend.
Ray Burns
We also have this problem with no SVN integration, so we do it manually currently.hope MS or someone else add this feature.
Dani
You have to install a patch to get source control integration working, but if you open a project that's under source control it should prompt you.
ChrisF
+3  A: 

If you really want to design your forms with WPF the way you used to in WinForms, simply use a Canvas as your main container and place your controls with absolute coordinates. I don't know if MS C# Express 2008 has a visual editor, so you don't have to tweak any number.

But by using a Canvas you loose an important feature that is resizable forms. If you position your controls absolutely, there is no way to adapt the content to the window size.

That is where WPF has things in common to designing websites, but with more flexibility. You have to learn all the available panels and when to use them. My favorite is DockPanel often used as to topmost panel. Then you nest different panels to build your form.

There are usually very few dimensions to set. I mostly set MinWidth for columns or MinHeight for rows. Each control has its margins set in styles, so everything layouts smoothly.

If you have a concrete problem to layout, I'll be happy to assist you.

Mart
Mart: Your answer makes it sound like you are seriously suggesting developers use Canvas for form layout in their WPF applications. Surely you jest! :-) I suspect you intended to say it is possible to do it the old way but there is a better way. If so, I suggest you clarify this in your answer text (perhaps "If you really really really want to ..., it is possible to ...")
Ray Burns
You are right, using a Canvas is not THE right way. But as Papuccino1 is at the beginning of his learning curve, this can be a transitional solution for him not to give up using WPF.
Mart
I agree. Or he could use <Grid> which may be better than Canvas because you can start by treating the one big cell as a canvas but later start using real layout without disrupting anything.
Ray Burns
I'd just like to mention that as of now, I'm more than comfortable designing form the CORRECT way. I can't believe I even asked this question. :D The learning cure is definitely worth it. Push on and you'll get through it.
Sergio Tapia
+1  A: 

Use Expression Blend as Dani mentioned. You can have the same solution opened in VS as well as in EB at the same time, as they can share files well. This approach was desiged to help separate designers and programmers work, but keep code common.

twk
+1  A: 

The point is that the best intrinsic features of Wpf aren't easily manageable via any visual way. If you prefer a WYSIWYG way, then you may use WinForms.
The real different approach within Wpf is the functional way, i.e. templates and those feature are hard to manage with a visual editor.
I always have used Visual Studio Express + Xaml and there is not anything will stop you.

venezia
I disagree. I would say Expression Blend does a great job of helping you work with the "best intrinsic features" of WPF features in a WYSIWYG way, including templates and data binding. Some things can't be done visually, but most can and should.
Ray Burns