TabControl Navigation MVVM

Hi, i am using your tabcontrol to make an application navigation system in WPF MVVM like Google Chrome (note: i am not making an internet browser).

Capture.PNG

So, what is have is a HomeView(UserControl) and 3 Views CustomersView, EmployeesView and ProductsView and 3 view model for each view like CustomerViewModel, EmployeesViewModel, and ProductsViewModel.

what i want is whenever the application launch i want tabcontrol to have one tab with content (HomeView) see in above fig, and when i click on Customers buton i want CustomerView to load in the same tabitem.

User can add new tab and when new tab is created HomeView shows in the newly created tab item, and now the user can can open EmployeesView by clicking Employees button.


7 Replies 1 reply marked as answer

GT Gokul Thanudhas Syncfusion Team June 14, 2022 06:11 AM UTC

Hi Fahad,


We have created a simple sample based on your requirement. Please refer to the attached sample for your reference.


Regards,

Gokul T



Attachment: TabControl_3d962438.zip


FA fahad June 14, 2022 11:47 AM UTC

Hi Gokul, thank you for taking the time to answer my question.


The sample you provided was exactly what i needed, but with UserControls, i have modified the sample to work with usercontrols instead of just showing textblock.


But i have one more query related to the sample to ask if you would be so kind to answer.


Q: How would i know (i.e when clicking on the customer button) ​if a customer tab is already opened, I don't want user to open multiple customer tabs, and if the (i.e when clicking on the customer button) ​customer tab is already opened the already opened customer tab should be Selected


Attachment: TabControl_736c5503.zip


GT Gokul Thanudhas Syncfusion Team June 15, 2022 02:05 PM UTC

Hi Fahad,


We are validating your reported query. We will validate and update you in two business days. We appreciate your patience until then.


Regards,

Gokul T.



FA fahad June 17, 2022 11:04 AM UTC

Any update?



GT Gokul Thanudhas Syncfusion Team June 17, 2022 04:14 PM UTC

Hi Fahad,


We have created a sample based on your requirement. Please refer to the attached sample for your reference.


Regards,

Gokul T.


Attachment: TabControl_736c5503_(2)_e2ce500f.zip

Marked as answer

FA fahad June 18, 2022 08:59 AM UTC

Hi Gokul, the sample you provided is exactly what is wanted.

thank you so much.



GT Gokul Thanudhas Syncfusion Team June 20, 2022 01:10 PM UTC

Hi Fahad,


We hope that your issue is resolved. Please let us know if you need any other assistance. We are happy to assist you.


Regards,

Gokul T.


Loader.
Up arrow icon