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

Access keys only supported by Windows7Theme?!

1 Answer 40 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Kristoffer
Top achievements
Rank 1
Kristoffer asked on 11 Dec 2012, 11:24 AM
I set the theme explicitly from a copy of your theme file:

<ResourceDictionary.MergedDictionaries>
  <ResourceDictionary Source="../Themes/Telerik.Windows.Controls.Navigation.xaml"/>
</ResourceDictionary.MergedDictionaries>

I have this menu item:
<telerik:RadMenuItem x:Name="mainMenuFileExit" Header="E_xit" Command="{StaticResource Commands.ExitApplication}"  />

When I set the theme to Windows 7 it works as expected:
Telerik\RadControls for WPF Q3 2012\Themes.Implicit\WPF40\Windows7\Themes\Telerik.Windows.Controls.Navigation.xaml

However, if I choose another theme the access key is interpreted as part of the header text:
Telerik\RadControls for WPF Q3 2012\Themes.Implicit\WPF40\ExpressionDark\Themes\Telerik.Windows.Controls.Navigation.xaml

Clearly, something is wrong with your non-Windows7 themes.

1 Answer, 1 is accepted

Sort by
0
Masha
Telerik team
answered on 14 Dec 2012, 11:26 AM
Hi Kristoffer,

I can confirm the problem comes from our controls. Thank you for pointing this out. We will fix the issue for our next release.

In order to make it work you should modify TopLevelHeaderTemplate and SubMenuItemTemplate and replace <ContentControl x:Name="Header" .. ./> with
<ContentPresenter x:Name="Header" Grid.Column="1" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" RecognizesAccessKey="True" ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" />

 in ExpressionDark Theme. Please note, you should also remove

<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Header" Storyboard.TargetProperty="Foreground">
  <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource MenuForeground_Highlighted}" />
</ObjectAnimationUsingKeyFrames>

from VisualStates as ContentPresenter control does not have a Foreground property.

Hope this helps.

Greetings,
Maria
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Menu
Asked by
Kristoffer
Top achievements
Rank 1
Answers by
Masha
Telerik team
Share this question
or