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

Mouseover background

1 Answer 84 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Terry asked on 21 Jun 2010, 02:23 AM


I can set the foreground and background color for menu header and subitems.  The foreground color is retained when I do a mouseover of either a header or a subitem, but the background is not.  What is the easiest way to fix that?  It seems like there should be a MouseOverBackground and MouseOverForeground property.  Here is my xaml:

      <Style x:Key="MenuItemStyle" TargetType="telerikNavigation:RadMenuItem">  
        <Setter Property="Foreground" Value="Red"/>  
        <Setter Property="Background" Value="#FF1D52D1"/>  
    <Border x:Name="ContentBorder" Style="{StaticResource ContentBorderStyle}">  
        <StackPanel Orientation="Vertical">  
            <telerikNavigation:RadMenu ItemContainerStyle="{StaticResource MenuItemStyle}"  > 
                <telerikNavigation:RadMenuItem Header="Employees"/>  
                <telerikNavigation:RadMenuItem Header="Customers"/>  
                <telerikNavigation:RadMenuItem Header="Projects"/>  
                <telerikNavigation:RadMenuItem Header="Time Charges"/>  
                <telerikNavigation:RadMenuItem Header="Billings" ItemContainerStyle="{StaticResource MenuItemStyle}" > 
                    <telerikNavigation:RadMenuItem Header="Invoices" /> 
                    <telerikNavigation:RadMenuItem Header="Cash Receipts" /> 
                <telerikNavigation:RadMenuItem Header="Reports" ItemContainerStyle="{StaticResource MenuItemStyle}">  
                    <telerikNavigation:RadMenuItem Header="Email Invoices" /> 
                    <telerikNavigation:RadMenuItem Header="Email Cash Receipts" /> 
                    <telerikNavigation:RadMenuItem Header="Accounts Receivable" /> 

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 22 Jun 2010, 08:44 AM
Hello Terry,

In silverlight the Controls have ControlTemplates which can be edited. Foreground, BorderBrush and Background are properties of the Control class but if we want to expose properties for all elements in RadMenu we will need MouseOver-Background/OuterBorder/InnerBorder, TickIcon-Fill/Stroke, Separator line-1/2 etc. The right way to edit these colors or the elements in the RadMenu and RadMenuItem is to edit their templates. Further more in the RadMenuItem we have a ButtonChrome that we use to render the Highlighted state of the RadMenuItem.

You can check the attached file if you are interested how to edit the RadMenu in Blend you can check the project attaced in this forum post.

the Telerik team
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question