When I enable the ScopeBar and wire up the SelectedScopeButtonIndexChanged on a Monotouch.Dialog control, the automatic search feature that is enabled when you set EnabledSearch=true is disabled.
Here’s how it becomes disabled:
UISearchBar sb = SearchBar;
if (sb != null)
{
sb.ScopeButtonTitles = new string[] { "Girl".t(),"Boy".t(),"All".t() };
sb.ShowsScopeBar = true;
sb.SizeToFit();
// THIS NEXT LINE KILLS SEARCH, remove to make it all work again
sb.SelectedScopeButtonIndexChanged+= (sender, e) => {Update();};
}
The reason that this breaks searching is because DialogViewController assigns a custom UISearchBarDelegate on the UISearchBar.
When you connect to an event, that clobbers the Delegate and replaces it with a special UISearchBarDelegate that forwards all delegate methods to events.
In other words, you cannot mix and match delegates with events on the same control.
One possible solution (if you don’t want to patch MonoTouch.Dialog itself), is to replace the existing sb.Delegate with your own custom UISearchBarDelegate which could implement the SearchScope methods and forward everything else to the UISearchBarDelegate that was already set previously.
for example: