4

Some of our developers don't like the commanding in MVVM because there is no support in VS2010 IDE to help you navigate from the Command binding in xaml to the actual code implementing the behavior. With code-behind, you can right-click and select Navigate to Event Handler. We're starting a new project with about 4 developers but we typically divide the work into functional areas, not Ux and business logic so each developer is working in the xaml and the viewmodel/domain to implement the functionality needed.

Do you guys consider this a hindrance to adoption of MVVM?

Do any of the frameworks help in this regard?

Are there any tips/tricks that facilitate that navigation need?

Maybe we should try splitting work between Ux and app logic?

Thanks for any ideas.

tobewan
  • 189
  • 2
  • 9

2 Answers2

4

Sounds like whining to me, rather than actual criticism of Commands or MVVM. It doesn't take much effort to implement and use MVVM. I haven't ever used a framework to implement MVVM.

I always put my Commands at the top of my viewmodel classes, followed by public properties, the constructor and functions.

If you're having trouble finding them in your viewmodel, maybe your file is too long. Is it over 1500 lines? If so consider breaking it up into multiple classes.

sourcenouveau
  • 29,356
  • 35
  • 146
  • 243
  • 1
    +1 for managing the size of the view models; if the VM is too big to easily navigate, then it probably means the View and VM can be decomposed into smaller pieces, which is better for unit testing anyway. – Dan Bryant Dec 03 '10 at 17:24
0

None of the frameworks help with this problem because it's not usually a problem. If you want to use MVVM, I would suggest reworking the team so that the work is split the way that MVVM suggests.

I work primarily in VMs and I never have any trouble with XAML. ...Because I almost never touch it. The inverse is true for our guy who designs our views. He works almost entirely in XAML and doesn't write much C# code.

thepaulpage
  • 4,614
  • 2
  • 25
  • 39
  • 1
    I doubt the OP will get very far proposing MVVM **and** restructuring the team's responsibilities. – Aardvark Dec 03 '10 at 17:03
  • We're using MVVM for data binding but jury is out on adopting Commanding hence the question. We are a small close-knit team and may give Ux vs business logic a try on this project. We just haven't done it before. thanks. – tobewan Dec 03 '10 at 17:37
  • @aardvark Why not? part of the reason to use MVVM is to have those responsibilities structured along those lines. I feel like they kind of go together – thepaulpage Dec 03 '10 at 18:03
  • 1
    @tobewan wait, you're data binding, but you're not using commands... If that's what you want to do, you might as well just stick with doing all of your work in the code behind because it would be simpler, and you would get back that little bit of navigation. If MVVM is beneficial and worth using, it's worth the extra "trouble" – thepaulpage Dec 03 '10 at 18:38