This is a migrated thread and some comments may be shown as answers.

Question about adding a button and MVVM

0 Answers 75 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 31 Jan 2017, 11:39 PM

Hello All,

    I am using WPF and MVVM.   I have a observable collection of objects that I am displaying in the grid.   I am trying to add a new column at the beginning of the gridview that has a button in it .  This button needs to fire off a command in my ViewModel.  In the command's execute method, I need to edit some of the properties of the entity that that row represents in my observable collection.  I am assuming that I'll need to pass some sort of parameter to the command to send in either the row contents or some event args for the button being clicked...   But I'm not exactly sure what I need to do.    I would interested the most in doing this WITHOUT any code-behind in the View, and do this some way with the XAML and ViewModel code, trying to keep in the MVVM frame of mind...  Any help will be greatly appreciated!

Thanks in advance,

 

Kevin Orcutt

No answers yet. Maybe you can help?

Tags
GridView
Asked by
Kevin
Top achievements
Rank 1
Share this question
or