如何在绑定中指定BindableLayout.ItemSource?

时间:2019-11-20 10:22:15

标签: xamarin.forms

在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");

我应该如何进行?

0 个答案:

没有答案