来自C#XAML的图像源
我需要从C#设置图像源。我尝试了来自C#XAML的图像源,xaml,windows-phone,Xaml,Windows Phone,我需要从C#设置图像源。我尝试了X:Name=“headimg”,但在C#中找不到headimg 试试这个: public void SetImage() { BitmapImage imge = new BitmapImage(new Uri("/Assets/Images/ImageName.png", UriKind.Relative)); headimg.Source=image.Source; } public void SetImage() { Bitma
X:Name=“headimg”
,但在C#中找不到headimg
试试这个:
public void SetImage()
{
BitmapImage imge = new BitmapImage(new Uri("/Assets/Images/ImageName.png", UriKind.Relative));
headimg.Source=image.Source;
}
public void SetImage()
{
BitmapImage imge = new BitmapImage(new Uri("/Assets/Images/ImageName.png", UriKind.Relative));
headimg.Source=image.Source;
}