Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
149662 | Dec 4,2019 04:32 PM UTC | Dec 5,2019 01:11 PM UTC | Xamarin.Forms | 1 |
![]() |
Tags: SfAvatarView |
hello.
I want to know if the SfavatarView check if imagsourceUri exist or not.
if he doesn't exist, he will display characters.
which best way within I can proceed.
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
try
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(value.ToString());
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
if (response != null && response.StatusCode == HttpStatusCode.OK)
{
return value.ToString();
}
else
{
return null;
}
}
catch (Exception exception)
{
return null;
}
} |
private void ChangeType() {
if (avatar.ImageSource == null)
{
avatar.ContentType = ContentType.Initials;
avatar.AvatarName = "Alex";
avatar.InitialsType = InitialsType.SingleCharacter;
avatar.InitialsColor = Color.Black;
avatar.BackgroundColor = Color.Bisque;
}
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.