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
265
Switching tab views from MVVM viewmodel
posted

I have a XamTabControl with two tabs.

The first tab has a XamDataGrid with a collection of objects.  
The 2nd tab has a UserControl.  
When I select the row I want to view I set the datacontext of the usercontrol to a viewmodel then set SelectedIndex on the tab control to switch the view.

I expect the 2nd tab to come into view but nothing happens.

Is there something else I need to do to make this work?

Parents
No Data
Reply
  • 2180
    Offline posted

    Hello James,

    I followed the steps you suggested and was unable to reproduce the behavior you're describing.  I’ve created a sample with XamTabControl with two tab items and xamDataGrid in the first one. On selecting a row, the selected index is changed to the second tab.

    I have attached the sample project I used to test this.  Please test this project on your PC; whether or not it works correctly may help indicate the nature of this problem.

    If the project does not work correctly, this indicates either a problem possibly specific to your environment, or a difference in the DLL versions we are using.  My test was performed using version 17.1.20171.2073.

    If the project does show the product feature working correctly, this indicates a possible problem in the code of your application.  It will help if you can provide a small, isolated sample application that demonstrates the behavior you are seeing.

    Or, if this sample project is not an accurate demonstration of what you're trying to do, please feel free to modify it and send it back, or send a small sample project of your own if you have one.

    Please let me know if I can provide any further assistance.

    WpfApplication1.zip
Children