Dynamically Adding RibbonTabs in PRISM

6 posts, 0 answers
  1. Joshua
    Joshua avatar
    78 posts
    Member since:
    Sep 2008

    Posted 23 Nov 2011 Link to this post

    We using PRISM to to deploy a modular based app.

    Each module will have a dedicated tab on the RibbonView.

    I know that I can "hard-code" a ribbontab.  However, I would prefer that each module would have an associated XAML with the appropriate controls for the module in it (i.e. separation of design from development).

    Is there a way to create a tab's controls in XAML and then "inject" or load that XAML into a ribbontab at runtime?

    Thanks,
    Joshua
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 28 Nov 2011 Link to this post

    Hello Joshua,

    Please accept my apology for the delayed response.

    I am not really sure what you need to implement. Basically you can use databinding to create the overall look of the RadRibbonView control - this means that you'll have to define the PRISM modules to add RadRibbonTabs in the RadRibbonView region. But the content of the RadRibbonTab controls can be databound. I attached a sample solution demonstrating this approach.

    Or if you want to populate the RadRibbonView control with UserControls, the control will automatically wrap them in RadRibbonTabs. But if you want to further customize how the RadRibbonTabs should be displayed, it would be best to create a custom RegionAdapter to configure the RadRibbonView region. If this is the approach that you would like to use, can you please further elaborate on your requirements so that we can further assist you with it? Thank you ina dvance.

    Best wishes,
    Tina Stancheva
    the Telerik team

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

  3. UI for WPF is Visual Studio 2017 Ready
  4. Shane Holder
    Shane Holder avatar
    5 posts
    Member since:
    Aug 2009

    Posted 07 Dec 2011 Link to this post

    I've been using the method shown in the project for adding RibbonTabs, but the designer, Studio and Blend blow up with exceptions when I switch to designer mode.  Is there a workaround/fix for this? Running WPF 2011 Q3.
  5. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 12 Dec 2011 Link to this post

    Hi Shane Holder,

    Thank you for reporting these exceptions. I logged an item in our PITS where you can track the progress of the issue. Please accept our apology for this inconvenience.

    I updated your Telerik account as a small sign of appreciation for bringing this to our attention.

    Best wishes,
    Tina Stancheva
    the Telerik team

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

  6. Bert
    Bert avatar
    29 posts
    Member since:
    May 2012

    Posted 12 Feb 2013 Link to this post

    Hello,

    we are developing an application based on the Caliburn Micro MVVM framework and want to add RibbonTabs similar to the example in this thread. We have created some view model and view combinations where the view is a RadRibbonTab control with buttons. Our main view model has a property Tabs that is an observable collection. The tab view models are added to this collection.

    How can we make caliburn micro show the tabs in the ribbon?


    Kind regards,

    Bert

  7. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 14 Feb 2013 Link to this post

    Hello Bert,

    Basically you have to set your main ViewModel  as DataContext of the RadRibbonView control. You also have to bind its ItemsSource property to the ObservableCollection of "TabViewModels". In order to visualize the tabs you will have to define a DataTemplate (describing how your tabs will be presented) and set it as ItemsTemplate of the RadRibbonVeiw control (using the ItemsTemplate property). Keep in mind that the structure of the RadRibbonView control is the following

    RadRibbonView
    ---RadRibbonTab
    ------RadRibbonGroup
    ---------content of the group (other RadRibbonControls)
    ------/RadRibbonGroup
    ---/RadRibbonTab
    /RadRibbonView
    You can also find this demo useful - it shows a typical MVVM scenario in RadRibbonView. If you have other Telerik related questions please start a new support thread. Thank you for understanding.

    Regards,
    Pavel R. Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top
UI for WPF is Visual Studio 2017 Ready