This question is locked. New answers and comments are not allowed.
Hi,
I'm migrating from ListBox to DataBoundListBox, it all works fine except for MouseOver visual state; here's my code:
Style
DataTemplate
control invocation
any suggestion would be appreciated
Thanks
I'm migrating from ListBox to DataBoundListBox, it all works fine except for MouseOver visual state; here's my code:
Style
<
Style
TargetType
=
"telerikPrimitives:RadDataBoundListBoxItem"
x:Key
=
"ItemContainerStyle"
>
<
Setter
Property
=
"Background"
Value
=
"Transparent"
/>
<
Setter
Property
=
"BorderThickness"
Value
=
"0"
/>
<
Setter
Property
=
"BorderBrush"
Value
=
"Transparent"
/>
<
Setter
Property
=
"Padding"
Value
=
"0"
/>
<
Setter
Property
=
"HorizontalContentAlignment"
Value
=
"Stretch"
/>
<
Setter
Property
=
"VerticalContentAlignment"
Value
=
"Center"
/>
<
Setter
Property
=
"HorizontalAlignment"
Value
=
"Stretch"
/>
<
Setter
Property
=
"VerticalAlignment"
Value
=
"Center"
/>
<
Setter
Property
=
"CacheMode"
Value
=
"BitmapCache"
/>
<
Setter
Property
=
"Template"
>
<
Setter.Value
>
<
ControlTemplate
TargetType
=
"telerikPrimitives:RadDataBoundListBoxItem"
>
<
Border
x:Name
=
"LayoutRoot"
Background
=
"{TemplateBinding Background}"
HorizontalAlignment
=
"{TemplateBinding HorizontalAlignment}"
VerticalAlignment
=
"{TemplateBinding VerticalAlignment}"
BorderBrush
=
"{TemplateBinding BorderBrush}"
BorderThickness
=
"{TemplateBinding BorderThickness}"
>
<
VisualStateManager.VisualStateGroups
>
<
VisualStateGroup
x:Name
=
"CommonStates"
>
<
VisualState
x:Name
=
"Normal"
/>
<
VisualState
x:Name
=
"MouseOver"
>
<
Storyboard
>
<
DoubleAnimation
Duration
=
"0"
To
=
"0.95"
Storyboard.TargetProperty
=
"(UIElement.RenderTransform).(CompositeTransform.ScaleX)"
Storyboard.TargetName
=
"ContentContainer"
d:IsOptimized
=
"True"
/>
<
DoubleAnimation
Duration
=
"0"
To
=
"0.95"
Storyboard.TargetProperty
=
"(UIElement.RenderTransform).(CompositeTransform.ScaleY)"
Storyboard.TargetName
=
"ContentContainer"
d:IsOptimized
=
"True"
/>
</
Storyboard
>
</
VisualState
>
<
VisualState
x:Name
=
"Disabled"
/>
</
VisualStateGroup
>
</
VisualStateManager.VisualStateGroups
>
<
ContentControl
x:Name
=
"ContentContainer"
HorizontalAlignment
=
"{TemplateBinding HorizontalAlignment}"
VerticalAlignment
=
"{TemplateBinding VerticalAlignment}"
HorizontalContentAlignment
=
"{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment
=
"{TemplateBinding VerticalContentAlignment}"
Margin
=
"{TemplateBinding Padding}"
Content
=
"{TemplateBinding Content}"
ContentTemplate
=
"{TemplateBinding ContentTemplate}"
RenderTransformOrigin
=
"0.5,0.5"
>
<
ContentControl.RenderTransform
>
<
CompositeTransform
/>
</
ContentControl.RenderTransform
>
</
ContentControl
>
</
Border
>
</
ControlTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>
DataTemplate
<
DataTemplate
x:Name
=
"ListBoxItemTemplate"
>
<
StackPanel
x:Name
=
"stackPanel"
Orientation
=
"Horizontal"
Height
=
"170"
Margin
=
"-10,-10,-10,-10"
Background
=
"#00000000"
>
<
Grid
VerticalAlignment
=
"Top"
>
<
Grid.Resources
>
<
common:BooleanToVisibilityConverter
x:Key
=
"bool2VisConverter"
/>
</
Grid.Resources
>
<
Rectangle
Height
=
"130"
Width
=
"94"
Margin
=
"10,10,8,10"
Fill
=
"#32000000"
/>
<
Image
Source
=
"{Binding Screenshot}"
Height
=
"130"
Width
=
"94"
Margin
=
"10,10,8,10"
Stretch
=
"Fill"
Opacity
=
"0"
ImageOpened
=
"Image_ImageOpened"
/>
<
Image
Source
=
"/images/new_movie.png"
HorizontalAlignment
=
"Left"
Stretch
=
"None"
VerticalAlignment
=
"Top"
Margin
=
"10,10,0,0"
Visibility
=
"{Binding IsNew, Converter={StaticResource bool2VisConverter}}"
/>
</
Grid
>
<
StackPanel
Orientation
=
"Vertical"
HorizontalAlignment
=
"Left"
Width
=
"350"
VerticalAlignment
=
"Top"
>
<
TextBlock
x:Name
=
"textBlock"
TextTrimming
=
"WordEllipsis"
Text
=
"{Binding RegionTitle}"
Margin
=
"10,0,10,2"
FontSize
=
"28"
VerticalAlignment
=
"Center"
Foreground
=
"White"
HorizontalAlignment
=
"Stretch"
></
TextBlock
>
<
TextBlock
x:Name
=
"textBlockGenres"
TextTrimming
=
"WordEllipsis"
Text
=
"{Binding Genres}"
Margin
=
"10,0,10,2"
FontSize
=
"22"
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Center"
Foreground
=
"#FFF2AE26"
/>
<
TextBlock
x:Name
=
"textBlockReleaseDate"
TextTrimming
=
"WordEllipsis"
Text
=
"{Binding ReleaseDate}"
Margin
=
"10,0,10,2"
FontSize
=
"22"
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Center"
Foreground
=
"#FFF2AE26"
/>
</
StackPanel
>
</
StackPanel
>
</
DataTemplate
>
control invocation
<
telerikPrimitives:RadDataBoundListBox
Margin
=
"14,0,0,0"
HorizontalAlignment
=
"Left"
Name
=
"listBox_newest"
VerticalAlignment
=
"Top"
Width
=
"440"
ItemsSource
=
"{Binding}"
SelectionChanged
=
"listBox_trailers_SelectionChanged"
ItemContainerStyle
=
"{StaticResource ItemContainerStyle}"
ItemTemplate
=
"{StaticResource ListBoxItemTemplate}"
>
<
telerikPrimitives:RadDataBoundListBox.ListFooterContent
>
<
Rectangle
Height
=
"120"
></
Rectangle
>
</
telerikPrimitives:RadDataBoundListBox.ListFooterContent
>
</
telerikPrimitives:RadDataBoundListBox
>
any suggestion would be appreciated
Thanks