title: Selecting an Item in a ComboBox affects an unrelated ComboBox
body: <p>I have a XAML <code>UserControl</code> Which connects to a <code>ImportPresenter</code> ViewModel. There are four <code>ComboBox</code> items in my XAML: </p>
  
  <ol>
  <li><code>CashActivityTypeBAI</code> <code>CashActivityTypesCombo</code>, Which are bound to
  my    <code>CashActivityTypes</code> DataView</li>
  <li><code>CashActivitiesBAI</code> Which is bound to my    <code>BAICashActivites</code>
  DataView</li>
  <li><code>CashActivitiesCombo</code> Which is bound to    my <code>CashActivities</code>
  DataView.</li>
  </ol>
  
  <p>I've included my XAML and three classes:</p>
  
  <p>The <code>Presenter</code> and <code>ImportPresenter</code> are my ViewModels. There is a static <code>Controller</code> Class, which is used as my Model, that also connects to my DataSet.</p>
  
  <p><strong>My Problem</strong></p>
  
  <p>When an item is selected by either of the <code>CashActivityTypes</code> ComboBox items, their respective child DataViews are filtered. However, when either <code>CashActivityTypeBAI</code> or <code>CashActivityTypesCombo</code> are changed, it filters both child DataViews for both <code>CashActivity</code> comboboxes. </p>
  
  <p>My XAML</p>
  
  <pre><code>&lt;UserControl x:Class="Cash_Sheet_WPF.Views.Pages.CheckBAIPage"
               xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
               xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
               xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
               xmlns:local="clr-namespace:Cash_Sheet_WPF.Views.Pages"
               xmlns:UserControls="clr-namespace:Cash_Sheet_WPF.Views.UserControls"
               xmlns:ViewModels="clr-namespace:Cash_Sheet_WPF.ViewModels"
               mc:Ignorable="d" 
               d:DesignHeight="534" d:DesignWidth="1184"&gt;
      &lt;Grid&gt;
          &lt;Grid.DataContext&gt;
              &lt;ViewModels:ImportPresenter/&gt;
          &lt;/Grid.DataContext&gt;
          &lt;Grid.Background&gt;
              &lt;ImageBrush ImageSource="/Cash Sheet WPF;component/backgroundA.png" Stretch="UniformToFill"/&gt;
          &lt;/Grid.Background&gt;
          &lt;Grid.ColumnDefinitions&gt;
              &lt;ColumnDefinition Width="1*"/&gt;
          &lt;/Grid.ColumnDefinitions&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height="20"/&gt;
              &lt;RowDefinition Height="44"/&gt;
              &lt;RowDefinition Height="2*" MaxHeight="800"/&gt;
              &lt;RowDefinition Height="24"/&gt;
          &lt;/Grid.RowDefinitions&gt;
          &lt;UserControls:MainMenu Grid.Row="0" VerticalAlignment="Top"/&gt;
          &lt;Grid Grid.Row="2" Margin="5,2,5,2" Width="Auto" Height="Auto" VerticalAlignment="Stretch"&gt;
              &lt;Grid.ColumnDefinitions&gt;
                  &lt;ColumnDefinition Width="1*"/&gt;
                  &lt;ColumnDefinition Width="2*"/&gt;
                  &lt;ColumnDefinition Width="1*"/&gt;
              &lt;/Grid.ColumnDefinitions&gt;
              &lt;Grid.RowDefinitions&gt;
                  &lt;RowDefinition Height="1*"/&gt;
              &lt;/Grid.RowDefinitions&gt;
              &lt;Grid Grid.Column="1"&gt;
                  &lt;Grid.ColumnDefinitions&gt;
                      &lt;ColumnDefinition Width="1*"/&gt;
                      &lt;ColumnDefinition Width="1*"/&gt;
                  &lt;/Grid.ColumnDefinitions&gt;
                  &lt;Grid.RowDefinitions&gt;
                      &lt;RowDefinition Height="24"/&gt;
                      &lt;RowDefinition Height="24"/&gt;
                      &lt;RowDefinition Height="24"/&gt;
                      &lt;RowDefinition Height="24"/&gt;
                      &lt;RowDefinition Height="2*"/&gt;
                  &lt;/Grid.RowDefinitions&gt;
                  &lt;Label Grid.Column="0" Grid.Row="0" HorizontalAlignment="Right" Height="20" FontSize="9" Content="Cash Activity Type"/&gt;
                  &lt;ComboBox x:Name="CashActivityTypeBAI" Grid.Column="1" Grid.Row="0" Height="20" FontSize="9" ItemsSource="{Binding CashActivityTypes, UpdateSourceTrigger=PropertyChanged}"
                            DisplayMemberPath="Type" SelectedValue="{Binding SelectedBAIType}" SelectedValuePath="Sequence"
                            SelectedIndex="{Binding CashActivityTypeIndex, UpdateSourceTrigger=PropertyChanged}" Margin="0,2,0,0"/&gt;
                  &lt;Label Grid.Column="0" Grid.Row="1" HorizontalAlignment="Right" Height="20" FontSize="9" Content="Cash Activity"/&gt;
                  &lt;Label Grid.Column="1" Grid.Row="1" Height="20" FontSize="9"
                         Content="{Binding SelectedActivity, UpdateSourceTrigger=PropertyChanged}"/&gt;
                  &lt;ComboBox x:Name="CashActivitiesBAI" Grid.Column="1" Grid.Row="1" Height="20" FontSize="9"
                            ItemsSource="{Binding BAICashActivities, UpdateSourceTrigger=PropertyChanged}"
                            DisplayMemberPath="Activity"
                            SelectedValue="{Binding SelectedBAIActivity}"
                            SelectedValuePath="Sequence"
                            SelectedIndex="{Binding CashActivityIndex, UpdateSourceTrigger=PropertyChanged}" Margin="0,2,0,0"/&gt;
              &lt;/Grid&gt;
              &lt;Grid Grid.Column="2" Margin="2,0,0,0"&gt;
                  &lt;Grid.ColumnDefinitions&gt;
                      &lt;ColumnDefinition Width="1*"/&gt;
                      &lt;ColumnDefinition Width="2*"/&gt;
                  &lt;/Grid.ColumnDefinitions&gt;
                  &lt;Grid.RowDefinitions&gt;
                      &lt;RowDefinition Height="24"/&gt;
                      &lt;RowDefinition Height="24"/&gt;
                      &lt;RowDefinition Height="24"/&gt;
                      &lt;RowDefinition Height="24"/&gt;
                      &lt;RowDefinition Height="24"/&gt;
                      &lt;RowDefinition Height="75"/&gt;
                      &lt;RowDefinition Height="24"/&gt;
                      &lt;RowDefinition Height="2*"/&gt;
                  &lt;/Grid.RowDefinitions&gt;
                  &lt;Label Grid.Column="0" Grid.Row="0" Content="Individual Transactions" FontSize="9"/&gt;
                  &lt;Label Content="Cash Activity Type" FontSize="9" Grid.Row="1" Grid.Column="0" Margin="0,0,2,2" HorizontalAlignment="Right"/&gt;
                  &lt;ComboBox x:Name="CashActivityTypesCombo" Grid.Row="1" Grid.Column="1" Width="Auto" Height="Auto" MaxHeight="20" MinHeight="20" Background="White"
                            ItemsSource="{Binding CashActivityTypes, UpdateSourceTrigger=PropertyChanged}"
                            DisplayMemberPath="Type"
                            SelectedValue="{Binding TypeSequence}"
                            SelectedValuePath="Sequence"
                            Margin="2,0,0,2" HorizontalAlignment="Stretch"/&gt;
                  &lt;Label Content="Cash Activity" FontSize="9" Grid.Row="2" Grid.Column="0" Margin="0,2,2,2" HorizontalAlignment="Right"/&gt;
                  &lt;ComboBox x:Name="CashActivitiesCombo" Grid.Row="2" Grid.Column="1"  Width="Auto" Height="Auto" MaxHeight="20" MinHeight="20" Background="White"
                            ItemsSource="{Binding CashActivities, UpdateSourceTrigger=PropertyChanged}"
                            DisplayMemberPath="Activity"
                            SelectedValue="{Binding ActivitySequence}"
                            SelectedValuePath="Sequence"
                            Margin="2,2,0,2" HorizontalAlignment="Stretch"/&gt;
              &lt;/Grid&gt;
          &lt;/Grid&gt;
      &lt;/Grid&gt;
  &lt;/UserControl&gt;
  </code></pre>
  
  <p>The <code>ImportPresenter</code> is a child of a <code>Presenter</code> Class</p>
  
  <pre><code>namespace Cash_Sheet_WPF.ViewModels
  {
      /// &lt;summary&gt;
      /// Main Presenter Class - Parent class of other presenters
      /// &lt;/summary&gt;
      public class Presenter : ObservableObject
      {
  
          #region Variables
  
          protected DataView _CashActivityTypes = Controller.FinanceDB.CashActivityType.DefaultView;
          protected DataView _CashActivities = Controller.FinanceDB.CashActivity.DefaultView;
          protected short _TypeSequence;
          protected short _ActivitySequence;
  
          #endregion 
  
  
          #region Bindings
  
          //Returns a DataView from the CashActivityType table
          public DataView CashActivityTypes
          {
              get
              {
                  return _CashActivityTypes;
              }
              set
              {
                  _CashActivityTypes = value;
                  RaisePropertyChangedEvent("CashActivityTypes");
              }
          }//END CASHACTIVITYTYPES
  
          public DataView CashActivities
          {
              get
              {
                  return _CashActivities;
              }
              set
              {
                  _CashActivities = value;
                  RaisePropertyChangedEvent("CashActivities");
              }
          }//END CASHACTIVITIES
  
          public short TypeSequence
          {
              get
              {
                  return _TypeSequence;
              }
              set
              {
                  _TypeSequence = value;
                  CashActivities.RowFilter = "Seq_CashActivityType = " + _TypeSequence;
                  RaisePropertyChangedEvent("TypeSequence");
              }
          }//END TYPESEQUENCE
  
          #endregion
  
      }
  }
  </code></pre>
  
  <p><code>ImportPresenter</code> Class, which Extends the <code>Presenter</code> Class</p>
  
  <pre><code>namespace Cash_Sheet_WPF.ViewModels
  {
      public class ImportPresenter : Presenter
      {
  
          #region Variables
  
          //BAI Adjustment
          private DataView _BAI;
          private DataRowView _BAIRow;
          private DataView _BAICashActivities = Controller.FinanceDB.CashActivity.DefaultView;
          private short _SelectedBAIType = 0;
          private short _SelectedBAIActivity = 0;
  
  
          private long _CashActivityTypeIndex = 0;
          private long _CashActivityIndex = 0;
          private decimal _BucketAmount = 0;
  
          #endregion 
  
          #region Bindings
  
          /// &lt;summary&gt;
          /// Cash Activities for the BAI Import Adjustment Section
          /// &lt;/summary&gt;
          public DataView BAICashActivities
          {
              get
              {
                  return _BAICashActivities;
              }
              set
              {
                  _BAICashActivities = value;
                  RaisePropertyChangedEvent("BAICashActivities");
              }
          }
  
  
          /// &lt;summary&gt;
          /// Gets the Selected Type index, to be used by the Combobox
          /// &lt;/summary&gt;
          public long CashActivityTypeIndex
          {
              get
              {
                  return _CashActivityTypeIndex;
              }
              set
              {
                  _CashActivityTypeIndex = value;
                  RaisePropertyChangedEvent("CashActivityTypeIndex");
              }
          }
  
          /// &lt;summary&gt;
          /// Stores the index of the currently selected Cash Activity
          /// &lt;/summary&gt;
          public long CashActivityIndex
          {
              get
              {
                  return _CashActivityIndex;
              }
              set
              {
                  _CashActivityIndex = value;
                  RaisePropertyChangedEvent("CashActivityIndex");
              }
          }
  
          /// &lt;summary&gt;
          /// Selected Cash Activity Type
          /// &lt;/summary&gt;
          public short SelectedBAIType
          {
              get { return _SelectedBAIType; }
              set
              {
                  _SelectedBAIType = value;
                  RaisePropertyChangedEvent("SelectedBAIType");
                  BAICashActivities.RowFilter = "Seq_CashActivityType = " + _SelectedBAIType;
                  RaisePropertyChangedEvent("BAICashActivities");
              }
          }
  
          /// &lt;summary&gt;
          /// The Selected Cash Activity
          /// &lt;/summary&gt;
          public short SelectedBAIActivity
          {
              get
              {
                  return _SelectedBAIActivity;
              }
              set
              {
                  _SelectedBAIActivity = value;
                  RaisePropertyChangedEvent("SelectedBAIActivity");
              }
          }
  
          /// &lt;summary&gt;
          /// Returns the Index of text in a DataView
          /// &lt;/summary&gt;
          /// &lt;param name="dataView"&gt;DataView you are searching&lt;/param&gt;
          /// &lt;param name="stringItem"&gt;Search Text&lt;/param&gt;
          /// &lt;returns&gt;&lt;/returns&gt;
          private long GetSelectedIndex(DataView dataView, string stringItem)
          {
  
              long selectedIndex = 0;
              foreach(DataRowView dataRowView in dataView)
              {
                  if (dataRowView.Row.ItemArray.Contains(stringItem))
                  {
                      break;
                  }
                  else
                  {
                      selectedIndex++;
                  }
              }
  
              return selectedIndex;
  
          }
  
          #endregion 
  
      }
  }
  </code></pre>