-1

I looked at the NavSample from the cocktail 2012 package and wondered where the 'SelectedCustomer' is bound. Somehow the listview does this. I suppose it's a Caliburn thing, but i cannot see the logic.

4

1 回答 1

1

是的,由于 caliburn 的约定之一,它绑定到 ViewModel 中定义的 SelectedCustomer。

该组件在 ViewModel 中被命名为像 Collection 一样的客户。Caliburn 将尝试查找名为 Customers 的属性并将组件绑定到它。列表框的约定说​​,如果它找到一个名为“Selected”+组件名称的属性,它将把 Selected 属性绑定到它

您可以在此处找到有关 caliburn 约定的更多信息:https ://caliburnmicro.codeplex.com/wikipage?title=All%20About%20Conventions

于 2014-05-30T18:51:01.520 回答