namespace SalesAnalysis
{
    using System;
    using System.Windows.Controls;
    using System.Windows.Navigation;

    /// <summary>
    /// <see cref="Page"/> class to present information about the current application.
    /// </summary>
    public partial class About : Page
    {
        /// <summary>
        /// Creates a new instance of the <see cref="About"/> class.
        /// </summary>
        public About()
        {
            InitializeComponent();

            this.Title = ApplicationStrings.AboutPageTitle;
 
           _tbVersionSample.Text = string.Format("Sample Version: {0}", GetVersion(this.GetType()));
           _tbVersionGrid.Text = string.Format("C1FlexGrid Version: {0}", GetVersion(typeof(C1.Silverlight.FlexGrid.C1FlexGrid)));
           _tbVersionChart.Text = string.Format("C1Chart Version: {0}", GetVersion(typeof(C1.Silverlight.Chart.C1Chart)));
        }
        string GetVersion(Type t)
        {
            var v = t.AssemblyQualifiedName.Split(',')[2];
            return v.Split('=')[1];
        }
    }
}