Version

Calculating Explicitly a Project

Topic Overview

Purpose

This topic explains how to calculate a project explicitly using the xamGantt™ control.

Required background

The following topics are prerequisites to understanding this topic:

Topic Purpose

This topic describes how the xamGantt control is bound to an arbitrary tasks collection via ListBackedProject.

In this topic

This topic contains the following sections:

Explicitly Calculating a Project

Overview

By default, automatic project calculations in the xamGantt control occur with every edit.

This behavior is configurable, and you may explicitly calculate the project as needed.

Property settings

The following table maps the explicit project’s calculation configuration to property settings.

In order to: Use: And set it to:

Disables automatic project calculation

False

Explicitly calculate the project

-

Example

The example below demonstrates how you explicitly calculate a project; triggered by clicking the ‘Calculate’ Button:

In XAML:

<ig:ListBackedProject x:Name="dataProvider"
                      TaskItemsSource="{Binding Tasks}"
<!-- Add ProjectTask Property Mappings Here -->
    <ig:ListBackedProject.Settings>
        <ig:ProjectSettings ShouldCalculateAfterEachEdit=" />
    </ig:ListBackedProject.Settings>
</ig:ListBackedProject>
<ig:XamGantt x:Name="gantt"
             Project="{Binding ElementName=dataProvider}"/>
…
<Button x:Name="Btn_Calculate" Content="Calculate"
        Click="Btn_Calculate_Click" />

In C#:

private void Btn_Calculate_Click(object sender, RoutedEventArgs e)
{
    this.dataProvider.Calculate();
}

In Visual Basic:

Private Sub Btn_Calculate_Click(sender As Object, e As RoutedEventArgs)
    Me.dataProvider.Calculate()
End Sub

Related Topics

The following topics provide additional information related to this topic.

Topic Purpose

This topic gives an overview of the xamGantt Project class and its configurable aspects.

This topic explains how to calculate project and tasks dates according to the project start or finish date in the xamGantt control.