Hi there
I need to create a databound listbox with an ItemTemplate consisting of several controls, and style it (and the items) according to our designs. The listbox also needs to have certain states associated with it e.g. a mouseover and selected state.
If my listbox looked like this:
with an itemtemplate like this:
How would I be able to change properties of individual elements in the itemtemplate in the states? e.g. on mouseover I want the foreground of the second textblock to change colour? I can't seem to create an itemcontainerstyle which contains the states, and even so, that would normally just contain a contentpresenter...
Many thanks in advance!
Debbie
I need to create a databound listbox with an ItemTemplate consisting of several controls, and style it (and the items) according to our designs. The listbox also needs to have certain states associated with it e.g. a mouseover and selected state.
If my listbox looked like this:
<telerik:ListBox ItemTemplate="{StaticResource listboxItemTemplate}" /> |
<DataTemplate x:Key="listboxItemTemplate"> |
<Grid> |
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Text="{Binding Mode=OneWay, Path=Name}" TextWrapping="Wrap"/> |
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Text="{Binding Mode=OneWay, Path=Surname}" TextWrapping="Wrap"/> |
<Button HorizontalAlignment="Left" VerticalAlignment="Top" Content="Hit me"/> |
</Grid> |
</DataTemplate> |
How would I be able to change properties of individual elements in the itemtemplate in the states? e.g. on mouseover I want the foreground of the second textblock to change colour? I can't seem to create an itemcontainerstyle which contains the states, and even so, that would normally just contain a contentpresenter...
Many thanks in advance!
Debbie