How to get selected list view item for context menu click event?

You are mixing you methods... you can run an event or you can use a command, but not so much both together.

Up vote 0 down vote favorite share g+ share fb share tw.

I need help to get Selected list view item details, when context menu assigned to list view items is clicked. This is a click event code private void MenuItem_Click(object sender, RoutedEventArgs e) { //what needs to de here? } I wrote this piece of code in my view model, but it doesn't trigger on execute method RunCommand = new DelegateCommand(OnRunCommand, CanRunCommand); private void OnRunCommand(object obj) { // use the object here... } private bool CanRunCommand(object obj) { return true; } Let me know, how can I handle this situation.

Any examples related to same will be appreciated. Thanks wpf link|improve this question edited 2 hours agoH.B.43k61645 asked 3 hours agorajcool1111.

You are mixing you methods... you can run an event or you can use a command, but not so much both together. What you want is to bind the command: there are many wonderfull sources of info out there... here is one.

I want to do more on clicke event of context menu. – rajcool111 2 hours ago any advice for below method? Private void MenuItem_Click(object sender, RoutedEventArgs e) { //what needs to do here?

} – rajcool111 2 hours ago you can run the Execute method kinda like this:((MyModle)DataContext).RunCommand. Execute( ); – Muad'Dib 1 hour ago.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions