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;
}