Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
415
How can I get the active tab in my ViewModel?
posted

I have a TabGroupPane with 3 tabs in it.  Since each tab shows a different UserControl, and my usercontrols are backed by ViewModels, I need to know in each VM if it's tab is currently active or not.

Basically, I dont want hidden viewmodels to do any work if something is selected in my application.

Ideally I would have a property in each VM, IsActiveTab that gets updated on tab changes.  Maybe I just need to make this a DP and bind it to the SelectedItem?

Not sure what is the best way to do this...

Thanks!

Parents
No Data
Reply
  • 54937
    Offline posted

    Perhaps someone else will have a suggestion with an approach they use but perhaps the easier thing to do would be to just base it on the IsVisible property of your view/control?

Children
No Data