前の手順では、Silverlight アプリケーションを作成し、プロジェクトに C1OrgChart コントロールを追加しました。この手順では、C1OrgChart コントロールにコンテンツを追加します。プロジェクトをカスタマイズしてアプリケーションの C1OrgChart コントロールにコンテンツを追加するには、次の手順に従います。
Visual Basic コードの書き方
Visual Basic |
コードのコピー
|
---|---|
Imports C1.Xaml.OrgChart |
C# コードの書き方
C#> |
コードのコピー
|
---|---|
using C1.Xaml.OrgChart; |
Visual Basic コードの書き方
Visual Basic |
コードのコピー
|
---|---|
' 階層を作成します。 Dim uwp As New Platform() With {.Name = "UWP"} |
C# コードの書き方
C# |
コードのコピー
|
---|---|
// 階層を作成します Platform uwp = new Platform() { Name = "UWP" }; Platform winjs = new Platform() { Name = "HTML" }; Platform xaml = new Platform() { Name = "XAML" }; Platform dx = new Platform() { Name = "DirectX" }; uwp.Subplatforms = new List<Platform>(); winjs.Subplatforms = new List<Platform>(); xaml.Subplatforms = new List<Platform>(); dx.Subplatforms = new List<Platform>(); c1OrgChart1.Header = uwp; } } |
Visual Basic コードの書き方
Visual Basic |
コードのコピー
|
---|---|
Public Class Platform Public Property Name As String End Property Public Property Subplatforms As IList(Of Platform) End Property End Class |
C# コードの書き方
C# |
コードのコピー
|
---|---|
public class Platform { public string Name { get; set; } public IList<Platform> Subplatforms { get; set; } } } |
この手順では、C1OrgChart コントロールにコンテンツを追加しました。次の手順では、このアプリケーションを実行します。