MainWindow.Xaml
<gantt:GanttControl x:Name="Gantt" ItemsSource="{Binding TeamDetails}"
ShowDateWithTime="True"
ShowNonWorkingHoursBackground="False"
ShowChartLines="False"
ToolTipTemplate="{StaticResource toolTipTemplate}"
VisualStyle="Metro">
<gantt:GanttControl.TaskAttributeMapping> <gantt:TaskAttributeMapping TaskNameMapping="Name"
StartDateMapping="StartDate"
ChildMapping="SubItems"
FinishDateMapping="FinishDate"
ProgressMapping="Progress"
InLineTaskMapping="InLineItems"/>
</gantt:GanttControl.TaskAttributeMapping>
MainWindow.Xaml.cs public ObservableCollection<Item> GetTeamInfo() {
DateTime dtS = DateTime.Today;
ObservableCollection<Item> teams = new ObservableCollection<Item>();
teams.Add(new Item() { Name = "RDU Team" });
Item Person = new Item() { Name = "Robert" };
// Milestone Person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 07), FinishDate = new DateTime(2012, 01, 07), Name = "Market Analysis", Progress = 50d });
Person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 11,12,0,0), FinishDate = new DateTime(2012, 01, 17), Name = "Competitor Analysis", Progress = 20d });
Person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 17,12,0,0), FinishDate = new DateTime(2012, 01, 21), Name = "Design Spec" });
teams[0].SubItems.Add(Person);
return teams; } |
<Style x:Key="MileStone" TargetType="gchart:MileStone">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="gchart:MileStone">
<Grid>
<Image Source="image.png" Height="19" Width="19"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style> <gantt:GanttControl.Resources> <Style BasedOn="{StaticResource MileStone}" TargetType="gchart:MileStone" />
</gantt:GanttControl.Resources> |