This is a migrated thread and some comments may be shown as answers.

Tabs use view/viewmodels for each???

1 Answer 244 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 17 Jan 2017, 05:05 PM

Hello All,

     I'm trying the tabcontrol for the first time, and  am very curious as to do I create a new view/viewmodel pair for each tab or handle everything in the first pair where the overall top tabcontrol is based???  I think that I would like to have separate ones for ease in development but I haven't figured out as to how to assign them to the tab items...  Or is it just better to have in all in one?

 

What am I missing?  

 

Any help would be greatly appreciated,

Thanks in advance,

Kevin Orcutt

 

 

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 20 Jan 2017, 07:56 AM
Hello Kevin,

Thank you for your interest in RadTabControl for WPF.

Determining whether to use a single view model or define a separate one for each RadTabItem depends on the exact project needs. I cannot confirm which would be the better approach. However, if you plan to operate with various data source, having a separate view model might be a more reasonable solution. A possible approach for this would be to have a main view model which holds an instance of each separate view model. Then, you should be able to set the DataContext of each RadTabItem to be the needed view model.

Hopefully, this helps.

Regards,
Stefan X1
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
TabControl
Asked by
Kevin
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or