private void BuildLayout() { _listView = new MatchListView { VerticalOptions = LayoutOptions.FillAndExpand, ItemTemplate = new DataTemplate(() => new MatchCell()), IsPullToRefreshEnabled = false, IsRefreshing = IsBusy, IsGroupingEnabled = true, IsVisible = false, RowHeight = 65, RefreshCommand = new Command(RefreshData) }; _listView.ItemTapped += HandleItemSelected; _searchbar = new SearchBar { Placeholder = StringResource.FilterLabel, BindingContext = this }; Content = new StackLayout { VerticalOptions = LayoutOptions.FillAndExpand, Orientation = StackOrientation.Vertical, Spacing = 0, Children = { _searchbar, _listView } }; }
private bool disposedValue = false; // To detect redundant calls protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { // dispose managed state (managed objects). _matches?.Clear(); _listView?.Dispose(); } // free unmanaged resources (unmanaged objects) and override a finalizer below. // set large fields to null. _searchbar = null; _matches = null; _listView = null; disposedValue = true; } }