Hi,
You can take a look at the CustomAppearance and Demo samples or any of the tutorials 2-4 to see how you can use the built-in Activity and Dependency objects to create a Gantt chart. If you need to display custom objects, check Tutorial #5.
Basically, to create a Gantt chart using the built-in Activity and Dependency objects, you would write code similar to the following one:
// Initialize the activities and dependencies collections.
ObservableCollection<Activity> activities = new ObservableCollection<Activity>();
ObservableCollection<Dependency> dependencies = new ObservableCollection<Dependency>();
// Create some activities and add them to the respective collection.
Activity a0 = new Activity()
{
StartTime = DateTime.Today,
EndTime = DateTime.Today,
Progress = 1,
ActivityName = "Project start"
};
activities.Add(a0);
Activity a1 = new Activity()
{
StartTime = a0.EndTime,
EndTime = a0.EndTime.AddDays(6),
Progress = 1,
ActivityName = "Task 1"
};
activities.Add(a1);
// Create some dependencies between the activities.
dependencies.Add(new Dependency() { From = a0, To = a1, DependencyType = DependencyType.FinishToStart });
// Create the project.
IProjectViewModel project = activityView.CreateViewModel(activities, dependencies, null, null, typeof(Activity), typeof(Dependency), null, null);
I hope this helps.
Regards,
Meppy