In a dialog from my application, I have an observable collection (stored somewhere else) bound to a list of tabs. When I close and reopen the dialog, the currently selected tab gets lost and winds up to the be the first one. How do I set up my tabs so that the selected tab persists?
I had the impression that the observable collection had “current item” property, but that doesn’t seem to be case. I’ve looked at ItemCollection and CollectionView, which do have a current item property, but I’m not sure if that’s that I’d be interested in.
In the
Closingevent of your dialog, save away the currently selectedTabItem.In the
Loadedevent of your dialog, simply say:Code-behind is the easiest way to accomplish this.
ObservableCollectionis not going to help you.