private void OnLoadTemplate() { OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "JSON (*.json)|*.json"; if (ofd.ShowDialog() == true) { foreach (var dm in JsonConvert.DeserializeObject <List <DoseMetricModel> >(File.ReadAllText(ofd.FileName))) { var dmm = new DoseMetricModel(_plan) { InputUnit = dm.InputUnit, InputUnits = dm.InputUnits, InputValue = dm.InputValue, Metric = dm.Metric, OutputUnit = dm.OutputUnit, OutputUnits = dm.OutputUnits, Structure = dm.Structure, Tolerance = dm.Tolerance }; dmm.GetOutputValue(); _eventAggregator.GetEvent <AddDoseMetricEvent>().Publish(dmm); } } }
private void OnAddDoseMetric(DoseMetricModel dm) { DoseMetrics.Add(dm); }
private void OnAddMetric(DoseMetricModel obj) { DoseMetrics.Add(obj); }