Hi,
I have some problems with the combination of itemtemplates and selecteditem. I need itemtemplates to "color" the items in the timeline. I also want a summary when I click on one item.
In XAM in the TimeLine:
The ItemTemplates:
The XAML for the selected event information:
But when I click on an ItemTemplate then the SelectionChange event doesn't fire. When I remove the ItemTemplates from the TimeLine control then it fires?
I have some problems with the combination of itemtemplates and selecteditem. I need itemtemplates to "color" the items in the timeline. I also want a summary when I click on one item.
In XAM in the TimeLine:
.
.
TimelineInstantItemTemplate="{StaticResource InstantItemTemplate}"
TimelineItemTemplate="{StaticResource ItemWithDurationTemplate}"
.
.
The ItemTemplates:
<
DataTemplate
x:Key
=
"InstantItemTemplate"
>
<
Border
Width
=
"10"
Height
=
"10"
Margin
=
"0,0,0,5"
>
<
Rectangle
Grid.Column
=
"0"
Height
=
"7"
VerticalAlignment
=
"Center"
Fill
=
"{Binding DataItem.SelectedColor, Converter={StaticResource ColorToBrushConverter}}"
/>
</
Border
>
</
DataTemplate
>
<
DataTemplate
x:Key
=
"ItemWithDurationTemplate"
>
<
Border
Height
=
"10"
Margin
=
"0, 0, 0, 5"
>
<
Rectangle
Grid.Column
=
"0"
Height
=
"7"
VerticalAlignment
=
"Center"
Fill
=
"{Binding DataItem.SelectedColor, Converter={StaticResource ColorToBrushConverter}}"
/>
</
Border
>
</
DataTemplate
>
The XAML for the selected event information:
<
ScrollViewer
Margin
=
"0,20,0,20"
Grid.Row
=
"1"
BorderThickness
=
"0"
HorizontalScrollBarVisibility
=
"Disabled"
>
<
ItemsControl
ItemsSource
=
"{Binding SelectedItems, ElementName=radTimeline1}"
>
<
ItemsControl.ItemTemplate
>
<
DataTemplate
>
<
Grid
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"Auto"
/>
<
ColumnDefinition
Width
=
"Auto"
/>
<
ColumnDefinition
Width
=
"Auto"
/>
<
ColumnDefinition
Width
=
"*"
/>
</
Grid.ColumnDefinitions
>
<
TextBlock
Grid.Row
=
"0"
Grid.Column
=
"0"
Text
=
"{Binding Date}"
/>
<
TextBlock
Grid.Row
=
"0"
Grid.Column
=
"1"
Text
=
"{Binding Description}"
/>
<
TextBlock
Grid.Row
=
"0"
Grid.Column
=
"2"
Text
=
"{Binding Duration}"
/>
</
Grid
>
</
DataTemplate
>
</
ItemsControl.ItemTemplate
>
</
ItemsControl
>
</
ScrollViewer
>
But when I click on an ItemTemplate then the SelectionChange event doesn't fire. When I remove the ItemTemplates from the TimeLine control then it fires?