Example #1
0
        public void DeleteMaterial(IModelMaterial material)
        {
            if (material is null)
            {
                throw new ArgumentNullException(nameof(material));
            }

            if (_elements.Any(element => element.Material == material))
            {
                throw new InvalidOperationException($"Material {material.Name} cannot be deleted. It is being used by one or more elements");
            }

            _materials.Remove(material);
            EnsureEntitiesAreSorted(_materials);
        }
Example #2
0
 public MaterialViewModel(IModelMaterial modelMaterial)
 {
     ModelMaterial = modelMaterial;
 }