2

I used WPF very little before and some stuff seemed very different to achieve. Coming from a winforms background, what things will seem different and take you a while to figure out.

Off top of my head, I remember not being able to specify which nodes are selected in a treeview control the way it's done in winforms, if I am not wrong.

Jon B
  • 51,025
  • 31
  • 133
  • 161
Joan Venge
  • 315,713
  • 212
  • 479
  • 689
  • If you populate TreeView manually (as you would in WinForms), then you can walk the TreeViewItem nodes and assign to the IsSelected property to select one of them programatically. – Daniel Earwicker Mar 13 '09 at 16:39
  • The very first item in the SO FAQ says questions should be "detailed and specific". This is neither IMHO. – Binary Worrier Mar 13 '09 at 16:39
  • OK, as Jobi Joy points out, this is a dupe of http://stackoverflow.com/questions/129772/how-to-begin-wpf-development – Jon B Mar 13 '09 at 17:05

4 Answers4

2

I remember the whole MVVM principle..

But its okay now.. we are bffs now! :)

Arcturus
  • 26,677
  • 10
  • 92
  • 107
2

Oh, where to begin? WPF and WinForms seem very different to me. The concept of defining layouts using markup is quite different, although similar to web development. The fact that you need to make an explicit choice of a layout container (for multiple elements) is novel. I remember trying to add a bunch of elements directly within a Window and getting very confused...

I think to take advantage of all that WPF has to offer, you need to have a WPF mindset. For example, you don't have to use styles, templates, and bindings, but those concepts are where the power of WPF lies.

Daniel Pratt
  • 12,007
  • 2
  • 44
  • 61
  • 1
    WPF seems like a step backwards after using a visual form designer. – Powerlord Mar 13 '09 at 17:16
  • @R. Bembrose: I sort of agree, sort of don't. As with all things WPF, it's...different. I find that working in markup (with a preview) encourages me to make layouts that "flow" naturally, rather than basing everything on fixed positions. The end result is a better interface. Of course, Blend... – Daniel Pratt Mar 13 '09 at 18:33
1

As Daniel stated WPF is different and it needs a different Mindset. You have to forget all the UI side assumptions you made/learned while doing Winforms or other conventional UI side development I have comeacross so many similar kind of questions in this site. Some interesting once are listed bellow. You can find many here.

Community
  • 1
  • 1
Jobi Joy
  • 49,102
  • 20
  • 108
  • 119
0

For your selected node in a treeview the ModelView ViewModel approach works well. People have worked out good design patterns now for this kind of thing making the process much more easy.

Quibblesome
  • 25,225
  • 10
  • 61
  • 100