Hi Yunid,
In that case,you need to use the full set of visual groups and visual states. The follwoing snippet, when placed in the duplicated control template of yours, will produce the desired mouse over effect when a TopLevel item has no subitems:
<
VisualStateManager.VisualStateGroups
>
<
VisualStateGroup
x:Name
=
"CommonStates"
>
<
VisualState
x:Name
=
"Disabled"
/>
<
VisualState
x:Name
=
"Highlighted"
>
<
Storyboard
>
<
DoubleAnimationUsingKeyFrames
Storyboard.TargetName
=
"BackgroundVisual"
Storyboard.TargetProperty
=
"Opacity"
>
<
LinearDoubleKeyFrame
KeyTime
=
"00:00:00.1"
Value
=
"1"
/>
</
DoubleAnimationUsingKeyFrames
>
</
Storyboard
>
</
VisualState
>
<
VisualState
x:Name
=
"Normal"
/>
</
VisualStateGroup
>
<
VisualStateGroup
x:Name
=
"FocusStates"
>
<
VisualStateGroup.Transitions
>
<
VisualTransition
GeneratedDuration
=
"0:0:0.2"
/>
</
VisualStateGroup.Transitions
>
<
VisualState
x:Name
=
"Unfocused"
/>
<
VisualState
x:Name
=
"Focused"
>
<
Storyboard
>
<
DoubleAnimationUsingKeyFrames
Storyboard.TargetName
=
"BackgroundVisual"
Storyboard.TargetProperty
=
"Opacity"
>
<
LinearDoubleKeyFrame
KeyTime
=
"00:00:00.1"
Value
=
"1"
/>
</
DoubleAnimationUsingKeyFrames
>
</
Storyboard
>
</
VisualState
>
</
VisualStateGroup
>
<
VisualStateGroup
x:Name
=
"CheckStates"
>
<
VisualState
x:Name
=
"Checked"
/>
<
VisualState
x:Name
=
"Unchecked"
/>
<
VisualState
x:Name
=
"HideIcon"
/>
</
VisualStateGroup
>
</
VisualStateManager.VisualStateGroups
>
I hope this helps.
All the best,
Dani
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the
Telerik Public Issue Tracking system and vote to affect the priority of the items