Container in constructor of navbar form

In navbar, I have a form that it needs to have access to the container (Choice field type).
I didn't find an easy way except to pass the container in constructor of the form as parameter