I've implemented the MVVM pattern and have some viewModels that are bound to tab pages on a tab control.
When a specific object type changes (i.e. from Car myVehical, to Bike myVehical), then i want the relevant tab page to become selected.
Thanks.
I've implemented the MVVM pattern and have some viewModels that are bound to tab pages on a tab control.
When a specific object type changes (i.e. from Car myVehical, to Bike myVehical), then i want the relevant tab page to become selected.
Thanks.
Rather than using a tab control, you can use DataTemplates. The view itself will get set automatically based on the object you set as the content.
You could hack it by using a custom IValueConverter. You could then bind TabControl.SelectedIndex to a property on your view model and use the converter to convert from the type (Car or Bike) to an index. The value converter code would have to be updated when you change the tabs.
How can I access, to set visible or hidden, or active or inactive a specific tabItem?
Thanks in advanced