title: WPF ComboBox Binding to ObservableCollection
body: <p>I'm new to WPF And I have a question.
  I have the Organization module:</p>
  
  <pre><code>class Organization : ObservableObject
  {
      public string OrganizationName { get; set; }
  }
  </code></pre>
  
  <p>I have the ViewModel of the Organization:</p>
  
  <pre><code>class OrganizationViewModel : ObservableObject
  {
      int _count = 0;
  
      public OrganizationViewModel()
      {
          Organization = new Organization {OrganizationName = "New Organization"};
      }
  
      public Organization Organization { get; set; }
  
      public string OrganizationName
      {
          get { return Organization.OrganizationName; }
          set
          {
              if(Organization.OrganizationName != value)
              {
                  Organization.OrganizationName = value;
                  RaisePropertyChanged("OrganizationName");
              }
          }
      }
  </code></pre>
  
  <p>And I have the ViewModel of all the Organizations:</p>
  
  <pre><code>class AllOrganizationsViewModel
      {
          private ObservableCollection&lt;OrganizationViewModel&gt; m_organizations = new ObservableCollection&lt;OrganizationViewModel&gt;();
  
  
      public ObservableCollection&lt;OrganizationViewModel&gt; Organizations
      {
          get { return m_organizations; }
          set { m_organizations = value; }
      }
  
      public AllOrganizationsViewModel()
      {
          for(int i = 0; i &lt; 3; ++i)
          {
              m_organizations.Add(new OrganizationViewModel());
          }
      }
  
      void AddOrganizationNameExecute()
      {
          m_organizations.Add(new OrganizationViewModel());
      }
  
      bool CanAddOrganizationNameExecute()
      {
          return true;
      }
  
      public ICommand AddOrganization{get{return new RelayCommand(AddOrganizationNameExecute, CanAddOrganizationNameExecute);}}
  
  }
  </code></pre>
  
  <p>And this is the MainWindow.xaml:</p>
  
  <pre><code>&lt;Window x:Class="DataIntegrityChecker.MainWindow"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:local="clr-namespace:DataIntegrityChecker.ViewModels" Title="MainWindow" Height="350" Width="525"&gt;
      &lt;Window.DataContext&gt;
          &lt;local:AllOrganizationsViewModel /&gt;
      &lt;/Window.DataContext&gt;
      &lt;Grid&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height="Auto" /&gt;
              &lt;RowDefinition Height="285*" /&gt;
          &lt;/Grid.RowDefinitions&gt;
          &lt;Grid.ColumnDefinitions&gt;
              &lt;ColumnDefinition Width="156" /&gt;
              &lt;ColumnDefinition Width="347*" /&gt;
          &lt;/Grid.ColumnDefinitions&gt;
          &lt;Label Content="Organization: " Margin="0,0,44,0" /&gt;
          &lt;Button Grid.Row="1" Name="UpdateOrganizations" Content="Update Organization Name" Command="{Binding AddOrganization}" Margin="0,0,0,262" HorizontalAlignment="Left" Width="156" /&gt;
          &lt;ComboBox Grid.Column="1" Grid.Row="1" Height="23" HorizontalAlignment="Left" Name="comboBox1" VerticalAlignment="Top" Width="155"  ItemsSource="{Binding Organizations}" /&gt;
      &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>Now, what I get in the ComboBox items is the name of the class OrganizationViewModel but what I need is the OrganizationName string. It seems to me that I have some binding to OrganizationName that's missing but I can't figure out where to add if (if that's the issue). I assume I can make a collection of strings with the names of the organizations I need. But in the future I will need more properties in the Organization Class so that's the way I need it to work.</p>
  
  <p>I will appreciate any help</p>