Tabs use view/viewmodels for each???

2 posts, 0 answers
  1. Kevin
    Kevin avatar
    6 posts
    Member since:
    Dec 2016

    Posted 17 Jan 2017 Link to this post

    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



  2. Stefan
    Stefan avatar
    1073 posts

    Posted 20 Jan 2017 Link to this post

    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.

    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.
Back to Top