Thank you for pointing out the omission in the example. Indeed some of the code is missing there.
This example shows how the context menu can be used declaratively in Xaml and it includes some switching over the string in the header of an item which is simple enough but should not find its way in production code.
I am attaching an example that shows how the context menu can be build from commands exposed by the ViewModels in the application. It is MVVM-friendly but it does involve more abstraction.
Hopefully you will find it useful.
the Telerik team