title: A class derived Control that has a Canvas in template, I want to work like canvas
body: <p>I have a class <code>Tableau</code> derived from <code>Windows.Controls.Control</code>, its template contains a <code>Canvas</code>:</p>
  
  <pre><code>    &lt;Style TargetType="{x:Type local:Tableau}"&gt;
          &lt;Setter Property="SnapsToDevicePixels" Value="True"/&gt;
          &lt;Setter Property="Template"&gt;
              &lt;Setter.Value&gt;
                  &lt;ControlTemplate TargetType="{x:Type local:Tableau}"&gt;
                      &lt;Grid DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"&gt;
                          &lt;ScrollViewer x:Name="ScrollViewer"
                                        HorizontalScrollBarVisibility="{Binding RelativeSource={RelativeSource TemplatedParent},Path=HorizontalScrollBarVisibility}" 
                                        VerticalScrollBarVisibility="{Binding RelativeSource={RelativeSource TemplatedParent},Path=VerticalScrollBarVisibility}"
                                        &gt;
                              &lt;Canvas x:Name="Diagram" 
                                      HorizontalAlignment="Stretch" 
                                      VerticalAlignment="Stretch"
                                      Background="{Binding RelativeSource={RelativeSource TemplatedParent},Path=Background}"
                                      &gt;
                                  &lt;Canvas.RenderTransform&gt;
                                      &lt;ScaleTransform CenterX="0"
                                                      CenterY="0"
                                                      ScaleX="{Binding RelativeSource={RelativeSource TemplatedParent},Path=Scale}"
                                                      ScaleY="{Binding RelativeSource={RelativeSource TemplatedParent},Path=Scale}"
                                                      /&gt;
                                  &lt;/Canvas.RenderTransform&gt;
                              &lt;/Canvas&gt;
                          &lt;/ScrollViewer&gt;
                      &lt;/Grid&gt;
                  &lt;/ControlTemplate&gt;
              &lt;/Setter.Value&gt;
          &lt;/Setter&gt;
      &lt;/Style&gt;
  </code></pre>
  
  <p>and <code>Tableau</code> class is:</p>
  
  <pre><code>    public class Tableau:Control
      {
          private Canvas _canvas;
          public Canvas Canvas
          {
              get { return _canvas; }
          }
  
          static Tableau()
          {
              FrameworkElement.DefaultStyleKeyProperty.OverrideMetadata(
                  typeof(Tableau), new FrameworkPropertyMetadata(typeof(Tableau)));
          }
  
          public Tableau()
              : base()
          {
              this.Loaded += Tableau_Loaded;
          }
  
          private void Tableau_Loaded(object sender, RoutedEventArgs e)
          {
              _canvas = (Canvas)this.Template.FindName("Diagram", this);
          }
      }
  </code></pre>
  
  <p>I want to use this as a canvas, something like this:</p>
  
  <pre><code>    &lt;local:Tableau&gt;
              &lt;Rectangle Fill="AliceBlue" Stroke="Black" Width="100" Height="100" Canvas.Top="10"/&gt;
              &lt;Rectangle Fill="AliceBlue" Stroke="Black" Width="100" Height="100" Canvas.Left="130" Canvas.Top="50"/&gt;
      &lt;/local:Tableau&gt;
  </code></pre>
  
  <p>It is possible or not, if yes how?</p>