Hello,
With a button i send an email , before i send it want to check if the Textinputlayout's are empty .
All fields must be filled before sending the email.
With a normal Entry i check it like this .
But Textinputlayout not working , cannot be converted to string. What do i change
void OnVerzendButtonClicked(object sender, EventArgs args)
{
if ( !string.IsNullOrWhiteSpace(EmailBody.Text) && !string.IsNullOrWhiteSpace(Voornaam.Text) && !string.IsNullOrWhiteSpace(Achternaam.Text))
{
EmailSubject.Text = Voornaam.Text + " " + Achternaam.Text;
var EmailTask = CrossMessaging.Current.EmailMessenger;
if (EmailTask.CanSendEmail)
EmailTask.SendEmail("........@gmail.com", EmailSubject.Text, EmailBody.Text);
}
else
{
_ = DisplayAlert("Error", "There are some empty fields !", "OK");
}
/}
And in Xaml
<inputLayout:SfTextInputLayout x:Name="Voornaam" HelperText="Voornaam" AbsoluteLayout.LayoutBounds=".10,.82,.35,.55" AbsoluteLayout.LayoutFlags="All">
<Entry />
</inputLayout:SfTextInputLayout>
<inputLayout:SfTextInputLayout x:Name="Achternaam" HelperText="Achternaam" AbsoluteLayout.LayoutBounds=".88,.82,.48,.55" AbsoluteLayout.LayoutFlags="All">
<Entry />
</inputLayout:SfTextInputLayout>
<Entry x:Name="EmailSubject" Placeholder="Onderwerp Email" BackgroundColor="White" TextColor="Black" FontSize="Small" AbsoluteLayout.LayoutBounds="30,330,300,35" AbsoluteLayout.LayoutFlags="None"/>
<Editor x:Name="EmailBody" Placeholder="Bericht" BackgroundColor="White" TextColor="Black" FontSize="Small" AbsoluteLayout.LayoutBounds="30,350,300,15" AbsoluteLayout.LayoutFlags="None" />