public Output2ViewModel(IMultiValueProvider multiValueProvider) { var source = new ObservableCollection<string>(); this.Values = new ReadOnlyObservableCollection<string>(source); ((INotifyCollectionChanged)multiValueProvider.Values).CollectionChanged += (_, e) => { // 割り切ってAddしか処理しない if (e.Action == NotifyCollectionChangedAction.Add) { source.Insert(e.NewStartingIndex, e.NewItems.Cast<int>().Select(x => $"Input value is {x}").First()); } }; }
public Output2ViewModel(IMultiValueProvider multiValueProvider) { var source = new ObservableCollection <string>(); this.Values = new ReadOnlyObservableCollection <string>(source); ((INotifyCollectionChanged)multiValueProvider.Values).CollectionChanged += (_, e) => { // 割り切ってAddしか処理しない if (e.Action == NotifyCollectionChangedAction.Add) { source.Insert(e.NewStartingIndex, e.NewItems.Cast <int>().Select(x => $"Input value is {x}").First()); } }; }