public Task <double> Render(object value) { var build = ViewFor(value); AsyncEventListener getSize = new AsyncEventListener(); build.SizeChanged += getSize.Listen; Container.Children.Add(build); return(getSize.Successfully); // or width if supporting horizontal and used like list/carousel }
private View AddFutureHeight(List <Task <double> > futureHeight, object newItem) { var view = ViewFor(newItem); var getSize = new AsyncEventListener(); view.SizeChanged += getSize.Listen; futureHeight.Add(getSize.Successfully); return(view); }