我的课是这样的:
public class Articolo : Screen
{
public string Code { get; set; }
public string Description { get; set; }
public decimal Cost{ get; set; }
public decimal Price{ get; set; }
public List<Ean> BarCode { get; set; }
}
这个 Ean 类:
public class Ean
{
public string Code{ get; set; }
}
我的数据网格是:
<DataGrid Height="367" HorizontalAlignment="Stretch" Margin="14,52,12,0"
VerticalAlignment="Top" AutoGenerateColumns="False" x:Name="List" >
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Code}" Header="Codice" />
<DataGridTextColumn Binding="{Binding Description }" Header="Descrizione" />
<DataGridTextColumn Binding="{Binding Cost}" Header="Quantita" />
<DataGridTextColumn Binding="{Binding Price}" Header="Prezzo" />
<DataGridTextColumn Binding="{Binding BarCode}" Header="BarCodes" />
</DataGrid.Columns>
</DataGrid>
他是 ViewModel 的一员:
[Export(typeof(IScreen))]
public class BolleViewModel : Screen
{
public List<Articolo> List { get; private set; }
public BViewModel()
{
Recover recover = new Recover();
List = recover.Import();
NotifyOfPropertyChange("List");
}
}
在 BarCodes 列中写入(集合)!而不是条形码。为什么?如何查看列中的条码列表?谢谢..