Does this support ObservableCollection for CollectionView?
Read-Only CollectionView
class CollectionViewPage: Component
{
static CollectionViewPage()
{
ItemsSource = Enumerable.Range(1, 200)
.Select(_ => new Tuple<string, string>($"Item{_}", $"Details{_}"))
.ToArray();
}
static Tuple<string, string>[] ItemsSource { get; }
public override VisualNode Render()
{
return new ContentPage("CollectionView")
{
new CollectionView()
.ItemsSource(ItemsSource, RenderItem)
};
}
private VisualNode RenderItem(Tuple<string, string> item)
=> new VStack(spacing: 5)
{
new Label(item.Item1),
new Label(item.Item2)
};
}Read-Write CollectionView
PreviousHow to deal with state shared across Components?NextDo we need to add states to create simple animations such as ScaleTo, FadeTo, etc on tap?
Last updated