Quantcast
Channel: patterns & practices: Prism
Viewing all articles
Browse latest Browse all 1878

New Post: WPF Ribbon control and commands to bind to the ribbon buttons inside each tab.

$
0
0
Hi isakavis,

If I understood correctly, you would have a TopRegion that shows each of the 3 tabs with their corresponding buttons as described in the structure like Save and Delete. Then, each Student or Course form would be displayed in the MainRegion.
Prism provides a simple way for communication between Regions by using the Event Aggregator. You may find how it works in the following Prism Guide chapter:

What you would need to do, is to bind the command buttons on their corresponding datacontext ViewModel just like any other command. So now, you would get the Save or Delete delegate commands publish and raise an Event on the EventAggregator, which it would be handled by the NewStudentViewModel or NewCourseViewModel event handler. In order to get the event handled, you would need the NewStudentViewModel and NewCourseViewModel subscribe to the corresponding Event that they would handle.

Notice that you may need different events for the Save and Delete command as each one would be handled in a different way.

I hope this helped you,
Regards.

Gabriel Ostrowsky
https://blogs.southworks.net/gostrowsky

Viewing all articles
Browse latest Browse all 1878

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>