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

TabControl,Prism, MEF

12 Answers 260 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
mitja zigante
Top achievements
Rank 1
mitja zigante asked on 21 Mar 2011, 01:45 PM
Hi,
I am looking for an example where TabControl, Prism and MEF are used.
I am interested how to dynamically add new tabs.

Could you please provide some example.

Thanks,
Mitja

12 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 24 Mar 2011, 01:34 PM
Hi mitja zigante,

Please examine the attached sample and let us know if it helps or if you need more info.

Best wishes,
Tina Stancheva
the Telerik team
0
mitja zigante
Top achievements
Rank 1
answered on 29 Mar 2011, 12:59 PM
Thanks for the example.It works fine.

Regards,
Mitja
0
adao
Top achievements
Rank 1
answered on 17 Jun 2011, 12:10 AM
Great code!
0
Alan
Top achievements
Rank 1
answered on 03 Jul 2012, 03:13 PM
I would like to use this project as a basis for how to create a tab control that dynamicly loads a module into a new tab and removes the module when the tab is closed.

I have the latest version of Telerik Silverlight test controls installed on my computer.  I have used the update wizard on the project created from the .zip file, but when I try to run the app from VS, I get an error that tells me about having local copy true only for the MEF Extensions of the shell project.  Since this is already the configuration, I don't know how to proceed from here to get the app to run.

Is this the right sample to use or should I be looking for something else?  If it is the right sample, how do I resolve the error?
0
Petar Mladenov
Telerik team
answered on 06 Jul 2012, 08:53 AM
Hi Alan,

As I managed to understand you have a version conflicts when trying to run the project Tina previously posted here. If so, have you tried removing the MEF dlls from her project and use the ones installed on your machine? Is it possible for you to elaborate more on this, any snapshots would be highly appreciated.

Kind regards,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Alan
Top achievements
Rank 1
answered on 07 Jul 2012, 04:49 PM
Thanks for the reply.  I was able to resolve the version issue.

With reference to my second question, is the referenced sample program a good fit for this requirement:
  1. On a master page, use a TabControl to present views.  One TabItem per View.
  2. Lazy load modules on demand when a View within needs to be navigated to.
  3. When a Tab is closed, remove the view.
  4. Use MVVM and MEF.
  5. Use EF to interface with an existing SQL Database.
0
Petar Mladenov
Telerik team
answered on 11 Jul 2012, 11:23 AM
Hello Alan,

 I think the project Tina referenced is a good starting point. However, I cannot say for sure that this is the best starting approach for your requirements. You can start implementing your scenario and we can assist you when you have issues or how-to questions with RadTabControl. 

Kind regards,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Darryl
Top achievements
Rank 1
answered on 29 Nov 2012, 05:19 AM
This is a great example; however I would like to request a little help on setting up commands from a RibbonBar to focus a specific tab on one of the modules tab controls.  We have been able to get to the View holding the tab control but need some help selecting the tab.

Thanks
0
Petar Mladenov
Telerik team
answered on 03 Dec 2012, 08:11 AM
Hi Darryl,

 The project in this thread uses a RadTabControl so I assume you use similar project and RadRibbonBar/RadRibbonView. A quick note here - RadRibbonBar is obsolete now and it will be removed from our control suite in Q1 2013. We strongly suggest you to use RadRibbonView instead.
 Usually, if you have a MainViewModel bound to RadTabControl / RadRibbonView you can have int property that is bound to the RibbonView's SelectedIndex property. Could this fit in your scenario? A command that sets a property from a ViewModel ?

All the best,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Darryl
Top achievements
Rank 1
answered on 05 Dec 2012, 06:47 PM
Hi Petar,

You are correct, in my project I am using both the RadTabControl and the RadRibbonBar/RadRibbonView (In the process of migrating code).  We currently are not using the MainModelView as the hub in the project and we think that may have been part of the issues when trying to connect to the modules from the Shell in the main project directly.  Thank you for the help.

Best Regards,
Darryl
0
Tina Stancheva
Telerik team
answered on 10 Dec 2012, 06:58 PM
Hello Darryl,

From your description I wasn't able to understand how you define the Ribbon control - is it also populated with items through module injections or is it defined in the ShellView. Also, I am not sure if you have a common ViewModel defined as the ShellView.DataContext.

This is why I modified the solution to demonstrate how you can take advantage of MEF and its mechanisms to load and activate views. I placed all my ShellView logic in code-behind but if your application uses a ViewModel, you can definitely place it in it. Please note that in order to implement this approach you'll have to define a RegionAdapter for the RadTabControl.

Take a look at the sample and let me know if it helps.

Regards,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Darryl
Top achievements
Rank 1
answered on 12 Dec 2012, 10:07 PM
Hi Tina,

Thank you for the example, it was excellent and explained the loading and activation of the views. We are using Unity, but could see the correlation in the example. We are having additional issues so I have opened a support item with a copy of our full project and a list of the questions we have. My question in this thread was answered, thank you to everyone for the support.

Regards,
Darryl
Tags
TabControl
Asked by
mitja zigante
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
mitja zigante
Top achievements
Rank 1
adao
Top achievements
Rank 1
Alan
Top achievements
Rank 1
Petar Mladenov
Telerik team
Darryl
Top achievements
Rank 1
Share this question
or