Assume that child1
and child2
are well formed Views. The following compiles:
var stackLayout = new StackLayout { Children = { child1, child2 } };
But the following does not compile, saying I am not allowed to assign to a read-only property:
var childrenList = new List<View> { child1, child2};
var stackLayout = new StackLayout { Children = childrenList };
Is this intentional? I don't really see that there should be any difference here. Thanks!