using System;
using System.Windows;
using System.Windows.Data;

namespace GeoDashboard
{
    public partial class HomeValueTile : System.Windows.Controls.UserControl
    {
        public HomeValueTile()
        {
            InitializeComponent();
        }
    }

    public class IndexDescriptionConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (targetType == typeof(string) && value is double)
            {
                var desc =
                    (double)value < 50 ? "Substantially lower" :
                    (double)value < 80 ? "Lower" :
                    (double)value < 100 ? "Slightly lower" :
                    (double)value < 120 ? "Slightly higher" :
                    (double)value < 200 ? "Higher" :
                    "Substantially higher";
                return desc + " than the national average.";
            }
            return value;
        }
        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
