在xaml中存在一些错误,因此我必须在cs文件中编写代码。
CollectionView collectionView =new CollectionView();
collectionView.SetBinding(collectionView.ItemsSrouceProperty,"Items");
collectionView的DataTemplate中有一个StackLayout,其中有一个BindableLayout。
BindableLayout.SetItemSource(stackLayout,"messages");
但是没有用。
如何在CollectionView或ListView的DataTemplate中指定BindableLayout ItemsSource?
让我解释一下:
如果将ItemSource设置为stackLayout:
BindableLayout.SetItemsSource(stackLayout,"Items");
stackLayout中的另一个ItemSource:
BindableLayout.SetItemsSource(stackLayout1,"Items.Message");
我应该如何进行?