I have just started learning MVVM. I\'ve made the application from scratch by following this MVVM tutorial (I highly recommend it to all MVVM beginners out there). Basically
This is made tricky because of the DoubleClick event. There are a few ways to do this:
2 and 3 might be more pure, but frankly, 1 is easier, less complex, and not the worst thing in the world. For a one-off case, I'd probably use approach #1.
Now, if you changed your requirements to use, say, a hyperlink on each item, it would be easier. Start out by naming the root element in your XAML - e.g., for a Window:
Now, in the DataTemplate for your ListBox items, use something like this:
The ElementName binding lets you resolve the OpenEntryCmd from the context of your ViewModel, rather than the specific data item.