title: Generate xaml file (page) at runtime and reference it with uri
body: <p>Im working on a wpf application based on Modern UI that have a gui designer part where the user can add and then drag/drop/resize etc. the control. The properties for the controls position, size etc. is stored in a table in a database. There are several pages where the user can place the controls.</p>
  
  <p>What I have:
  On application start the controls are positioned on a canvas on a page (xaml file) based on a page id. Those pages are all in the project when I compile. </p>
  
  <p>What I want:
  I need a way to dynamically instantiate those pages and to be able to referens each one with an uri.</p>
  
  <p>What I have tried:
  I have tried to have a "template page" and instantiate each new page from there. I then position the controls on it. Then i use xamlwriter.save to create a xaml file that I hope to be able to reference with a Uri.
  But I fail when I try to reference the xaml file.</p>
  
  <p>If you can help me with my solution or if there is a better way, please enlighten me.</p>
  
  <p>Best regards,
  Fredrik</p>