wpf - Communicating between Views -


my wpf app has 2 views , each view has own view model. 1 view shows customer names on left side. second view shows list of items ordered selected customer(on first view) on right side. data in second view should changed automatically based on selection on first view(customer names view). suggestions. in advance.

what you're describing called 'master-detail' binding. general idea left hand customer-list view (the master view) bound viewmodel comprising list of customerviewmodels, , selected customerviewmodel. changing selected item in customer list update selected customerviewmodel in viewmodel. each of customerviewmodel should have collection of purchaseviewmodels detail customer's orders. right hand side view (the detail view) should set it's datacontext selected customerviewmodel, , use list of purchases.

here eerily well-suited project use example: http://www.codeproject.com/articles/332615/wpf-master-details-mvvm-application


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

.htaccess - Matching full URL in RewriteCond -