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

TabControl and MVVM

2 Answers 75 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Jeff Ballard
Top achievements
Rank 1
Jeff Ballard asked on 11 Apr 2010, 02:08 AM

I'm using Silverlight 4 and VS 2010 (both RC) and RIA services. I'm also new to Silverlight...

I have a page that has a Telerik RadTabControl on it. It will always have six tabs, i.e. the number of tabs is not data driven. The tabs are used for various admin functions. One tab for managing users with a grid and edit view, another that will have basic company info - just a few text boxes on it. The other tabs are similar to these two.

I'm trying to use MVVM and can't decide on the best approach. I don't think I want one big ViewModel that handles all six tabs - that would be big, ugly and harder to maintain. Any recommendations for approaches on how to break this out? Perhaps have a ViewModel for each tab? If so, how would I (generally) go about implementing something like that? Or is there another approach that makes more sense?

Thanks,

Jeff

2 Answers, 1 is accepted

Sort by
0
Valentin.Stoychev
Telerik team
answered on 12 Apr 2010, 02:57 PM
Hi Jeff Ballard,

You can keep it simple and use set each of the tab item content into a UserControl.

Sincerely yours,
Valentin.Stoychev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Jeff Ballard
Top achievements
Rank 1
answered on 13 Apr 2010, 05:39 PM
Valentin,

Thanks for the reply.  I'd reached the same conclusion that it should work.

I'm also going to look at using Prism so that I can use their commanding for the tab and other controls.  But as for the tab content, I am going to put that in a user control.

Thanks,

Jeff

Tags
TabControl
Asked by
Jeff Ballard
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
Jeff Ballard
Top achievements
Rank 1
Share this question
or