开发者

Passing Variable Entity type to a ViewModel

开发者 https://www.devze.com 2023-03-14 02:19 出处:网络
I have a ViewModel for an edit screen in a SL4 R开发者_Go百科IA Service solution that looks like this:

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

0

精彩评论

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