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

Menu Customizacion How To

2 Answers 63 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 04 Feb 2011, 04:33 PM
Hi, I am developing a app wich have a menu and I am trying to customize it to look more like the menu seen here: 

http://demos.telerik.com/silverlight/#Menu/Customization

So far so good, but how I can change the image of a RadTabItem on MouseHover event? I tried the following but it did not work:

<ControlTemplate x:Key="MenuItemImageControlTemplate" TargetType="telerik:RadMenuItem">
            <Grid>
                <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CommonStates">
                        <VisualState x:Name="Disabled"/>
                        <VisualState x:Name="Normal"/>
                        <VisualState x:Name="MouseOver">
                            <Storyboard>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="mouseOverImage">
                                    <DiscreteObjectKeyFrame KeyTime="0">
                                        <DiscreteObjectKeyFrame.Value>
                                            <Visibility>Visible</Visibility>
                                        </DiscreteObjectKeyFrame.Value>
                                    </DiscreteObjectKeyFrame>
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="normalImage">
                                    <DiscreteObjectKeyFrame KeyTime="0">
                                        <DiscreteObjectKeyFrame.Value>
                                            <Visibility>Collapsed</Visibility>
                                        </DiscreteObjectKeyFrame.Value>
                                    </DiscreteObjectKeyFrame>
                                </ObjectAnimationUsingKeyFrames>
                            </Storyboard>
                        </VisualState>
                        <VisualState x:Name="Pressed"/>
                    </VisualStateGroup>
                </VisualStateManager.VisualStateGroups>
  
                <Image x:Name="normalImage" Source="{Binding Content}" Cursor="Hand" Stretch="None" HorizontalAlignment="Left"  />
                <Image x:Name="mouseOverImage" Source="{Binding Content, Converter={StaticResource ImageSourceConverter}}" Cursor="Hand" Stretch="None" HorizontalAlignment="Left" ToolTipService.ToolTip="{Binding Path=FileType, Converter={StaticResource NameToTooltipConverter}}"/>
            </Grid>
        </ControlTemplate>


Thanks =D

2 Answers, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 08 Feb 2011, 09:49 AM
Hello Michael,

In order to change the MouseOver colour of the RadMenuItem you will have to edit the ButtonChrome control, which represents the menu item. For more information please refer to this forum post. You can also check out this KB article.

Please let us know if you have further questions.

Kind regards,
Konstantina
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Michael
Top achievements
Rank 1
answered on 09 Feb 2011, 06:34 PM
Thanks, I'll look at those posts and I comment you.
Tags
Menu
Asked by
Michael
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Michael
Top achievements
Rank 1
Share this question
or