What I suspect is happening here is when the Form/Page is loading, it is initializing the first radio button, setting is IsChecked property, which triggers this event. When coming through this event, the second radio button has not yet been initialized on the Form/Page.
The easiest way around this is to add a check for null.
if (secondRadioButton != null)
{
secondRadioButton.IsChecked = false;
}
- Brady My posts are kept as simple as possible for easier understanding. In many cases you can probably optimize or spruce up what I present. Have fun coding!
No comments:
Post a Comment