I have a View for Insert an entity.
I want to edit the same entity and I want to reuse the same view for edit.
Now, How can I reuse the same view with different ViewModel for edit?
Why do you need two different view models?
I assume you're using the ViewModelLocator
, otherwise you wouldn't even have to ask the question.
So drop the view model locator here, navigate to the view model you want ( InsertViewModel
or EditViewModel
) and assign the same view to both view models via data template.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.