“Cannot convert string to ImageSource.” How can I do this?

前端 未结 7 1543
南旧
南旧 2021-01-13 11:09
private void HeroMouseEnter(object sender, MouseEventArgs e)
    {
        ((Image)sender).Source = GetGlowingImage(((Image)sender).Name);            
    }

    pub         


        
7条回答
  •  伪装坚强ぢ
    2021-01-13 11:51

    var converter = new Xamarin.Forms.ImageSourceConverter();
    var imgSource = (Xamarin.Forms.ImageSource) converter.ConvertFromInvariantString(item.Poster);
    

提交回复
热议问题