none
Visual Studio WPF designer and XAML RRS feed

  • Question

  • I've been doing win forms development for years, and now finally getting around to using WPF. 

    I'm finding as I go through various tutorials etc. that nearly all designer activities is done via manually typing the XAML code - which is quite helpful, but does leave a little bit of a gap in what I'm looking for.

    I have tried the traditional drag/drop way of doing things, and while I can get items onto the form - they do not seem to be going into the specific grid cells, or panels that I am intending to drop them onto.  This has left me pretty much just manually typing all of the XAML to get everything how I want it --- which is obviously cumbersome.

    I'm having one of those feelings of "I've got to be doing something wrong here".  I'm perfectly happy edit the XAML as needed to set properties, fine tune positioning etc., but being able to use the designer to at least get things onto the form with roughly the right position and sizing, and contained in the desired panel would be much more productive.

    I've also seen at least on one occasion somebody say specifically not to use the designer because it creates "... fixed size, fixed position content that doesn't work well when resizing the window or in different resolutions."

    So are people really manually typing out all of the necessary XAML by hand, or am I just missing something in how things are usually done?

    Monday, October 7, 2013 6:39 PM

Answers

  • I would suggest getting around Blend. I myself always typed XAML by hand, always. Mainly because VS the Designer has those problems you mentioned. Blend, in the other hand, is a usefull tool to design the application, but I've never used it because, you know, I needed to learn it, know how it works. It's pretty different from VS, because it was made to designer, not developers.

    However, once I watched this pluralsight course http://pluralsight.com/training/Courses/TableOfContents/blend4devs everything changed. I mean, how really, really easy is to create an animation in Blend, how was I not using it? Change the template, etc, so much easy with Blend.

    It worth the effort to learn it... you don't need to master it, after all, you are a developer, but it can be handy.


    Take a look at WPF FlashMessage
    About.me

    • Marked as answer by MattFielder Tuesday, October 8, 2013 5:28 PM
    Monday, October 7, 2013 8:00 PM

All replies

  • I would suggest getting around Blend. I myself always typed XAML by hand, always. Mainly because VS the Designer has those problems you mentioned. Blend, in the other hand, is a usefull tool to design the application, but I've never used it because, you know, I needed to learn it, know how it works. It's pretty different from VS, because it was made to designer, not developers.

    However, once I watched this pluralsight course http://pluralsight.com/training/Courses/TableOfContents/blend4devs everything changed. I mean, how really, really easy is to create an animation in Blend, how was I not using it? Change the template, etc, so much easy with Blend.

    It worth the effort to learn it... you don't need to master it, after all, you are a developer, but it can be handy.


    Take a look at WPF FlashMessage
    About.me

    • Marked as answer by MattFielder Tuesday, October 8, 2013 5:28 PM
    Monday, October 7, 2013 8:00 PM
  • There is a tool called Blend that allows Designers to design UI while Programmers should work on C# logic. Thats at least what Microsoft would like us to think thought in the end one guy does both.

    In Blend you can create things easier just by drag & drop behavior, like you are used to do in WinForms.

    Personally I dont like Blend much because the generated XAML file is full of things you dont need necessary.

    I like to have the complete control of how my Bindings, Controls, Resources, Panels are created though I sometimes use Blend too.

    If you dont care much what happens in XAML and you wish it to "just work" use Blend. Things get done faster and easier. Well its made for designers so that says everything. No offence guys. :)


    Monday, October 7, 2013 9:44 PM
  • I think you're correct that if the intention is just to create a form of rather simple layout, manually typing xaml is of lower productivity over a designer environment.

    However, during my previous years of working with wpf, such simple layout was really a small portion of the work, most of the time we were dealing with farily complex layout, in which case, I would rather type in the xaml which gives me "easier" control of the end result. And this is the purpose of wpf, to tackle those complex layout that otherwise very hard to achieve. Usually such layout is very hard to be described by simply drag-drop things onto the canvas.

    And to be frank, the major reason I'm not used to using a designer is all those bad experience Microsoft gave me with that irrational Visual Studio WPF designer. All kinds of crash and load failure led me into the habbit of just typing myself...


    Cheers, Daniel

    Tuesday, October 8, 2013 1:39 AM
  • @Daniel

    I like Designer in VS2012. Its pretty good so far.

    Tuesday, October 8, 2013 6:55 AM