public void CheckServoType() { this.gridMain.Children.Clear(); servoType = UBT.GetServoType(); switch (servoType) { case CONST.SERVO_TYPE.UBT: { ucServo = new UcMain_Servo_UBT(); ucServo.InitObject(UBT, updateInfo, commandHandler); this.gridMain.Children.Add(ucServo); break; } case CONST.SERVO_TYPE.HaiLzd: { ucServo = new UcMain_Servo_HaiLzd(); ucServo.InitObject(UBT, updateInfo, commandHandler); this.gridMain.Children.Add(ucServo); break; } } }