title: Xamarin: Open page from string
body: <p>I'm just starting to learn programming with Xamarin and C# and I really struggle with this question.</p>
  
  <p>I have a master detail app. In my master page I would like to easily add buttons that link to a detail page.
  To do that I would like to make a method that I can call to with two parameters:
  Button text and the detail page linked to the button.</p>
  
  <p>so basicly:</p>
  
  <pre><code>public class MainLink : Button
      {
          public MainLink(string name,string page)
          {
              Text = name;
              Command = new Command(o =&gt; {
                  App.MasterDetailPage.Detail = new NavigationPage(new page);
                  App.MasterDetailPage.IsPresented = false;
              });
          }
      }
  </code></pre>
  
  <p>This is what I have so far. But the line:</p>
  
  <pre><code>App.MasterDetailPage.Detail = new NavigationPage(new page);
  </code></pre>
  
  <p>ofcourse doesn't work.</p>
  
  <p>How can I convert a string to a page type when I know the page's name already?</p>