using System;
using System.Linq;
using System.Windows.Controls;
using System.Collections.Generic;
using C1.Chart;

namespace FlexChart101
{
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class LegendAndTitles : UserControl
    {
        List<DataItem> _data;
        List<string> _positions;

        public LegendAndTitles()
        {
            this.InitializeComponent();
        }

        public List<DataItem> Data
        {
            get
            {
                if (_data == null)
                {
                    _data = DataCreator.CreateData();
                }

                return _data;
            }
        }

        public List<string> Legends
        {
            get
            {
                if (_positions == null)
                {
                    _positions = Enum.GetNames(typeof(Position)).ToList<string>();
                }

                return _positions;
            }
        }
    }
}
