public function runBeforeRenderCallbacks()
    {
        $this->runningEventsBeforeRender = true;

        foreach ($this->runBeforeRenderCallbacks as $callback) {
            $callback();
        }

        $this->runBeforeRenderCallbacks = [];

        // Ask the view to notify sub leaves
        $this->view->runBeforeRenderCallbacks();

        $this->runningEventsBeforeRender = false;
    }