using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Data; namespace Tango.SharedUI.Converters { public class PathToShortPathConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { if (value != null) { String path = value.ToString(); if (!String.IsNullOrWhiteSpace(path) && path.Length > 10) { return "..\\" + Path.GetFileName(path); } else { return path; } } return null; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } } }