Hi,
I have an extended resource template looking like this:
Then I use a TimelineViewDefinition with resource grouping. My resources are employees.
When I load my data I calculate the total scheduled time and put it in the PlannedMinutes property of the resource.
My resource grouping template looks like this:
The problem it that the resources (employees) are loaded before the appointments, so the resources are displayed before I have calculated the planned minutes and updated the resources with the correct numbers. So the first time it will display a value of 0.
Then, when I move to another day, I will load up some new appointments. At that time, my resources are updated and will show the values from my previous day.
Is there some method I can call to repaint my resources after I have loaded the appointments?
Regards,
HÃ¥kan
I have an extended resource template looking like this:
public
class
TimeScheduleEmployeeResource : Resource
{
private
int
plannedMinutes;
public
int
PlannedMinutes
{
get
{
return
plannedMinutes; }
set
{ plannedMinutes = value; }
}
private
int
workingHoursMinutes;
public
int
WorkingHoursMinutes
{
get
{
return
workingHoursMinutes; }
set
{ workingHoursMinutes = value; }
}
}
Then I use a TimelineViewDefinition with resource grouping. My resources are employees.
When I load my data I calculate the total scheduled time and put it in the PlannedMinutes property of the resource.
My resource grouping template looks like this:
<
local:CustomOrientedGroupHeaderContentTemplateSelector.VerticalResourceTemplate
>
<
DataTemplate
>
<
Grid
Width
=
"150"
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"*"
/>
<
RowDefinition
Height
=
"*"
/>
</
Grid.RowDefinitions
>
<
Grid.Resources
>
<
Style
TargetType
=
"TextBlock"
BasedOn
=
"{StaticResource DefaultTextBlock}"
>
<
Setter
Property
=
"VerticalAlignment"
Value
=
"Center"
/>
<
Setter
Property
=
"TextWrapping"
Value
=
"NoWrap"
/>
</
Style
>
</
Grid.Resources
>
<
TextBlock
Grid.Row
=
"0"
Text
=
"{Binding Name}"
HorizontalAlignment
=
"Center"
Padding
=
"5,3,5,0"
/>
<
StackPanel
Grid.Row
=
"1"
Orientation
=
"Horizontal"
HorizontalAlignment
=
"Center"
Margin
=
"5,0,5,3"
>
<
TextBlock
Text
=
"{Binding Name.PlannedMinutes, Converter={StaticResource MinutesToTimeSpanConverter}}"
/>
<
TextBlock
Text
=
"/"
/>
<
TextBlock
Text
=
"{Binding Name.WorkingHoursMinutes, Converter={StaticResource MinutesToTimeSpanConverter}}"
/>
</
StackPanel
>
</
Grid
>
</
DataTemplate
>
</
local:CustomOrientedGroupHeaderContentTemplateSelector.VerticalResourceTemplate
>
The problem it that the resources (employees) are loaded before the appointments, so the resources are displayed before I have calculated the planned minutes and updated the resources with the correct numbers. So the first time it will display a value of 0.
Then, when I move to another day, I will load up some new appointments. At that time, my resources are updated and will show the values from my previous day.
Is there some method I can call to repaint my resources after I have loaded the appointments?
Regards,
HÃ¥kan