title: WPF ComboBox Selected Item with reference to an object
body: <p>I'm trying to define a selected item in a combobox. It working fine if I'm just using a String to declare the selected item but not if using an object.</p>
  
  <pre><code>&lt;ComboBox HorizontalAlignment="Left"
    VerticalAlignment="Top" Width="81" materialDesign:HintAssist.Hint="Woche" Margin="10" 
    ItemsSource="{Binding weekSelection}" 
    DisplayMemberPath="name" 
    SelectedItem="{Binding nodeWeek, Mode=TwoWay}"  
  SelectedValue="name" /&gt;
  </code></pre>
  
  <p>-</p>
  
  <pre><code>private week _nodeWeek;
  public week nodeWeek
  {
      get
      {
         return _nodeWeek;
      }
      set
      {
          _nodeWeek = value;
          RaisePropertyChanged("nodeWeek");
      }
  }
  </code></pre>
  
  <p>-</p>
  
  <pre><code> public class week
   {
      public int val { get; set; }
  
      public String name { get; set; }
   }
  </code></pre>
  
  <p>-
  setting the selected item</p>
  
  <pre><code>this.nodeWeek = new week() { val = times.GetIso8601WeekOfYear(DateTime.Now), name = "KW " + times.GetIso8601WeekOfYear(DateTime.Now).ToString() };
  </code></pre>
  
  <p>Is there a way to fix that?</p>