TabControl,Prism, MEF

13 posts, 0 answers
  1. mitja zigante
    mitja zigante avatar
    2 posts
    Member since:
    Nov 2009

    Posted 21 Mar 2011 Link to this post

    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
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 24 Mar 2011 Link to this post

    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
  3. DevCraft banner
  4. mitja zigante
    mitja zigante avatar
    2 posts
    Member since:
    Nov 2009

    Posted 29 Mar 2011 Link to this post

    Thanks for the example.It works fine.

    Regards,
    Mitja
  5. adao
    adao avatar
    2 posts
    Member since:
    Mar 2008

    Posted 16 Jun 2011 Link to this post

    Great code!
  6. Alan
    Alan avatar
    29 posts
    Member since:
    Feb 2008

    Posted 03 Jul 2012 Link to this post

    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?
  7. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 06 Jul 2012 Link to this post

    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 >>

  8. Alan
    Alan avatar
    29 posts
    Member since:
    Feb 2008

    Posted 07 Jul 2012 Link to this post

    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.
  9. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 11 Jul 2012 Link to this post

    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 >>

  10. Darryl
    Darryl avatar
    6 posts
    Member since:
    Oct 2012

    Posted 28 Nov 2012 Link to this post

    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
  11. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 03 Dec 2012 Link to this post

    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.

  12. Darryl
    Darryl avatar
    6 posts
    Member since:
    Oct 2012

    Posted 05 Dec 2012 Link to this post

    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
  13. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 10 Dec 2012 Link to this post

    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.

  14. Darryl
    Darryl avatar
    6 posts
    Member since:
    Oct 2012

    Posted 12 Dec 2012 Link to this post

    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
Back to Top
DevCraft banner