static ImageResources() { var streamResourceInfo = Application.GetResourceStream(new Uri(CallWallIconPath)); if (streamResourceInfo != null) { var iconStream = streamResourceInfo.Stream; CallWallIcon = new Icon(iconStream); } var conv = new ImageSourceConverter(); if (conv.CanConvertFrom(typeof(string))) { CallWallLogoSource = (ImageSource)conv.ConvertFrom(CallWallLogoPath); CallWallImageSource = (ImageSource)conv.ConvertFrom(CallWallIconPath); BirthdayImageSource = (ImageSource)conv.ConvertFrom(BirthdayPath); } }
public bool SetImageSource(string ImagePath) { ImageSourceConverter ISC = new ImageSourceConverter(); if (ISC.CanConvertFrom(ImagePath.GetType())) { Image.ImageSource = (ImageSource)ISC.ConvertFrom(ImagePath); return true; } else { return false; } }