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

Dynamically Adding RibbonTabs in PRISM

5 Answers 376 Views
RibbonView and RibbonWindow
This is a migrated thread and some comments may be shown as answers.
Joshua
Top achievements
Rank 1
Joshua asked on 23 Nov 2011, 07:02 AM
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

5 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 28 Nov 2011, 10:09 AM
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 >>

0
Shane Holder
Top achievements
Rank 1
answered on 08 Dec 2011, 03:54 AM
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.
0
Tina Stancheva
Telerik team
answered on 12 Dec 2011, 05:39 PM
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 >>

0
Bert
Top achievements
Rank 1
answered on 12 Feb 2013, 07:30 AM

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

0
Pavel R. Pavlov
Telerik team
answered on 14 Feb 2013, 03:48 PM
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.

Tags
RibbonView and RibbonWindow
Asked by
Joshua
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Shane Holder
Top achievements
Rank 1
Bert
Top achievements
Rank 1
Pavel R. Pavlov
Telerik team
Share this question
or