How do I load images in the background?

前端 未结 5 1234
小鲜肉
小鲜肉 2021-01-03 09:50

I am trying to load an image in the background and then update the UI. I have been playing with this all day and I don\'t know what I am missing. I keep getting the follow

5条回答
  •  春和景丽
    2021-01-03 10:16

    One more thing we had in our project. Since ImageSource is placed into UI you have to check if it is frozen:

    public void SetImage(ImageSource source)
    {
       ImageSource src = null;
       if(!source.IsFrozen)
           src = source.GetAsFrozen();
       else
           src = source; 
       this.BackgroundImage.Source = src;
    }
    

提交回复
热议问题