The right of election of a surviving spouse may be waived, wholly or partially, before or after marriage or before or after the death of the decedent.