【发布时间】:2015-01-25 21:45:09
【问题描述】:
假设我有一个这样的模型结构
Being
|_ Person
|_ Billing Address
|_ Customer
|_ Shipping Addresses (Collection)
|_ etc..
|_ etc..
我的观点是这样的
ListBox (ItemsSource - bound to a VM wrapper of "Being")
- DataTemplate containing ListBox2 (ItemsSource - bound to a VM wrapper of "Person")
- DataTemplate containing ListBox3 (ItemsSource that I want to be bound to "Shipping Adresses") PROBLEM!
我正在使用 MVVM Light 和定位器,但无法弄清楚如何执行第三级 - 第三个第二个 DataTemplate (ListBox3) 中的“Shipping Adresses”绑定。它只允许我直接绑定到模型中的送货地址集合。但我想在客户的 VM 包装器中执行此操作,因为我需要对集合做一些事情。任何代码都将有助于内部绑定。
【问题讨论】:
标签: c# xaml mvvm binding mvvm-light