【发布时间】:2012-02-02 04:36:11
【问题描述】:
我在下面有一个 Linq 查询,其中的“产品”在 XML 文件中包含子元素“名称”和“价格”。
var queryAllProducts = from product in products
select new {
Product = product
, PriceEuro = UsdToEuro(product.PriceUsd)
};
在我的 xaml 文件中,我可以使用
将 Textblock 绑定到 PriceEuro<TextBlock Text= "{Binding PriceEuro}" />
如何将 TextBlock 绑定到“名称”? Text = "{Binding Product.Name}" 对我不起作用。
谢谢。
【问题讨论】:
标签: xml linq xaml data-binding