title: Multiple ContentPresenters in one ControlTemplate
body: <p>Is it possible to have multiple ContentPresenters in a ControlTemplate?</p>
  
  <p>I created a CustomControl with two BindableProperties of type View: <code>ReadonlyContent</code> and <code>WritableContent</code>.
  The ControlTemplate Wraps two ContentPresenters where the Content is bound to either <code>ReadonlyContent</code> or <code>WritableContent</code>.</p>
  
  <p>Misteriously it only shows the content of one ContentPresenter in that case always <code>ReadonlyContent</code> uneffected by order of ContentPresenters or whatever.</p>
  
  <p>So the question again: Is it possible to have two or more ContentPresenters in a ControlTemplate?</p>
  
  <p>The ControlTemplate looks like this:</p>
  
  <pre><code>&lt;ContentView.ControlTemplate&gt;
      &lt;ControlTemplate&gt;
          &lt;Grid HorizontalOptions="Fill" VerticalOptions="Fill" RowSpacing="0" Margin="0" Padding="0"&gt;
              &lt;Grid.ColumnDefinitions&gt;
                  &lt;ColumnDefinition Width="40" /&gt;
                  &lt;ColumnDefinition Width="*" /&gt;
                  &lt;ColumnDefinition Width="40" /&gt;
              &lt;/Grid.ColumnDefinitions&gt;
  
              &lt;Button
                  Grid.Column="2"
                  ImageSource="{TemplateBinding IsReadonly, Converter={StaticResource BooleanToImageSourceConverter}}"
                  BackgroundColor="Transparent"
                  WidthRequest="40"
                  HeightRequest="25"
                  Padding="0"
                  Clicked="OnToggleIsReadonly"
                  x:Name="btnToggleEditMode"
                  Margin="0" /&gt;
              &lt;StackLayout Grid.Column="1" Orientation="Vertical"&gt;
                  &lt;ContentPresenter Content="{TemplateBinding ReadonlyContent, Mode=OneWay}" /&gt;
                  &lt;ContentPresenter Content="{TemplateBinding WriteableContent, Mode=OneWay}" /&gt;
              &lt;/StackLayout&gt;
          &lt;/Grid&gt;
      &lt;/ControlTemplate&gt;
  &lt;/ContentView.ControlTemplate&gt;
  </code></pre>
  
  <p>while the code behind of the control looks like this:</p>
  
  <pre><code>[XamlCompilation(XamlCompilationOptions.Compile)]
  public partial class ActivatableContent : ContentView
  {
      public static readonly BindableProperty IsReadonlyProperty = BindableProperty.Create(
          "IsReadonly",
          typeof(bool),
          typeof(ActivatableContent),
          true,
          BindingMode.TwoWay,
          propertyChanged: OnIsReadonlyChanged);
  
      public static readonly BindableProperty ReadonlyContentProperty = BindableProperty.Create(nameof(ReadonlyContent), typeof(View), typeof(ActivatableContent), propertyChanged: OnReadonlyContentChanged);
  
      public static readonly BindableProperty WritableContentProperty = BindableProperty.Create(nameof(WritableContent), typeof(View), typeof(ActivatableContent), propertyChanged: OnWritableContentChanged);
  
      public bool IsReadonly
      {
          get { return (bool)GetValue(IsReadonlyProperty); }
          set
          {
              SetValue(IsReadonlyProperty, value);
          }
      }
  
      public View ReadonlyContent
      {
          get { return (View)GetValue(ReadonlyContentProperty); }
          set { SetValue(ReadonlyContentProperty, value); }
      }
  
      public View WritableContent
      {
          get  { return (View)GetValue(WritableContentProperty); }
          set { SetValue(WritableContentProperty, value); }
      }
  
      public ActivatableContent()
      {
          InitializeComponent();
      }
  
      private static void OnIsReadonlyChanged(BindableObject bindable, object oldvalue, object newvalue)
      {
          ((ActivatableContent)bindable).IsReadonly = (bool)newvalue;
      }
  
      private static void OnReadonlyContentChanged(BindableObject bindable, object oldvalue, object newvalue)
      {
          var readonlyContent = (View)newvalue;
          ((ActivatableContent)bindable).ReadonlyContent = readonlyContent;
          SetInheritedBindingContext(readonlyContent, bindable.BindingContext);
      }
  
      private static void OnWritableContentChanged(BindableObject bindable, object oldvalue, object newvalue)
      {
          var writableContent = (View)newvalue;
          ((ActivatableContent)bindable).WritableContent = writableContent;
          SetInheritedBindingContext(writableContent, bindable.BindingContext);
      }
  
      private void OnToggleIsReadonly(object sender, EventArgs e)
      {
          IsReadonly = !IsReadonly;
      }
  
      /// &lt;summary&gt;Method that is called when the binding context changes.&lt;/summary&gt;
      protected override void OnBindingContextChanged()
      {
          base.OnBindingContextChanged();
  
          var controlTemplate = ControlTemplate;
          if (ReadonlyContent != null &amp;&amp; controlTemplate != null)
          {
              SetInheritedBindingContext(ReadonlyContent, BindingContext);
          }
  
          if (WritableContent != null &amp;&amp; controlTemplate != null)
          {
              SetInheritedBindingContext(WritableContent, BindingContext);
          }
      }
  }
  </code></pre>