Why are events and commands in MVVM so unsupported by WPF / Visual Studio?
- by Edward Tanguay
When creating an WPF application with the MVVM pattern, it seems I have to gather the necessary tools myself to even begin the most rudimentary event handling, e.g.
AttachedBehaviors I get from here
DelegateCommands I get from here
Now I'm looking for some way to handle the ItemSelected event in a ComboBox and am getting suggestions of tricks and workarounds to do this (using a XAML trigger or have other elements bound to the selected item, etc.). Ok, I can go down this road, but it seems to be reinventing the wheel. It would be nice to just have an ItemSelected command that I can handle in my ViewModel.
Am I missing some set of standard tools or is everyone doing MVVM with WPF basically building and putting together their own collection of tools just so they can do the simplest plumbing tasks with events and commands, things that take only a couple lines in code-behind with a Click="eventHandler"?