public MainWindow() { var mySet = GWPMaterialSet.GetDefaultGWPConcreteSetSeparateSteel(); MaterialSetVM vm = new MaterialSetVM(mySet, this); DataContext = vm; InitializeComponent(); }
public MaterialSetVM(GWPMaterialSet materialSet, IViewModelParent parent) { _materials = materialSet; _parent = parent; //_materialVMs = new ObservableCollection<MaterialVM>(); MaterialNames = new ObservableCollection <string>(); foreach (var item in materialSet.Materials) { MaterialNames.Add(item.Name); //_materialVMs.Add(new MaterialVM(item, this)); } }
public MaterialSetVM(string name, GWPMaterialSet materialSet, ModelVM parent) { _materials = materialSet; _parent = parent; _materialVMs = new ObservableCollection <MaterialVM>(); MaterialNames = new List <string>(); foreach (var item in materialSet.Materials) { MaterialNames.Add(item.Name); _materialVMs.Add(new MaterialVM(item)); } }