C# Windows Phone上的数据绑定图像源
我有一个字节为[]列的数据表。 在应用程序页面上,我遍历行并将列数据绑定到SourcePropertyC# Windows Phone上的数据绑定图像源,c#,data-binding,windows-phone,C#,Data Binding,Windows Phone,我有一个字节为[]列的数据表。 在应用程序页面上,我遍历行并将列数据绑定到SourceProperty for (i = 0;..) { Image img = new Image(); img.Width = 100; img.Height = 100; Binding bnd = new Binding("Fields[" + i + "].Blob"); // Blob column bnd.Converter = new ByteToImageCo
for (i = 0;..) {
Image img = new Image();
img.Width = 100;
img.Height = 100;
Binding bnd = new Binding("Fields[" + i + "].Blob"); // Blob column
bnd.Converter = new ByteToImageConverter();
img.SetBinding(Image.SourceProperty, bnd);
}
在我拥有的每个图像附近都有一个按钮,该按钮调用CameraCaptureTask camTask
在camtask.Show()之前
I将当前图像分配给全局指针\u imgCurrent=img
camtask.Completed += (s, e)
{
if (e.TaskResult != TaskResult.OK) return;
BitmapImage bmp = new BitmapImage();
bmp.SetSource(e.ChosenPhoto);
_imgCurrent.Source = bmp;
_imgCurrent.SetValue(Image.SourceProperty, bmp);
}
但在这种情况下,DataContext不会更新。我想我需要实现
INotifyPropertyChanged
?我需要从该接口继承图像,或者在源代码更新时触发它?问题在于绑定创建时:我忘记了Mode=TwoWay