title: WPF Creating DataTemplate for a control that doesn't have a DataTemplate property
body: <p>I'm creating a custom TickBar for a Slider. This CustomTickBar allows me to put different markers on the Slider. I'm gonna use the following model:</p>
  
  <pre><code>Interface IModel
  {
     string Id;
  }
  
  Class Model1 : IModel
  {
     string Id;
     string SomeProperty;
  }
  
  Class Model2 : IModel
  {
     string Id;
     string SomeOtherProperty;
  }
  </code></pre>
  
  <p>The idea is I provide a <code>List&lt;IModel&gt;</code> to this TickBar control and based on the type of <code>IModel</code> the marker icon would change; e.g. for <code>Model1</code> it would be a triangle and for <code>Model2</code> it would be a rectangle. I understand this would be possible using a DataTemplate. But WPF TickBar doesn't have a DataTemplate property. Now is there a way I can do this using a DataTemplate property and subclassing TickBar?</p>
  
  <p>Note: I understand I can create custom tick using OnRender(), but I'm trying to check if there's a way to do it by writing as less code-behind as possible. </p>