I have problem with menu alignment on two another computers with different Windows version but with the same language, the same application.
Our menu is defined in that way:
<telerik:RadMenu Name="mainMenu"
VerticalAlignment="Top"
HorizontalAlignment="Stretch"
IsMainMenu="True"
FlowDirection="LeftToRight"
ClickToOpen="True"
Grid.Row="0" Grid.Column="0">
<telerik:RadMenuItem Header="Katalog"
SubmenuOpened="RadMenuItem_SubmenuOpened">
<telerik:RadMenuItem Header="Kategorie">
<telerik:RadMenuItem Header="Open"></telerik:RadMenuItem>
<telerik:RadMenuItem Header="Refresh"></telerik:RadMenuItem>
</telerik:RadMenuItem>
<telerik:RadMenuItem Header="Grupy">
<telerik:RadMenuItem Header="Open"></telerik:RadMenuItem>
<telerik:RadMenuItem Header="Refresh"></telerik:RadMenuItem>
</telerik:RadMenuItem>
</telerik:RadMenuItem>
<telerik:RadMenuItem Header="Motyw systemowy"
SubmenuOpened="RadMenuItem_SubmenuOpened">
<telerik:RadMenuItem Header="Crystal Light" IsCheckable="True" IsChecked="{Binding IsCrystalLight, Mode=TwoWay}"/>
<telerik:RadMenuItem Header="Crystal Dark" IsCheckable="True" IsChecked="{Binding IsCrystalDark, Mode=TwoWay}"/>
<telerik:RadMenuItem Header="Green Light" IsCheckable="True" IsChecked="{Binding IsGreenLight, Mode=TwoWay}"/>
<telerik:RadMenuItem Header="Green Dark" IsCheckable="True" IsChecked="{Binding IsGreenDark, Mode=TwoWay}"/>
</telerik:RadMenuItem>
<telerik:RadMenuItem Header="Pomoc"
SubmenuOpened="RadMenuItem_SubmenuOpened">
<telerik:RadMenuItem Header="O programie">
<telerik:RadMenuItem.Icon>
<Image Source="{telerik:IconResource IconRelativePath=address.png, IconSources={StaticResource IconSources}}" Stretch="None"/>
</telerik:RadMenuItem.Icon>
</telerik:RadMenuItem>
</telerik:RadMenuItem>
</telerik:RadMenu>
If I added code to properly align menu on submenu item open like below, the behaviour is also bad.
My code to align submenu:
private void RadMenuItem_SubmenuOpened(object sender, Telerik.Windows.RadRoutedEventArgs e)
{
RadMenuItem menuItem = sender as RadMenuItem;
if (menuItem != null)
{
System.Diagnostics.Debug.WriteLine($"menuItem.ActualWidth: {menuItem.ActualWidth}");
Popup popup = menuItem.ChildrenOfType<Popup>().FirstOrDefault();
if (popup != null)
{
System.Diagnostics.Debug.WriteLine($"popup.ActualWidth: {popup.ActualWidth}");
System.Diagnostics.Debug.WriteLine($"((Grid)popup.Child).ActualWidth: {((Grid)popup.Child).ActualWidth}");
popup.Placement = System.Windows.Controls.Primitives.PlacementMode.Bottom;
var popupWidth = ((Grid)popup.Child).ActualWidth;
var menuWidth = menuItem.ActualWidth;
popup.HorizontalOffset = popupWidth - menuWidth;
}
}
}
It looks like it is invalid left to right support or something else.
Please help.