Пример #1
0
        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);
            }
        }
Пример #2
0
 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;
     }
 }