private void SearchBar_SearchButtonPressed(object sender, EventArgs e) { var searchBar = sender as SearchBar; if (searchBar == null) { return; } if (string.IsNullOrWhiteSpace(searchBar.Text)) { return; } _SMSManager.SortSMSMessagesBy(searchBar.Text); }