public TypeDefinitionViewModel( [NotNull] CommandCollection commands, [NotNull] ITypeDefinition definition, [NotNull] TypeDefinitionContentViewModel.Factory typeDefinitionContentFactory, [NotNull] ManagedObjectInstanceContentViewModel.Factory managedObjectContentFactory, [NotNull] ListContentViewModel.Factory listContentFactory) { this.commands = commands ?? throw new ArgumentNullException(nameof(commands)); this.definition = definition ?? throw new ArgumentNullException(nameof(definition)); this.typeDefinitionContentFactory = typeDefinitionContentFactory ?? throw new ArgumentNullException(nameof(typeDefinitionContentFactory)); this.managedObjectContentFactory = managedObjectContentFactory ?? throw new ArgumentNullException(nameof(managedObjectContentFactory)); this.listContentFactory = listContentFactory ?? throw new ArgumentNullException(nameof(listContentFactory)); var model = this.typeDefinitionContentFactory(this.definition); model.AppendToTrail += this.ModelOnAppendToTrail; this.content = model; IObservable <bool> canExecute = this.WhenAnyValue(x => x.CanExecutePathBack); this.PathBackCommand = ReactiveCommand.CreateFromTask(this.ExecutePathBackAsync, canExecute); }
public TypeDefinitionViewModel( [NotNull] CommandCollection commands, [NotNull] ITypeDefinition definition, [NotNull] TypeDefinitionContentViewModel.Factory typeDefinitionContentFactory, [NotNull] ManagedObjectInstanceContentViewModel.Factory managedObjectContentFactory, [NotNull] ListContentViewModel.Factory listContentFactory) { this.commands = commands ?? throw new ArgumentNullException(nameof(commands)); this.definition = definition ?? throw new ArgumentNullException(nameof(definition)); this.typeDefinitionContentFactory = typeDefinitionContentFactory ?? throw new ArgumentNullException(nameof(typeDefinitionContentFactory)); this.managedObjectContentFactory = managedObjectContentFactory ?? throw new ArgumentNullException(nameof(managedObjectContentFactory)); this.listContentFactory = listContentFactory ?? throw new ArgumentNullException(nameof(listContentFactory)); var model = this.typeDefinitionContentFactory(this.definition); model.AppendToTrail += this.ModelOnAppendToTrail; this.content = model; }