title: Content added to DevExtreme dxPopup not working unless Popup has been shown already
body: <p>I am using a DevExtreme Popup that will show whenever a user selects an option from a SelectBox. The Popup will identify placeholder values inside the selected value and present the user options to replace them with.</p>
  
  <p>When the SelectBox value changes, I look for placeholders and append a dxSelectBox for each placeholder to a div <code>valuesList</code> inside the popup.</p>
  
  <pre><code>    var matches = selectedValue.match(templateRegex);
  
      if (matches.length &gt; 0) {
          matches.forEach(function (m) {
              var newDiv = $("&lt;div/&gt;");
              newDiv.dxSelectBox();
              newDiv.appendTo("#valuesList");
          });
  
          $("#myPopup").dxPopup("instance").show();
      }
  </code></pre>
  
  <p>The problem is the first time this runs, it doesn't append anything to the Popup content. Using the debugger I confirm that the code does run, but nothing gets added. The popup shows with no content. However, if I select the value again in the SelectBox, it runs and the popup gets new content appended to it as it should, as well as all subsequent changes. It's only the first time that doesn't work.</p>
  
  <p>I confirmed this by adding this to the JavaScript:</p>
  
  <pre><code>$(document).ready(function () {
      $("#myValuePopup").dxPopup("instance").show();
      $("#myValuePopup").dxPopup("instance").hide();
  });
  </code></pre>
  
  <p>With that added, content is correctly appending the first time I select a new value from the SelectBox, confirming that it only works if the Popup has already been shown. This seems to be a sloppy solution though, and it requires adding a bunch of checks to the onHidden event handler for the Popup since some variables it uses aren't initialized yet, so I'd rather not have to resort to it.</p>
  
  <p>Is there another way to pre-initialize the dxPopup? I couldn't find anything going through the documentation. And the Popup's <code>_initialized</code> property is true even before being shown the first time.</p>
  
  <p>Update:</p>
  
  <p>The dxPopup is created using Razor inside my View:</p>
  
  <pre><code>@(Html.DevExtreme().Popup()
          .ID("myPopup")
          .OnHidden("myPopupClosed")
          .ContentTemplate(
              @&lt;text&gt;
              &lt;div id="valuesList"&gt;
  
              &lt;/div&gt;
              &lt;/text&gt;
          )
      )
  </code></pre>