Hey there. I have a project with a RadMenu and it's menu Items are defined like so:
<Style x:Key="MenuItemBaseStyle" TargetType="telerik:RadMenuItem">
<Setter Property="Header" Value="{Binding Content}" />
<Setter Property="IsSeparator" Value="{Binding IsSeparator}" />
<Setter Property="ItemsSource" Value="{Binding}" />
</Style>
<Style x:Key="MenuItemLinkStyle" TargetType="telerik:RadMenuItem" BasedOn="{StaticResource MenuItemBaseStyle}">
<Setter Property="Template" Value="{StaticResource MenuItemLinkControlTemplate}" />
<Setter Property="Margin" Value="4 3 4 2" />
</Style>
And the Template is defined:
<ControlTemplate x:Key="MenuItemLinkControlTemplate" TargetType="telerik:RadMenuItem">
<StackPanel>
<Button Click="ButtonBase_OnClick" Content="{Binding Content}" Style="{StaticResource LinkButtonMenu}" />
</StackPanel>
</ControlTemplate>
I know it looks weird that It's a button, but there's a very specific reason we're doing that due to some issues we had after the last release. It was working fine prior to having to change it and I need it to work with the current Template I have defined for it. I tried setting the StaysOpenOnClick property to false in the style as well and the issue still persisted. Thanks in advanced for the help.
<Style x:Key="MenuItemBaseStyle" TargetType="telerik:RadMenuItem">
<Setter Property="Header" Value="{Binding Content}" />
<Setter Property="IsSeparator" Value="{Binding IsSeparator}" />
<Setter Property="ItemsSource" Value="{Binding}" />
</Style>
<Style x:Key="MenuItemLinkStyle" TargetType="telerik:RadMenuItem" BasedOn="{StaticResource MenuItemBaseStyle}">
<Setter Property="Template" Value="{StaticResource MenuItemLinkControlTemplate}" />
<Setter Property="Margin" Value="4 3 4 2" />
</Style>
And the Template is defined:
<ControlTemplate x:Key="MenuItemLinkControlTemplate" TargetType="telerik:RadMenuItem">
<StackPanel>
<Button Click="ButtonBase_OnClick" Content="{Binding Content}" Style="{StaticResource LinkButtonMenu}" />
</StackPanel>
</ControlTemplate>
I know it looks weird that It's a button, but there's a very specific reason we're doing that due to some issues we had after the last release. It was working fine prior to having to change it and I need it to work with the current Template I have defined for it. I tried setting the StaysOpenOnClick property to false in the style as well and the issue still persisted. Thanks in advanced for the help.