using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Data; using Tango.BL.Entities; using System.Media; namespace Tango.PPC.Jobs.Converters { /// /// Converts a job to representing the job segments as a pie chart. /// /// public class JobToPieImageConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { Job job = value as Job; if (job != null) { String[] param = parameter.ToString().Split(','); double width = double.Parse(param[0]); double height = double.Parse(param[1]); return job.CreateSegmentsPie(width, height); } return null; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } }