I have a TabControl region, where i am adding new tabs throw RequestNavigate method. Everything’s working fine. But problem is, that new tabs are placed on the last position to the right. But i need to add them right next to active tab. So when i have 10 open tabs, but active is first tab – i want to add new opened tab to second place and move other tabs to right. Thx a lot
I have a TabControl region, where i am adding new tabs throw RequestNavigate method.
Share
Ok, thanks to Sam’s solution https://stackoverflow.com/a/4285764/1027262 I figured out that there is a SortComparison property of IRegion class that is responsible for sorting views inside region.
So my View classes implements ISortableView interface, that contains
This SortIndex is then used for sorting Views in region. SortComparison method looks like this:
Then I had to make service class, that is responsible for managing Views index. Index of parent view i am sending throw OnNavigatedFrom method of INavigationAware interface. But be aware of setting SortIndex in OnNavigatedTo method. This method is called AFTER region sort its views.