Completed
Last Updated: 28 Aug 2023 07:25 by ADMIN
Release LIB 2023.2.904 (4 Sep 2023)
Martin Ivanov
Created on: 21 Aug 2023 15:26
Category: RibbonView
Type: Bug Report
1
RibbonView: The ribbon is not using the simplified items when the RadRibbonTab is hosted in a contextual group

Setting the LayoutMode to Simplified doesn't do anything in the RadRibbonTabs that are assigned to a RadRibbonContextualGroup.

To work this around, extract the "ContextualTabsTemplate" ControlTemplate and the following elements in the "RibbonScrollViewer".

 

<telerikRibbonViewPrimitives:RibbonScrollViewer x:Name="TabItemsScrollViewer">
	<Grid>
		<ItemsPresenter x:Name="PART_DefaultItemsPresenter" HorizontalAlignment="Left" />
		<ItemsControl x:Name="PART_SimplifiedItemsControl" Visibility="Collapsed" 
				  ItemsSource="{Binding SimplifiedItems, RelativeSource={RelativeSource TemplatedParent}}">
			<ItemsControl.ItemsPanel>
				<ItemsPanelTemplate>
					<telerikRibbonViewPrimitives:RibbonGroupsPanel />
				</ItemsPanelTemplate>
			</ItemsControl.ItemsPanel>
		</ItemsControl>
	</Grid>
</telerikRibbonViewPrimitives:RibbonScrollViewer>

 

Then define the following DataTrigger in the ControlTemplate.Triggers collection:

 

<DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=telerikRibbonView:RadRibbonView}, Path=LayoutMode}" Value="Simplified">
	<Setter TargetName="PART_SimplifiedItemsControl" Property="Visibility" Value="Visible"/>
	<Setter TargetName="PART_DefaultItemsPresenter" Property="Visibility" Value="Collapsed"/>
</DataTrigger>

 

Then, assign the custom ControlTemplate via the Template property of RadRibbonTab.

 

<telerik:RadRibbonTab Template="{StaticResource CustomContextualRibbonTabTemplate}" />

 

0 comments