diff --git a/README.md b/README.md index baea65c..c475ce5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,45 @@ # How-to-load-xamarin.forms-listview-for-full-height-without-virtualization ? This example demonstrates how to load xamarin.forms listview for full height without virtualization. +## Sample + +```xaml + + + + + + + + + + + + + + + . . . + . . . + + + + + + + + + + +listView.Loaded += OnListViewLoaded; + +private void OnListViewLoaded(object sender, ListViewLoadedEventArgs e) +{ + var container = listView.GetVisualContainer(); + var extent = (double)container.GetType().GetRuntimeProperties().FirstOrDefault(x => x.Name == "TotalExtent").GetValue(container); + listView.HeightRequest = extent; +} +``` ## Requirements to run the demo ##