79700017

Date: 2025-07-13 14:18:14
Score: 0.5
Natty:
Report link

For Prism users:

@Diego Torres gave a nice answer in this thread. His xaml can be used directly in a MVVM situation with the Prism framework, with the following code in the ViewModel:

public DelegateCommand<object> SelectedItemChangedCommand { get; private set; }

In the constructor of your ViewModel:
SelectedItemChangedCommand = new DelegateCommand<object>(SelectedItemChanged);

The method to be executed:

        private void SelectedItemChanged(object args)
        {
            // check for the datatype of args and
            // Do something!
        }
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @Diego
  • Low reputation (0.5):
Posted by: josh