I\'m trying to get a context menu within a ListBox ItemTemplate to call a method on the parent view model, passing in the item that was clicked on as a parameter. I have thi
Using the information I found on the Caliburn Micro site I modified your XAML to look like this:
.. text..
And my view model:
public List ListBoxItems { get; set; }
public ShellViewModel()
{
ListBoxItems = new List {"One", "Two", "Three"};
}
public void Open(object source)
{
MessageBox.Show((string) source);
}
Open was successfully called with the appropriate strings from the list box.