set ui elements on the uithread after asking for permission

This commit is contained in:
Shane Neuville 2018-04-16 22:34:24 -06:00
Родитель d06dcf0202
Коммит 88f9cab563
1 изменённых файлов: 11 добавлений и 6 удалений

Просмотреть файл

@ -85,12 +85,17 @@ namespace Sound
stopwatch = new Stopwatch ();
stopwatch.Start ();
LengthOfRecordingLabel.Text = string.Empty;
RecordingStatusLabel.Text = "Recording";
StartRecordingButton.Enabled = false;
StopRecordingButton.Enabled = true;
PlayRecordedSoundButton.Enabled = false;
} else {
UIApplication
.SharedApplication
.BeginInvokeOnMainThread (() => {
LengthOfRecordingLabel.Text = string.Empty;
RecordingStatusLabel.Text = "Recording";
StartRecordingButton.Enabled = false;
StopRecordingButton.Enabled = true;
PlayRecordedSoundButton.Enabled = false;
});
} else {
Console.WriteLine ("YOU MUST ENABLE MICROPHONE PERMISSION");
}
});