title: WPF enable buttons group
body: <p>In first column i have list of groups ("First","Second"). In second column i have 5 button's. I want to enable or disable group of button's after choosing their group in first column. How to do this in MVVM pattern?</p>
  
  <p><a href="https://i.stack.imgur.com/Gp0AR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Gp0AR.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/DlRUN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DlRUN.png" alt="enter image description here"></a></p>
  
  <pre><code>public partial class MainWindow : Window
  {
      public MainWindow()
      {
          InitializeComponent();
          DataContext = new Data();
      }
  }
  public class Data
  {
      public List&lt;string&gt; Items { get; set; }
      public Data()
      {
          Items = new List&lt;string&gt;();
          Items.Add("First");
          Items.Add("Second");
      }
  }
  </code></pre>
  
  <p>Xaml:</p>
  
  <pre><code>&lt;Grid&gt;
      &lt;Grid.ColumnDefinitions&gt;
          &lt;ColumnDefinition&gt;&lt;/ColumnDefinition&gt;
          &lt;ColumnDefinition&gt;&lt;/ColumnDefinition&gt;
      &lt;/Grid.ColumnDefinitions&gt;
      &lt;ListView ItemsSource="{Binding Items}" Grid.Column="0"&gt;
          &lt;ListView.ItemTemplate&gt;
              &lt;DataTemplate&gt;
                  &lt;Label Content="{Binding .}"&gt;&lt;/Label&gt;
              &lt;/DataTemplate&gt;
          &lt;/ListView.ItemTemplate&gt;
      &lt;/ListView&gt;
      &lt;Button Content="First" Grid.Column="1" HorizontalAlignment="Left" Height="30" Margin="21,24,0,0" VerticalAlignment="Top" Width="76" IsEnabled="False"/&gt;
      &lt;Button Content="Second" Grid.Column="1" HorizontalAlignment="Left" Height="30" Margin="102,48,0,0" VerticalAlignment="Top" Width="76" IsEnabled="True"/&gt;
      &lt;Button Content="First" Grid.Column="1" HorizontalAlignment="Left" Height="30" Margin="33,83,0,0" VerticalAlignment="Top" Width="76" IsEnabled="False"/&gt;
      &lt;Button Content="Second" Grid.Column="1" HorizontalAlignment="Left" Height="30" Margin="126,93,0,0" VerticalAlignment="Top" Width="76" IsEnabled="True" RenderTransformOrigin="1.088,-0.075"/&gt;
      &lt;Button Content="Second" Grid.Column="1" HorizontalAlignment="Left" Height="30" Margin="93,186,0,0" VerticalAlignment="Top" Width="76" IsEnabled="True"/&gt;
  &lt;/Grid&gt;
  </code></pre>