caliburn.micro Conductor を使用しようとしています。docs によると、Conductor は必ずしも Screen タイプである必要はなく、実際には任意の POCO にすることができます。
したがって、次のようにクラスを作成します。
public class StoreContentsViewModel : Conductor<MyItem>.Collection.OneActive
{
protected override void OnInitialize()
{
...
foreach (MyItem item in Collection)
{
Items.Add(item);
}
ActivateItem(Items[0]);
}
}
しかし、バインディングエラーが発生します
System.Windows.Data Error: BindingExpression path error: 'Items' property not
found on 'MyItem' (HashCode=107597610). BindingExpression: Path='Items'
DataItem='MyItem' HashCode=107597610); target element is
Microsoft.Phone.Controls.Pivot' (Name='Items'); target property is
ItemsSource' (type 'System.Collections.IEnumerable')..
Items リストを実装するクラスは Conductor だと思っていたのですが、caliburn が MyItem をバインドしようとしています。何故ですか?バインド可能なプロパティ Items で MyItem のリストを受け取り、定義した ItemTemplate に従ってそれらを表示するピボットが必要です。これにはViewModelが必要ですか?? ドキュメントを何度か読みましたが、まだ迷っています。何が起こっているのか説明してもらえますか?