public function asViewMode($viewMode, callable $method)
    {
        $prevViewMode = $this->viewMode();
        $this->viewMode($viewMode);
        $method();
        $this->viewMode($prevViewMode);
    }