2013-02-01 77 views
1

IVE在绑定的列表的对象的Stringmember到的.xaml 在xaml.cs我这样做有一个问题:视窗8的Xaml对象绑定

grdEvents.ItemsSource =等待m.GetEvents() ; //等待返回列表中的JSONcall

课后看起来是这样的:

public class getevents 
{ 
    public class Result{ //returned list 
     public string xy {get; set;} //access granted 
     public Image x {get; set;} 
    } 

    public class Image{ 
     public string x ; //dont know how to acces? 
    } 

} 

怎么可能获得访问Imageobject的会员?

THX,罗马

回答

2

你需要做一个Image.x财产,不是。如果你这样做了,你应该不能通过"{Binding Path=Image.x}"直接绑定它(假设你在Image类的事件类中有一个Image属性)。

+0

感谢您的回复!我不能将图像更改为属性,因为它是修复的JSON返回,由服务器的API定义。其他解决方案? –

+0

@RomanMauricéHlfn你需要将它包装在一个将它作为属性的类中 - 绑定仅针对属性而不是字段。 –

+0

好的,非常感谢! :) –