title: MVVM changing grid's background color on click
body: <p>I'm a true beginner in MVVM pattern. I'm trying to change the backgound of a grid on button's click. I have a xaml with a grid containing a button, and a ViewModel .cs from where i want to change the grid's background on button's click. Until there i just succeed to show up a MessageBox when i clicked...</p>
  
  <p>.xaml code:</p>
  
  <pre><code>&lt;Window x:Class="WpfSimple.MainWindow"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:local="clr-namespace:WpfSimple"
      Title="MainWindow" Height="150" Width="370"&gt;
  &lt;Window.DataContext&gt;
      &lt;local:MainWindowViewModel/&gt;
  &lt;/Window.DataContext&gt;
      &lt;Grid&gt;
      &lt;Button Content="Click" 
              Height="23" 
              HorizontalAlignment="Left"
              Background="Gray"
              Margin="75.944,47.465,0,0" 
              Name="btnClick" 
              VerticalAlignment="Top" 
              Width="203"
              Command="{Binding ButtonCommand}"/&gt;
          &lt;!--What is necessary to add for changing grid color ? Commandparameter ?--&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p></p>
  
  <p>MainWindowViewModel.cs code:</p>
  
  <pre><code>namespace WpfSimple
  {
      class MainWindowViewModel
      {
          private ICommand m_ButtonCommand;
          public ICommand ButtonCommand
          {
              get
              {
                  return m_ButtonCommand;
              }
              set
              {
                  m_ButtonCommand = value;
              }
          }
  
          public MainWindowViewModel()
          {
              ButtonCommand=new RelayCommand(new Action&lt;object&gt;(ChangeBgColor));
          }
  
          public void ChangeBgColor(object obj)
          {
              /*HERE I WANT TO CHANGE GRID COLOR*/
          }
      }
  }
  </code></pre>
  
  <p>Sorry for my bad english.</p>
  
  <p>Best regards.</p>