title: How to bind a Combobox ItemSource to a Property not in the DataContext?
body: <p>I have a Dialog box, ConfigSetup that has a Combobox. Its data context is set to the viewModel, but I need to bind the ItemSource of my Combobox to a property in the main window( MainWindow).</p>
  
  <pre><code>   public partial class MainWindow : Window, INotifyPropertyChanged
     {
     ...
          public CfgData.TMicMode[] MicModeOptions
          {
              get
              {
                  return (CfgData.TMicMode[])System.Enum.GetValues(typeof(CfgData.TMicMode));
              }
          }
  
     }
  </code></pre>
  
  <p>Here's where the viewModel is setup in the dialog box code</p>
  
  <pre><code>    public partial class ConfigSetup : Window, INotifyPropertyChanged
      {
          private ConfigSetupVM vm_ = null;
          public ConfigSetup(CfgData cfgData)
          {
              vm_ = new ConfigSetupVM(cfgData);
  
              InitializeComponent();
  
              vm_.RequestClose += delegate
              {
                  Close();
              };
  
  
              DataContext = vm_;
  
          }
     }
  </code></pre>
  
  <p>Here's the code in the VM that has the selectedvalue property to bind to</p>
  
  <pre><code>   class ConfigSetupVM : ViewModelBase, IDataErrorInfo
      {
      ...
  
           /// &lt;summary&gt; 
          /// C-5000's microphone mode.
          /// &lt;/summary&gt;/
          public CfgData.TMicMode MicMode
          {
              get { return model_.MicMode; }
              set { model_.MicMode = value; NotifyPropertyChanged("MicMode"); }
          }
  </code></pre>
  
  <p>Here's the XAML with the combobox</p>
  
  <pre><code>&lt;Window x:Class="RpP25.ConfigSetup"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:RpWin="clr-namespace:RpP25"
      Title="FCT Configuration" 
      Width="300"
      SizeToContent="Height"
      ResizeMode="NoResize"
      WindowStartupLocation="CenterOwner" WindowStyle="ToolWindow"
      FocusManager.FocusedElement="{Binding ElementName=name}"
      Background="AliceBlue" &gt;
      &lt;Window.Resources&gt;
      ...
      &lt;/Window.Resources&gt;
      ...
  
      &lt;ComboBox Grid.Row="6" Grid.Column="1"
                HorizontalAlignment="Right" MinWidth="75"
                ItemsSource="{Binding RpWin:MainWindow.MicModeOptions, Mode=OneWay}"
                SelectedValue="{Binding RpWin:MainWindow.MicMode, Mode=TwoWay, TargetNullValue=Not Selected,
                                        ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged, NotifyOnValidationError=True}" /&gt;
  
  
  ...
  </code></pre>
  
  <p>I know I'm missing something fundamental to Binding, but I can't for the life of figure out how to bind to something outside the datacontext.</p>
  
  <p>I've tried to use FindAncestor... with no success</p>
  
  <p>You help would be greatly appreciated.</p>