using System; using System.Collections; using System.Globalization; using System.Linq; using System.Windows.Data; using RecipeEditorLib.RecipeModel.Params; namespace MECF.Framework.UI.Client.CenterViews.Editors.Converters { public class RecipeStepsCollectionToSelectedItemsConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value is RecipeStepCollection coll) return coll.ToList(); return null; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { if (value is IList list) { return new RecipeStepCollection(list.Cast()); } return null; } } }