using BoxOfficeDashboard.Models;
using System;
using System.Collections.Generic;
using System.Text;
using Windows.UI.Xaml.Data;

namespace BoxOfficeDashboard.Converters
{
    public class OverallGrossConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            List<Studio> studios = value as List<Studio>;
            double total = 0;
            foreach(Studio s in studios)
            {
                total += s.Gross;
            }
            return total / 1000;
        }

        public object ConvertBack(object value, Type targetType, object parameter, string language)
        {
            throw new NotImplementedException();
        }
    }

    public class GrossConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            double total = (double)value;
            return total / 1000;
        }

        public object ConvertBack(object value, Type targetType, object parameter, string language)
        {
            throw new NotImplementedException();
        }
    }

}
