diff --git a/README.md b/README.md index 05f414d..35dc3ba 100644 --- a/README.md +++ b/README.md @@ -1 +1,51 @@ **[View document in Syncfusion Xamarin Knowledge base](https://www.syncfusion.com/kb/12143/how-to-work-with-listview-sflistview-and-expander-sfexpander-in-xamarin-forms)** + +## Sample + +```xaml + + + + + + + + + + + + . . . + . . . + + + + + + + + +C#: +public class ExtendedListView : SfListView +{ + VisualContainer container; + + public ExtendedListView() + { + container = this.GetVisualContainer(); + container.PropertyChanged += Container_PropertyChanged; + } + + private void Container_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) + { + Device.BeginInvokeOnMainThread(async() => + { + var extent = (double)container.GetType().GetRuntimeProperties().FirstOrDefault(container => container.Name == "TotalExtent").GetValue(container); + await Task.Delay(250); + + if (e.PropertyName == "Height") + this.HeightRequest = extent; + }); + } +} +```