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

Have one RadRibbonTab in several radribboncontextualgroup ?

1 Answer 95 Views
RibbonView and RibbonWindow
This is a migrated thread and some comments may be shown as answers.
Aurore
Top achievements
Rank 1
Aurore asked on 04 Mar 2013, 04:13 PM
Hello,
To avoid code duplication, i'd like to use a same radRibbontab in several contextual group
I've tried this code, but it doesn't work...

<telerik:RadRibbonTab  Header="CONTENT" ContextualGroupName="contextualCONTENT">
    <telerik:RadRibbonGroup Header="GContent">
        <!-- some ribbon buttons-->
        </telerik:RadRibbonGroup>
</telerik:RadRibbonTab>
 
<telerik:RadRibbonTab  Header="NAV" >
    <telerik:RadRibbonTab.Style>
        <Style TargetType="{x:Type telerik:RadRibbonTab}">
            <Setter Property="ContextualGroupName" Value="contextualNAV"/>
            <Style.Triggers>
                <DataTrigger Binding="{Binding Protocol}" Value="CONTENT">
                    <Setter Property="ContextualGroupName" Value="contextualCONTENT"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </telerik:RadRibbonTab.Style>
    <telerik:RadRibbonGroup Header="G1">
         <!-- some ribbon buttons-->
         </telerik:RadRibbonGroup>
</telerik:RadRibbonTab>
<telerik:RadRibbonView.ContextualGroups>
    <telerik:RadRibbonContextualGroup x:Name="contextualNAV" Header="Outils Exploration" MinWidth="120"
                                              IsActive="{Binding Protocol, Converter={StaticResource convIsEqual}, ConverterParameter=NAV}"
                                               Color="Yellow" SelectFirstTabOnActivation="False" />
    <telerik:RadRibbonContextualGroup x:Name="contextualCONTENT"  Header="Outils Codification" MinWidth="120"
                                               IsActive="{Binding Protocol, Converter={StaticResource convIsEqual}, ConverterParameter=CONTENT}"
                                               Color="Cyan"  SelectFirstTabOnActivation="False"/>
</telerik:RadRibbonView.ContextualGroups>

1 Answer, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 07 Mar 2013, 03:49 PM
Hello Aurore,

I am not sure that I understand you clear enough. Can you please elaborate on your scenario? Do you use a full MVVM scenario? Why is it an obstacle for you to define the tab(s) as required? How are you going to implement different logic on different button click events if you share the same definition of that tab? Have you considered using a full MVVM approach as in this online demonstration? Keep in mind that defining the same visual object in more than one place in certain visual tree is considered as bad practice and may lead to unexpected behavior of the control.

I am looking forward to hearing from you.

Regards,
Pavel R. Pavlov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
RibbonView and RibbonWindow
Asked by
Aurore
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Share this question
or