Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Why IsNullOrWhiteSpace is not triggered for Editor?

$
0
0

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


Viewing all articles
Browse latest Browse all 204402

Trending Articles