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

Mouseover background

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

Hi:

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:

    <Grid.Resources> 
      <Style x:Key="MenuItemStyle" TargetType="telerikNavigation:RadMenuItem">  
        <Setter Property="Foreground" Value="Red"/>  
        <Setter Property="Background" Value="#FF1D52D1"/>  
      </Style> 
    </Grid.Resources> 
 
    <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> 
                <telerikNavigation:RadMenuItem Header="Reports" ItemContainerStyle="{StaticResource MenuItemStyle}">  
                    <telerikNavigation:RadMenuItem Header="Email Invoices" /> 
                    <telerikNavigation:RadMenuItem Header="Email Cash Receipts" /> 
                    <telerikNavigation:RadMenuItem Header="Accounts Receivable" /> 
                </telerikNavigation:RadMenuItem> 
            </telerikNavigation:RadMenu> 
                  
 

1 Answer, 1 is accepted

Sort by
0
Pana
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.

Regards,
Panayot
the Telerik team
Tags
Menu
Asked by
Terry
Top achievements
Rank 1
Answers by
Pana
Telerik team
Share this question
or