Prism is so amazing that I can' t help loving it.
Yesterday, I came across a binding problem. Here is my scenario:
I have two regions in my Shell, one menuRegion on the top and another is a TabControl called mainRegion on the bottom.
In the menuRegion, I place two buttons: Save and SaveAll.
In the mainRegion, I have two TabItems: Tab1 and Tab2. Each of the TabItems contains a "View". These views are binding with ViewModels accordingly. Both ViewModel has a bool type property "IsDirty".
My requirement is:
1. "Save" Button can only save the content of the current active view. If current active view "IsDirty", "Save" is enabled otherwise it is disabled. When "Save" is clicked, it can use "SaveCommand" from viewmodel
of active view to perform saving.
2. "SaveAll" Button can save the content of all dirty view. When any of the view "IsDirty" SaveAll is enabled otherwise it is disabled. When "SaveAll" is clicked, it can use "SaveCommand" from viewmodel of all "dirty"
views to perform saving one by one.
It seems like a MDI-style window. But I have no idea how to create one using Prism (4.0). Looking forward to your advice.