Exemple #1
0
        private static List <MaterialParameterViewModel> GetMetalParameterSection(Metal material)
        {
            var metalSection = new List <MaterialParameterViewModel>();
            var metalField   = new NumericMaterialParameterViewModel(ParameterType.WorkFunction)
            {
                Minimum  = 0.0,
                Maximum  = 10,
                StepSize = 0.1,
                Value    = material.WorkFunction?.ElectronVolts ?? 0.0
            };

            metalField.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName != "Value")
                {
                    return;
                }
                material.WorkFunction = Energy.FromElectronVolts(metalField.Value);
            };

            metalSection.Add(GetThicknessSection(material));
            metalSection.Add(metalField);
            return(metalSection);
        }