﻿using System;
using System.Globalization;
using System.Windows.Data;

namespace SWManager.Converter
{
    public class LargerThanConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            try
            {
                double val1, val2;

                double.TryParse(value.ToString(), out val1);
                double.TryParse(parameter.ToString(), out val2);

                return val1 > val2;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            return false;
        }

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