public void setParentandCheckMaterialName(ModelVM parent) { _parent = parent; if (SelectedMaterialSetName == "") { SelectedMaterialSetName = _parent.MaterialSets[SelectedMaterial].Name; } }
public SelectionSetVM(string selectedMaterialSetName, ModelVM parent) { _parent = parent; SelectedFilterValues = new List <FilterSelection>(); ElementsIdsToInclude = new List <string>(); ElementsIdsToExclude = new List <string>(); SelectedMaterialSetName = selectedMaterialSetName; }
public SelectionSetVM(int selectedMaterial, ModelVM parent) { _parent = parent; SelectedFilterValues = new List <FilterSelection>(); ElementsIdsToInclude = new List <string>(); ElementsIdsToExclude = new List <string>(); SelectedMaterial = selectedMaterial; SelectedMaterialSetName = _parent.MaterialSets[Math.Max(selectedMaterial, 0)].Name; }
public FilterSetVM(string name, ModelVM parent, IEnumerable <string> filters) { _parent = parent; FilterItems = new ObservableCollection <FilterItemVM>(); foreach (var item in filters) { FilterItems.Add(new FilterItemVM(item, this)); } Name = name; }
public ElementVM(Element element, ModelVM parent) { _element = element; _parent = parent; _filters = new List <ElementFilterVM>(); for (int i = 0; i < _element.Filters.Length; i++) { var item = _element.Filters[i]; _filters.Add(new ElementFilterVM(this, _parent, i)); } }
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)); } }
public MainWindow() { var myelemset = new ElementSet("Category", "Material"); myelemset.Elements.Add(new Element("Elem 1", 120d, "Revit123", "Foundation", "Concrete")); myelemset.Elements.Add(new Element("Elem 2", 109.4d, "Revit124", "Foundation", "Concrete")); myelemset.Elements.Add(new Element("Elem 3", 24.2d, "Revit125", "Walls", "RC40")); ModelVM vm = new ModelVM(myelemset); DataContext = vm; InitializeComponent(); }
void importMaterials() { bool outputOK = false; ModelVM output = new ModelVM(); string filePath = vm.FilePath; try { var openDialog = new OpenFileDialog(); openDialog.Filter = @"Carbon model files |*.JSON"; openDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); openDialog.Multiselect = false; if (openDialog.ShowDialog() != DialogResult.OK) { return; } filePath = openDialog.FileName; using (var reader = File.OpenText(openDialog.FileName)) { var settings = new JsonSerializerSettings(); settings.Formatting = Formatting.Indented; settings.TypeNameHandling = TypeNameHandling.Auto; output = JsonConvert.DeserializeObject <ModelVM>(reader.ReadToEnd(), settings); } output.initialise(); output.SetChartColors(); output.updateCarbonVsCategoryChartValues(); outputOK = true; } catch (Exception ex) { MessageBox.Show("oops..." + Environment.NewLine + ex.Message); } if (outputOK) { foreach (var item in output.MaterialSets) { vm.ElementSet.MaterialSets.Add(item); } vm.initialise(); vm.UpdateAll(); RaisePropertyChanged(nameof(Model)); } }
public AppVM(ElementSet elementSet) { vm = new ModelVM(elementSet); }
public ElementFilterVM(ElementVM elem, ModelVM model, int ind) { this.ind = ind; _elem = elem; _modelVM = model; }
public ElementVM(Element element, ModelVM parent) { _element = element; _parent = parent; }