このクイックスタートセクションは、GanttView コントロールを理解することを目的としています。まず、Visual Studio で WPF アプリケーションを作成し、MainWindow に GanttView コントロールを追加し、コードから非連結モードで GanttView にタスクを追加します。
GanttView コントロールがアプリケーションの実行時にどのように表示されるかを確認するには、次の手順を実行します。
次に、いくつかのタスクが表示された基本的な GanttView コントロールを示します。

| XAML |
コードのコピー
|
|---|---|
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml"
xmlns:GanttView="clr-namespace:C1.GanttView;assembly=C1.WPF.GanttView.4"
x:Class="QuickStart.MainWindow"
Title="MainWindow" Height="350" Width="525">
<Grid>
<c1:C1GanttView Name="gv">
<c1:C1GanttView.Columns>
<GanttView:TaskPropertyColumn ID="682738157" Property="Mode"/>
<GanttView:TaskPropertyColumn ID="200464275" Property="Name"/>
<GanttView:TaskPropertyColumn ID="1932261525" Property="Duration" Visible="False"/>
<GanttView:TaskPropertyColumn ID="2041428170" Property="DurationUnits" Visible="False"/>
<GanttView:TaskPropertyColumn ID="877817002" Property="Start" Visible="False"/>
<GanttView:TaskPropertyColumn ID="1833319410" Property="Finish" Visible="False"/>
<GanttView:TaskPropertyColumn ID="204763723" Property="PercentComplete" Visible="False"/>
<GanttView:TaskPropertyColumn ID="2112691121" Property="ConstraintType" Visible="False"/>
<GanttView:TaskPropertyColumn ID="1026682979" Property="ConstraintDate" Visible="False"/>
<GanttView:TaskPropertyColumn ID="46763901" Property="Predecessors" Visible="False"/>
<GanttView:TaskPropertyColumn ID="1809421465" Property="Deadline" Visible="False"/>
<GanttView:TaskPropertyColumn ID="1041667598" Property="Calendar" Visible="False"/>
<GanttView:TaskPropertyColumn ID="223524084" Property="ResourceNames" Visible="False"/>
<GanttView:TaskPropertyColumn ID="2142090402" Property="Notes" Visible="False"/>
</c1:C1GanttView.Columns>
</c1:C1GanttView>
</Grid>
</Window>
|
|
非連結モードで GanttView コントロールにタスクを追加できます。それには、デリゲートにタスクを定義し、Add メソッドを使用して GanttView の Tasks コレクションにタスクを追加します。
[F5]キーを押してアプリケーションを実行し、タスクの属性がコントロールにどのように表示されるかを確認します。