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

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

    public class TapestryDescriptionConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (targetType == typeof(string) && value is double)
            {
                var index = (int)(double)value - 1;
                var list = ViewModel.TapestryDescriptons;
                return index > -1  && index < list.Count  ? list[index] : "Unknown";
            }
            return value;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
