Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

ImageCell in ListView does not show png-images in Windows Phone (Ressource from Uri)

$
0
0

Hello,

I´m using:

listView.ItemTemplate.SetBinding(ImageCell.ImageSourceProperty, new Binding("article_image_uri", BindingMode.OneWay, new StringToUriImageSourceConverter()));

with:

public class StringToUriImageSourceConverter : IValueConverter {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
            var uriString = (string)value;
            string serverIp = "";
            if (Application.Current.Properties.ContainsKey("serverIP")) {
                serverIp = Application.Current.Properties["serverIP"] as string;
            }
            if (!string.IsNullOrEmpty(uriString)) {
                return ImageSource.FromUri(new Uri(serverIp + "/" +  uriString));
            }
            return null;
        }

This works for png-images on Android or iOS, but not on smartphones with the Windows Phone operating system. Then I tried it with jpg-images, but this works on Windows Phone!

Bug? Or did I something wrong?

Bg

Max


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>