title: Base Pages in XAML Xamarin forms
body: <p>I have multiple user controls in XAML with shared code that I want to put in a base page so I want </p>
  
  <pre><code>singleLine.xaml --&gt; singleLine.xaml.cs --- &gt; basepage.cs
  
  doubleLine.xaml --&gt; doubleLine.xaml.cs --- &gt; basepage.cs
  </code></pre>
  
  <p>singleLine.xaml</p>
  
  <p>
  </p>
  
  <pre><code>&lt;StackLayout Orientation="Horizontal" HorizontalOptions="FillAndExpand" Margin="0" BackgroundColor="White"&gt;
    &lt;StackLayout.GestureRecognizers&gt;
      &lt;TapGestureRecognizer Tapped="OnTapped"/&gt;
    &lt;/StackLayout.GestureRecognizers&gt;  
  
    &lt;StackLayout Orientation="Horizontal" HorizontalOptions="FillAndExpand" Margin="0"  BackgroundColor="White"&gt;
          &lt;Label x:Name="ViewTitle" Style="{StaticResource lblJobDetailName}" /&gt;
          &lt;Label x:Name="ViewValue" Style="{StaticResource lblJobDetailValue}" /&gt;
      &lt;/StackLayout&gt; 
    &lt;Image x:Name="EditIcon" Source="edit.png" Margin="15,15,15,15" IsVisible="false" WidthRequest="15" HeightRequest="15" /&gt;
  &lt;/StackLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>singleLine.xaml.cs</p>
  
  <pre><code> using System;
   using Xamarin.Forms;
  
   namespace Client.UI.Pages.UserControls
   {
      public partial class SingleLine :   Client.UI.Pages.UserControls.BaseUserControl
      {  
          // do stuff
  
  
          #region Constructors 
          public SingleLine()
          {
                InitializeComponent();
          }
          #endregion
      }
  </code></pre>
  
  <p>}</p>
  
  <p>basepage.cs</p>
  
  <pre><code>  using System;
    using System.Collections.Generic;
  
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using Xamarin.Forms;
  
    namespace Client.UI.Pages.UserControls
    {
       public class BaseUserControl: Xamarin.Forms.ContentView
       {
            public BaseUserControl()
            {
            }
       }
    }
  </code></pre>
  
  <p>The system wont compile and i get the following error</p>
  
  <pre><code> Error  CS0234  The type or namespace name 'BaseUserControl' does not exist in the namespace 'Client.UI.Pages.UserControls' (are you missing an assembly reference?)    Client.UI   C:\Projects\Client.UI\Pages\UserControls\SingleLineItem.xaml.cs 8   Active
  </code></pre>
  
  <p>This seems like a simple thing to do but is causing a headache, any ideas ?</p>