Windows Phone Image Binding

后端 未结 2 1244
灰色年华
灰色年华 2021-01-26 19:26

I want to put images in my ListBox using Binding.

Below is the object containing the URI\'s:

_roomView.Room = new Room
        {
            Items = new          


        
2条回答
  •  误落风尘
    2021-01-26 20:05

    If image doesn't show - check pathes; For example my code for binding

     public class Country
    {       
        public String name
        {
            get;
            set;
        }       
        public String Flag
        {
            get
            {
                return "/Image/Countries/" + name + ".png";
            }
        }
    }
    
    
    
        
           
        
       
    

    If You are using images from the project be sure that thay Build to content and copy always to output directory.(properties of the images )

    By the way if you want to show images from the Internet You need to use LowProfileImageLoader You can read more about it http://blogs.msdn.com/b/delay/archive/2010/09/02/keep-a-low-profile-lowprofileimageloader-helps-the-windows-phone-7-ui-thread-stay-responsive-by-loading-images-in-the-background.aspx

     
    

提交回复
热议问题