using System; using System.Collections; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Data; namespace FWindSoft.Wpf { [ValueConversion(typeof(IEnumerable),typeof(string))] public class ItemsToStringConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { var items = value as IEnumerable; if (items == null) return string.Empty; List tempItems = new List(); foreach (var item in items) { tempItems.Add(item); } return string.Join(",", tempItems); } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } }