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
205
Set Selected Tab From ViewModel
posted

Hello.  I am implementing an app based on the MVVM pattern.  One of my controls has a dockmanager with a tabgrouppane.  I need to be able to change the active tab based on a property in my viewmodel.  Here's what the xaml looks like:

ObjectDataProvider def:

<Window.Resources>
        <ResourceDictionary>

            <ObjectDataProvider x:Key="odpWizard" ObjectType="{x:Type ViewModel:WizardViewModel}" IsAsynchronous="True" />...

TabGroupPane def:

<igDock:TabGroupPane x:Name="tabGroup1" SelectionChanged="tabGroup1_SelectionChanged" DataContext="{Binding Source={StaticResource odpWizard}}" SelectedIndex="{Binding ActiveTab}">...

ViewModel def;

private int _activeTab;

public int ActiveTab
        {
            get { return _activeTab; }
            set { _activeTab = value; OnPropertyChanged("ActiveTab");  }
        }

 

What I'm missing is how to change the active tab from the ViewModel.  Thanks for the help.

Parents Reply Children