There are two general ways of handling this depending on wether you are using MVVM pattern or not. If you are not using MVVM, then you can use the
OnChecked
event which includes a sender argument. The value entered can be used to determine the radio button that was changed:
private void OnChecked(object sender, RoutedEventArgs e)
{
var control = (RadioButton)sender;
}
To use this you need to add the event to the control:
vRadioButton_MC1.Checked += OnChecked;
The better way to do this is to use the MVVM pattern, but that will be much more complex since you have to create a
ICommand
binding in code. The
CommandParameter
would be u8sed to determine which RadioButton was activated.