I am creating a small app, where I will open a new child tab only if no other tabs are open.
Say, I have a button, when I click that, I open a tab (a child view in marked region). If I already have a tab open, I will not open any tabs.
Is there any way to check, whether my region is already containing a view or not?
Any pointers/links appreciated.
P.S. Pls let me know, if question is clear enough:P
Based on my understanding of your scenario, you could check the views holded in a region by simply obtaining an instance of the RegionManager and then ask for the active views on that region.
IRegionManager rm = ServiceLocator.Current.GetInstance<IRegionManager>();
var views = rm.Regions["MySpecificRegion"].ActiveViews;
and then you could check any condition by iterating
Also, you can read more about Prism Regions in the following links:
Let me know if this information helps you.