3

I have some image resources in my UWP app which I display via data binding in XAML. During the debugging process everything works fine and the images are visible.

The problem is once I submit the app package to the store and install it from there - the images are not visible.

My XAML for the ImageSource data binding is here

<Image x:Name="Image" Height="100" Width="100" Source="{Binding Icon, Mode=TwoWay}" />

The Icon is a string property which contains the path of the image file.

"ms-appx:///Images/testfolder/testicon.png"

Most of my image files have multiple versions for scaling

  • .scale-100
  • .scale-140
  • .scale-180
  • .scale-240

I already set the Copy to output directory value of my image files to Copy always, and the Build Action to Content.

Just to avoid duplicate questions - I have already read this Question. The solution in this case was to use data binding, which is not working for me.

Community
  • 1
  • 1
nor0x
  • 1,213
  • 1
  • 15
  • 41
  • Instead of using `string`, try using `ImageSource` property. Since it's `TwoWay` binding, check your output window if conversion is okay. – Muhammad Hassan Feb 17 '16 at 06:35
  • Setting `Mode=TwoWay` on the Source binding doesn't make any sense at all. The Image control never actively changes its Source property so that the changes would have to be sent back to the view model. – Clemens Feb 17 '16 at 08:58

1 Answers1

3

I have figured out why my images are not visible. I tested the app on a Lumia 950 and a Lumia 920, it seems that the Lumia 950 has a different scale factor and I didn't provide a scaled version of the image.

nor0x
  • 1,213
  • 1
  • 15
  • 41