Hi,
I am using below code to check if the Editor is empty or just have white spaces but it's not working and the form is being submitted without prompting for the error message.
Here is my code:
<StackLayout BackgroundColor="Black" Padding="1">
<Editor x:Name="txtContactMessage" BackgroundColor="White" Keyboard="Default" HeightRequest="150" />
</StackLayout>
if (String.IsNullOrWhiteSpace(btnSendMessage.Text))
{
await DisplayAlert("خطأ!", "الرجاء كتابة رسالتك", "تصحيح");
btnSendMessage.Focus();
return;
}
Thanks,
Jassim