Access keys only supported by Windows7Theme?!

2 posts, 0 answers
  1. Kristoffer
    Kristoffer avatar
    30 posts
    Member since:
    Oct 2012

    Posted 11 Dec 2012 Link to this post

    I set the theme explicitly from a copy of your theme file:

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

    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.
  2. Masha
    Masha avatar
    355 posts

    Posted 14 Dec 2012 Link to this post

    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}" />

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

    Hope this helps.

    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top