The width of the popup element that shows the selected tab content when RadRibbonView is minimized is wrong in the following situation. A tab in the minimized ribbon is clicked to display its content, then the tab is clicked again. After that, the width of the ribbon is changed. At this point when you open the minimized content, the popup uses the previous size of the RadRibbonView control.
To work this around, you can manually update the MaxWidth of the popup content element on size changed.
public class CustomRibbonView : RadRibbonView
{
private ContentPresenter popupContent;
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
this.popupContent = this.GetTemplateChild("SelectedTabContentPopup") as ContentPresenter;
}
protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
{
base.OnRenderSizeChanged(sizeInfo);
if (popupContent != null)
{
double popupContentPadding = 16;
popupContent.MaxWidth = this.ActualWidth - popupContentPadding;
}
}
}
The RibbonSplitButton can behave like a toggle button by setting its IsToggle property to True. When the button is hosted in ApplicationMenu its default template is changed with a special one that adjust the UI of the button to the ApplicationMenu design. However, the alternative template is missing the code that updates the UI of the button when the IsChecked property is True.
To work this around, you can edit the ControlTemplate of RadRibbonSplitButton. The template for the button when hosted in ApplicationMenu is using the following x:Key "ApplicationRibbonSplitButtonTemplate". You can apply the edited template through the Template property of RadRibbonSplitButton.
By default the drop down buttons (like RadRibbonDropDownButton and RadRibbonSplitButton are opening their drop down content on mouse enter, when hosted in ApplicationMenu. When a drop down of a button is opened and you hover another button, the currently opened drop down should get closed. But this doesn't happen when the ApplicationMenu is populated through its ItemsSource and the buttons are defined in the ItemTemplate.
To work this around avoid using ItemsSource and ItemTemplate. Instead add the buttons directly in the Items collection of ApplicationMenu.
The RadRibbonWindow titlebar is higher than expected when the Windows 11 theme is used.
A side effect of this is that the content overlaps the titlebar, when the content is not a RadRibbonView.
This reproduces when the Windows11 and Crystal themes are used. To reproduce it, the IsWindowsThemeEnabled property should be set to false in order for the Telerik theme to get applied to the window.
To work this around, you can use the visual tree helper methods in the Loaded event of RadRibbonWindow in order to get the corresponding visuals and change their size and offset.
private void RadRibbonWindow_Loaded(object sender, RoutedEventArgs e)
{
var windowDecoratorPanel = this.ChildrenOfType<Grid>().FirstOrDefault(x => x.Name == "MaximizeWindowDecorator");
var titleBarPanel = windowDecoratorPanel.FindChildByType<Grid>();
titleBarPanel.RowDefinitions[0].Height = new GridLength(30);
var clientArea = windowDecoratorPanel.ChildrenOfType<Border>().FirstOrDefault(x => x.Name == "PART_ClientAreaBorder");
clientArea.Margin = new Thickness(0);
}
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}" />
NullReferenceException is thrown on start up of the application, when the IsMinimized property of RadRibbonView is set to True initially. For example, if you set it in XAML.
To work this around, set the IsMinimized property in the Loaded event handler of RadRibbonView.
private void RadRibbonView_Loaded(object sender, System.Windows.RoutedEventArgs e)
{
var ribbonView = (RadRibbonView)sender;
ribbonView.IsMinimized = true;
}
If you add the RibbonView into the Content of a TabItem (or RadTabItem) and then remove it from the content, the RibbonView is still in the memory.
This happens because we subscribe to few events of the Parent window on Loaded and unsubscribe on Unloaded. However, because of the specific content loading behavior of TabControl, Loaded of the content (the RibbonView) is fired once and Unloaded only once.
To work this around, before removing the RibbonView from the TabItem, call its OnUnloaded event handler. To do this, you can use a reflection to get the handler and then invoke it.
var methodInfo = typeof(RadRibbonView).GetMethods(System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).Where(m => m.Name == "OnUnloaded").First();
methodInfo.Invoke(ribbon, new object[2] { null, null });
This reproduces only if RadRibbonWindow is used with the default WPF Window's theme, instead of the Telerik's theme. Also, this reproduces only in the themes after Expression_Dark (starting from Windows8). You can find a list of the Telerik themes ordered chronologically in the help documentation.
If the RadRibbonWindow is maximized on the second (right) monitor and you click the application menu button to open the ApplicationMenu, the menu displays on the first (left) monitor.
To work this around enable the Telerik's RadRibbonWindow theming by setting the IsWindowsThemeEnabled static property to False.
static MainWindow()
{
IsWindowsThemeEnabled = false;
}
The window's content gets clipped when the window goes from Maximized to Normal WindowState. This reproduces only when the window and the screens are using specific sizes. The setup when this was reproduced was with a 1936x1056 size of RadRibbonWindow (in Normal state) and 1920x1080 screen resolution.
To reproduce this the IsWindowsThemeEnabled property of the RadRibbonWindow should be set to False.
To work this around, reset the Window size on WindowStateChanged.
private void MainWindow_StateChanged(object sender, EventArgs e)
{
if (this.WindowState == WindowState.Normal)
{
Width += 1;
Width -= 1;
}
}
The content of RadBackstageItem is not stretched within the available area in the content area of the RadRibbonBackstage control. There is a gap between the title bar of the RadRibbonView control and the top border of the content area.
This reproduces with the Material theme, but it is possible to appear also in other themes.
To work this around, you can extract the ControlTemplate of RadRibbonBackstage and re-order the layout in order to stretch the content in all the available space. Check the attached project.