Apply "override bool Selected" to All components?

Hello

How we can apply this to all components in the canvas?

public override bool Selected => true; /// or false

I tried with: component.Selected = true; but didn’t give the expected result.