public void StartSearch()
{
var searchbar = TableView.Source as ISearchBar;
if (searchbar != null && searchbar.IsSearchbarHidden || _Searchbar == null)
{
TableView.ScrollToRow(NSIndexPath.FromRowSection(0, 0), UITableViewScrollPosition.Top, true);
CreateSearchbar();
UIView.BeginAnimations(null);
UIView.SetAnimationDuration(0.3);
_Searchbar.Frame = new RectangleF(0, 0, _Searchbar.Frame.Width, 45);
TableView.TableHeaderView = _Searchbar;
if (_OriginalSections == null)
{
_OriginalSections = new Dictionary<int, Section>(((BaseDialogViewSource)TableView.Source).Sections);
_OriginalDataContext = new List<object>();
foreach(var section in _OriginalSections.Values)
{
_OriginalDataContext.Add(section.DataContext);
}
}
UIView.CommitAnimations();
}
}