After digging the code I found the solution.
Write below code at the starting of your controller's action execute function's body.
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$objectManager->get(\Magento\Framework\View\DesignInterface::class)->setDesignTheme('Magento/luma', 'frontend');
For example :
public function execute()
{
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$objectManager->get(\Magento\Framework\View\DesignInterface::class)->setDesignTheme('Magento/luma', 'frontend');
$post = $this->initModel();
if (!$post) {
throw new NotFoundException(__('Page not found'));
die;
}
/* @var \Magento\Backend\Model\View\Result\Page $resultPage */
$resultPage = $this->resultFactory->create(ResultFactory::TYPE_PAGE);
$this->_eventManager->dispatch(
'blog_page_render',
['post' => $post, 'controller_action' => $this]
);
return $resultPage;
}
In setDesignTheme
pass your theme's name and area (frontend|adminhtml) as :
$objectManager->get(\Magento\Framework\View\DesignInterface::class)->setDesignTheme('Theme_Name', 'Area');
Hope this will help others :)