title: ComboBox selected item binding not showing the initial value - then working OK
body: <p>I have a weird problem with something simple I suppose. 
  I have a combobox with two bindings set up - one for ItemsSource and another for SelectedItem.<br>
  The selected item is not working on initial startup, but then it works OK. Output does not indicate any binding problems, I have also set up a TextBlock with the same binding to see if it works - and it does.</p>
  
  <p>Here's the code</p>
  
  <pre><code>  &lt;ComboBox IsSynchronizedWithCurrentItem="True" IsEditable="False"
                            Name="ProgramsCollectionComboBox"
                            SelectedItem="{Binding ElementName=ThisUc,
                                                   Path=SelectedProgram}"
                            ItemsSource="{Binding ElementName=ThisUc,
                                                  Path=ProgramsCollection}"&gt;
                      &lt;ComboBox.ItemTemplate&gt;
                          &lt;DataTemplate&gt;
                              &lt;TextBlock Text="{Binding Name}" /&gt;
                          &lt;/DataTemplate&gt;
                      &lt;/ComboBox.ItemTemplate&gt;
                  &lt;/ComboBox&gt;
  
                  &lt;TextBlock Text="{Binding ElementName=ThisUc, 
                       Path=SelectedProgram.Name, Mode=TwoWay}" /&gt;
  </code></pre>
  
  <p>The property:<br></p>
  
  <pre><code>        private Program _selectedProgram;
          public Program SelectedProgram
          {
              get
              {
                  if (_selectedProgram == null)
                  {
                          _selectedProgram = new Program(Settings.Default.SelectedProgramPath);
                  }
                  return _selectedProgram;
  
              }
          set
          {
                  _selectedProgram = value;
                  Settings.Default.SelectedProgramPath = SelectedProgram.PathProgramFolder;
                  RaisePropertyChanged("SelectedProgram");
          }
      }
  </code></pre>
  
  <p>It saves and reads the settings OK, the initial values is shown in the textblock below the combobox, when I change the selected item, the textblock is updated, the settings are changed and everything works fine - except for the fact that on app startup, selected item is not selected.</p>
  
  <p>Thanks for help!</p>