using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

namespace OrgChartSamples
{
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class MainSample : Page
    {
        public MainSample()
        {
            this.InitializeComponent();

            // create hieararchy
            Platform winrt = new Platform() { Name = Strings.StringWindowsRT };
            Platform winjs = new Platform() { Name = Strings.StringHTML };
            Platform xaml = new Platform() { Name = Strings.StringXAML };
            Platform dx = new Platform() { Name = Strings.StringDirectX };

            winrt.Subplatforms = new List<Platform>();
            winrt.Subplatforms.Add(winjs);
            winrt.Subplatforms.Add(xaml);
            winrt.Subplatforms.Add(dx);

            winjs.Subplatforms = new List<Platform>();
            winjs.Subplatforms.Add(new Platform() { Name = Strings.StringJavaScript });

            xaml.Subplatforms = new List<Platform>();
            xaml.Subplatforms.Add(new Platform() { Name = Strings.StringCPoundSign });
            xaml.Subplatforms.Add(new Platform() { Name = Strings.StringVB });

            dx.Subplatforms = new List<Platform>();
            dx.Subplatforms.Add(new Platform() { Name = Strings.StringCDoublePlus });

            // set to orgchart
            c1OrgChart1.Header = winrt;
        }

    }

    public class Platform
    {
        public string Name { get; set; }
        public IList<Platform> Subplatforms { get; set; }
    }
}
