Click here to Skip to main content
15,917,808 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I'm new in CAB programming and MVP patterns.
I know the main idea.

My Q:
I'm writing user managment system for my CAB-application.
I have main View (UserListView) with userDataGrid and 3 Buttons (AddUser, ModUser, DelUser)
The second View (UserEditView) has user details etc.. And we can save new user or update existing user data in this view.

When I click first button I want have a blank form (UserEditView)
When I click second button I want have form with loaded user data ready to be edited.

Now, how to call the seccond View (UserEditView) depending on button click in UserListView (first or second)? How to pass param or object(user) to View?

Thanks for reply.
Sory for my poor english :(
Posted
Updated 2-Mar-10 9:37am
v2

karol.pawelski wrote:
How to pass param or object(user) to View


It is done through interfaces.

For a sample, see here[^].
 
Share this answer
 
You could add a “UserId” property to the ViewModel, if the property is null then the user is new and you’ll show a blank form, if the property has a value then you need to load the correct user and show the data in the form.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900