Пример #1
0
 /// <summary>
 /// 根据已有型号实例化新建型号窗口
 /// </summary>
 /// <param name="model"></param>
 public CreateNewModelWindow(Model model)
     : this()
 {
     modelCreater = new ModelCreator(model);
     modelCreater.CreatingModel.BladeDiameter = int.Parse(txtBladeDiameter.Text);
     modelCreater.CreatingModel.BladeLength = int.Parse(txtBladeLength.Text);
     this.DataContext = modelCreater;
 }
Пример #2
0
        /// <summary>
        /// 根据型号名实例化新建型号窗口
        /// </summary>
        /// <param name="modelName">型号名</param>
        public CreateNewModelWindow(string modelName)
            : this()
        {
            //根据型号名实例化一个型号创建器
            modelCreater = new ModelCreator(modelName);

            modelCreater.CreatingModel.BladeDiameter = int.Parse(txtBladeDiameter.Text);
            modelCreater.CreatingModel.BladeLength = int.Parse(txtBladeLength.Text);
            this.DataContext = modelCreater;
        }