title: WPF Radio Button Fires Converter in strange order
body: <p>I am writing a simple program using the MVVM Model on WPF.  Basicly when the user clicks a radio button in a group of radio buttons, it will update a property in the View Model with the new Account number.  The problem is, when I click a different button the converter is called for the new button IsChecked Binding, and then after that it runs the converter for the previous button IsChecked binding(for losing its checked status).</p>
  
  <p>This is causing a problem, since the new button is updating the value of the property with the correct account number, and then when the old button calls the converter, it gets converted back to the old value.  I have hacked it to work by adding a static variable to the class, and if the IsChecked property is false, just return the value in the static variable.  Does anyone have a better solution for Short Circuting the Converter Call on the box that loses its checked status.  Code is below:</p>
  
  <p>Converter:</p>
  
  <pre><code>class RadioToAccountConverter : IValueConverter
  {
      static string myValue; //HACK TO MAKE IT WORK
      object IValueConverter.Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
      {
          return parameter.ToString();
      }
  
      object IValueConverter.ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
      {
  
          if ((bool)value)
          {
              myValue = parameter.ToString(); // Hack to make it work
              return parameter.ToString();
          }
          return myValue; // Hack to make it work
      }
  }
  </code></pre>
  
  <p>XAML:</p>
  
  <pre><code>                &lt;RadioButton Foreground="HotPink" 
                               Grid.Column="0" 
                               Content="6087721" 
                               Tag="6087721"
                               IsChecked="{Binding Account, Converter={StaticResource Radio2Value}, Mode=OneWayToSource, ConverterParameter=6087721}"&gt;
                  &lt;/RadioButton&gt;
  
                  &lt;RadioButton Foreground="HotPink" 
                               Grid.Column="1"
                               Content="BFSC120"
                               IsChecked="{Binding Account, Converter={StaticResource Radio2Value}, Mode=OneWayToSource, ConverterParameter='BFSC120'}"&gt;
                  &lt;/RadioButton&gt;
  
                  &lt;RadioButton Foreground="HotPink" 
                               Grid.Column="2"
                               Content="BFSC121"
                               IsChecked="{Binding Account, Converter={StaticResource Radio2Value}, Mode=OneWayToSource, ConverterParameter=BFSC121}"&gt;
                  &lt;/RadioButton&gt;
  
                  &lt;RadioButton Foreground="HotPink" 
                               Grid.Column="3" 
                               Content="BFSC206" 
                               IsChecked="{Binding Account, Converter={StaticResource Radio2Value}, Mode=OneWayToSource, ConverterParameter=BFSC206}"&gt;
  
                  &lt;/RadioButton&gt;
  </code></pre>
  
  <p>Property:</p>
  
  <pre><code>    public const string AccountPropertyName = "Account";
  
      private string _account;
  
      /// &lt;summary&gt;
      /// Sets and gets the Account property.
      /// Changes to that property's value raise the PropertyChanged event. 
      /// &lt;/summary&gt;
      public string Account
      {
          get
          {
              return _account;
          }
  
          set
          {
              if (_account == value)
              {
                  return;
              }
  
              RaisePropertyChanging(AccountPropertyName);
              _account = value;
              RaisePropertyChanged(AccountPropertyName);
          }
      }
  </code></pre>
  
  <p>Any Help Is Greatly Appreciated.</p>