title: DataBinding in TemplateSelector
body: <p>I'm using a few data templates to display different values, those data templates are chosen by DataTemplateSelector. Every control has some DataBinding to my custom objects. Objects are part of an ObservableCollection and then DTS is choosing the template for them. The problem is: When I try to run my app with some pre defined objects (in code) the selected controls has no values. Ex:</p>
  
  <pre><code>  &lt;!--Date Template--&gt;
      &lt;DataTemplate x:Key="DateTemplate"&gt;
          &lt;WrapPanel x:Name="DateTemplate_Panel"&gt;
              &lt;WrapPanel.DataContext&gt;
                  &lt;params:FTParams /&gt;
              &lt;/WrapPanel.DataContext&gt;
              &lt;Label x:Name="DateTemplate_Label" Content="{Binding Path=Name}" /&gt;
              &lt;DatePicker x:Name="DateTemplate_DatePicker" SelectedDate="{Binding Path=SelectedValue}" SelectedDateFormat="Long" /&gt;
          &lt;/WrapPanel&gt;
      &lt;/DataTemplate&gt;
  </code></pre>
  
  <p>Controls are responding only when I change their value (<code>INotifyPropertyChanged</code> is implemented) </p>
  
  <p>If I set </p>
  
  <pre><code>&lt;Label Content="{Binding Path=SelectedValue}"/&gt; 
  </code></pre>
  
  <p>and I select a date in DataPicker then the content is loaded correctly. But I really need to have this values loaded on startup.
  Can you give me some advice?</p>