public function replaceAll($stack, $resetBodyKey = true)
    {
        if (! $stack instanceof DataCollection) {
            $stack = new DataCollection($stack);
        }

        $this->stack = $stack;

        if ($resetBodyKey) {
            $this->bodyKey = null;

            foreach ($stack as $key => $view) {
                if ($view->getType() === View::PART_BODY_PLACEHOLDER) {
                    $this->bodyKey = $key;
                }
            }
        }
    }