# C1.WPF.Schedule.TimeSlotTemplateSelector

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_WPF_Schedule_TimeSlotTemplateSelector" data-uid="C1.WPF.Schedule.TimeSlotTemplateSelector" class="text-break">TimeSlotTemplateSelector Class
</h1>
  <div class="markdown level0 summary"><p>This class provides a way to choose a DataTemplate for the <a class="xref" href="C1.WPF.Schedule.VisualInterval.html">VisualInterval</a>
object representing the single time slot in DayView/WorkWeekView modes.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><span class="xref">TimeSlotTemplateSelector</span></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="C1.WPF.Schedule.html">C1.WPF.Schedule</a></h6>
  <h6><strong>Assembly</strong>: C1.WPF.Schedule.4.6.2.dll</h6>
  <h5 id="C1_WPF_Schedule_TimeSlotTemplateSelector_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class TimeSlotTemplateSelector : C1DataTemplateSelector</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Class TimeSlotTemplateSelector
    Inherits C1DataTemplateSelector</code></pre>
  </div>
  <h5 id="C1_WPF_Schedule_TimeSlotTemplateSelector_remarks"><strong>Remarks</strong></h5>
  <div class="markdown level0 remarks"><p>For the sample of using look at OneDayStyleBase in generic.xaml.
<ol><li><p>Create an instance of this class:</p><p> &lt;local:TimeSlotTemplateSelector x:Key=&quot;TimeSlotTemplateSelector&quot;/&gt;</p></li><li>
Define two DataTemplates:
<ul><li>
with the key &quot;PART_C1Scheduler_FreeSlot_Template&quot; for free time;
</li><li>
with the key &quot;PART_C1Scheduler_WorkSlot_Template&quot; for working time.<br>
</li></ul></li><li><p>Specify ItemsControl.ItemTemplateSelector for the <a class="xref" href="C1.WPF.Schedule.C1SchedulerPresenter.html">C1SchedulerPresenter</a> object:</p><p> &lt;local:C1SchedulerPresenter ItemTemplateSelector=&quot;{StaticResource TimeSlotTemplateSelector}&quot; /&gt;</p></li></ol>
Note, that if you use this method for choosing VisualInterval DataTemplate, you shouldn't set
<a class="xref" href="C1.WPF.Schedule.C1Scheduler.VisualIntervalTemplate.html#C1_WPF_Schedule_C1Scheduler_VisualIntervalTemplate">VisualIntervalTemplate</a> property.
</div>
  <h3 id="constructors">Constructors
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_WPF_Schedule_TimeSlotTemplateSelector__ctor" data-uid="C1.WPF.Schedule.TimeSlotTemplateSelector.#ctor">
          <a class="xref" href="C1.WPF.Schedule.TimeSlotTemplateSelector.-ctor.html#C1_WPF_Schedule_TimeSlotTemplateSelector__ctor">TimeSlotTemplateSelector()</a>
        </td>
        <td class="markdown level1 summary"></td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_WPF_Schedule_TimeSlotTemplateSelector_SelectTemplate_System_Object_System_Windows_DependencyObject_" data-uid="C1.WPF.Schedule.TimeSlotTemplateSelector.SelectTemplate(System.Object,System.Windows.DependencyObject)">
          <a class="xref" href="C1.WPF.Schedule.TimeSlotTemplateSelector.SelectTemplate.html#C1_WPF_Schedule_TimeSlotTemplateSelector_SelectTemplate_System_Object_System_Windows_DependencyObject_">SelectTemplate(object, DependencyObject)</a>
        </td>
        <td class="markdown level1 summary"><p>Returns the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.datatemplate">DataTemplate</a> object for the specified group if it is found in resources.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
