开发者

Passing Variable Entity type to a ViewModel

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜