I have a ViewModel for an edit screen in a SL4 R开发者_Go百科IA Service solution that looks like this:
public GenericEditViewModel (int intA, string strB, RIA_EntityA entityObj)
{
......
}
I am using this same viewmodel to edit several entities, such that the type of entityObj is not constant. How can I use the same ViewModel Constructor to handle calls for, say, RIA_EntityB
, RIA_EntityC
.......?
I tried generics, but that did not seem to work?
Thanks !
It would be better to use command and command's parameter instead of VM's constructor.
Also you can look this discussion
精彩评论