public function prepare(Session $session = null, bool $is_root_form = true)
    {
        foreach ($this->form_elements as $field)
        {
            if ($field instanceof Form)
                $field->prepare(null, false);
        }

        $params = ['form' => $this, 'session' => $session, 'is_root_form' => $is_root_form];
        $params = TypedDictionary::wrap($params);
        Hook::execute('Wedeto.HTTP.Forms.Form.prepare', $params);

        if ($is_root_form)
            $this->form_elements['_form_name'] = new FormField('_form_name', Type::STRING, "hidden", $this->name);

        return $this;
    }