How to use 'use-ajax' class with pages created by controller? I'm trying to use 'use-ajax' class to load a page inside a modal box.

My Page is dynamically created using node id pass on my page controller

My link looks like this 

Any idea on how can I achieve my goal?
This is a render array that create a link that open a modal windows.

use Drupal\Core\Url;

public function build() {
$output = array();
$output['overlay_link'] = array(
  '#type' =&gt; 'link',
  '#title' =&gt; $this-&gt;t('Add an activity'),
  '#url' =&gt; Url::fromRoute('node.add', ['node_type' =&gt; 'event'], ['query' =&gt; ['destination' =&gt; $destination],
    'absolute' =&gt; TRUE,]),
  '#attributes' =&gt; [
    'class' =&gt; ['use-ajax', 'button', 'secondary'],
    'data-dialog-type' =&gt; 'modal',
    'data-dialog-options' =&gt; \Drupal\Component\Serialization\Json::encode(['title' =&gt; t('Add an activity'), 'width' =&gt; 800,]),
  ],
);
 return $output;
}