private FilterConsumerViewModel AddConsumerInternal(Consumer consumer, FilterConsumerViewModel parentConsumerViewModel= null) { var consumerViewModel = new FilterConsumerViewModel(consumer); if (parentConsumerViewModel != null) parentConsumerViewModel.AddChild(consumerViewModel); foreach (var childConsumer in consumer.Children) AddConsumerInternal(childConsumer, consumerViewModel); return consumerViewModel; }
void AddChildPlainConsumers(FilterConsumerViewModel parentViewModel) { AllConsumers.Add(parentViewModel); foreach (var childViewModel in parentViewModel.Children) AddChildPlainConsumers(childViewModel); }