开发者

WPF Command parameter

I am creating a user control in MVVM. I have a datagrid in my user control. When i click a button in the user control i want to pass the parameters as selected items in the datagrid. I have declared the two controls(datagrid and button in two different data template) now when i use command parameter for the button and specify the element name and path(as property in datagrid - selectedItems).. i am getting null in the viewmodel command ... I have two question

  1. do i need to开发者_C百科 bind the command parameter in a different way,? when my data grid in different datatemplate please confirm
  2. how to access collection of selected rows in datagrid using Relaycommand.. pl provide code to do that.. im stuck when declaring and defining that type of command
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜