title: How can I use a type reference in a XAML / Universal Windows app?
body: <p>I want to encapsulate frame navigation in custom command und use this command declaratively as a static ressource. I found</p>
  
  <pre class="lang-cs prettyprint-override"><code>Frame.Navigate(typeof(MainPage));
  </code></pre>
  
  <p>which expects a type parameter (type of the target page) to navigate to. My first attempt was to use a generic ICommand implementation that passes the type of the target page as generic type parameter. As of <a href="https://stackoverflow.com/a/14521435/1641867"><code>x:TypeArguments</code> is not supported for Windows Store Apps</a>, I tried to define a property</p>
  
  <pre class="lang-cs prettyprint-override"><code>public Type TargetType { get; set; }
  </code></pre>
  
  <p>for the command. But no luck again: if I try to set the property via a xaml attribute</p>
  
  
  
  <pre><code>`&lt;NavigationCommand TargetType="MainPage"&gt;
  </code></pre>
  
  <p>I get a compile-time error saying </p>
  
  <pre><code>MainPage is not supported in a Windows universal project
  </code></pre>