using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Data; namespace Muchinfo.MTPClient.Infrastructure.Converters { public class StringToIntConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { decimal result = 0; if (value != null) { decimal.TryParse(value.ToString(), out result); } return result; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } } }