Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/300.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Windows Phone上的数据绑定图像源_C#_Data Binding_Windows Phone - Fatal编程技术网

C# Windows Phone上的数据绑定图像源

C# 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

我有一个字节为[]列的数据表。 在应用程序页面上,我遍历行并将列数据绑定到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 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