No public defender shall be eligible to a seat in the Legislature or to any other public elected office for which compensation is provided, under the laws and Constitution of the Commonwealth, excepting an office or commission in the militia of the Commonwealth during his continuance in office.
16 P.S. § 9960.10