0
我试图通过photochoosertask插入图像中的按钮添加背景图片使用PhotoChooserTask
一个按钮,但在铸造btnSelectImage.Content如图片它给空
可以请你帮我出
void photoChooserTask_Completed(object sender, Microsoft.Phone.Tasks.PhotoResult e)
{
if (e.TaskResult == TaskResult.OK)
{
Image contentImage = btnSelectImage.Content as Image;
if (contentImage != null)
{
contentImage.Source = new System.Windows.Media.Imaging.BitmapImage(new Uri(e.OriginalFileName));
}
}
}
问题是 - contentImage即将空 – 1Mayur
你能发表您的XAML的位置>另外,看看我的编辑帮助 – abhinav
<按钮内容=“选择图片” HEIGHT =“200 “Margin =”12,6,0,0“Name =”btnSelectImage“VerticalAlignment =”Top“HorizontalAlignment =”Left“Width =”200“Click =”btnSelectImage_Click“Background =”Transparent“Grid.ColumnSpan =”2“Grid .RowSpan =“3”不透明度=“1”/> – 1Mayur