public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
IList collection;
if (value is ChildItemCollection<LayerModel, LayerModel>)
collection = ((ChildItemCollection<LayerModel, LayerModel>) value).ToList();
else
collection = (IList) value;
var view = new ListCollectionView(collection);
var sort = new SortDescription(parameter.ToString(), ListSortDirection.Ascending);
view.SortDescriptions.Add(sort);
return view;
}