1

I wanted to make 2 radiobuttons in C# for a XAML app. If you checked either radio button it should show a dialog message with the text: you have selected+the gender. But it doesn't seem to do that. Any ideas?

public string gender = String.Empty;

IAsyncOperation<IUICommand> asyncCommand = null;

public async void WriteText2(object sender, RoutedEventArgs e)
{
    if (rb1.IsChecked == true)
        gender = "Male";
    else if (rb2.IsChecked == true)
        gender = "Female";

    var md = new MessageDialog("You have selected"+gender);
    asyncCommand = md.ShowAsync();
    await asyncCommand;
}
Kris Vandermotten
  • 10,111
  • 38
  • 49

0 Answers0