This samples shows how to add annotations (widgets) and controls to layers in a PDF document.
All widget and control classes have Layer property. All you need to do to associate a widget or a control with a layer is to assign the layer to the property.
To remove a widget or a control from a layer you only need to set the widget / control Layer property to null.