I want to set different colors in one appointment. And i used to use AppointmentItemContentTemplate to try this business. But it didn't work. For example, in month view, it has a long appointment that across two lines. The first row shows two color red and green. And the second line shows the same color.But I wanna this line show green. Here is code.
Is any problem with this code? or this method cannot deal with this problem.
Can anyone help me to fix this problem?
At last, I give my expected result that can help understanding.
<
DataTemplate
x:Key
=
"AppointmentTemplate"
>
<
Grid
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"Auto"
/>
<
ColumnDefinition
Width
=
"*"
/>
</
Grid.ColumnDefinitions
>
<
StackPanel
Orientation
=
"Horizontal"
Grid.ColumnSpan
=
"2"
>
<
Rectangle
Width
=
"{Binding Appointment.LWidth}"
Fill
=
"Red"
>
</
Rectangle
>
<
Rectangle
Width
=
"{Binding Appointment.RWidth}"
Fill
=
"Green"
/>
</
StackPanel
>
<
StackPanel
Orientation
=
"Horizontal"
Grid.Column
=
"0"
>
<
Image
Source
=
"../Images/Tester.png"
Stretch
=
"Fill"
Width
=
"20"
Height
=
"20"
/>
<
TextBlock
Text
=
"{Binding Path=Subject}"
VerticalAlignment
=
"Center"
/>
</
StackPanel
>
</
Grid
>
</
DataTemplate
>
Can anyone help me to fix this problem?
At last, I give my expected result that can help understanding.