protected virtual void OnSearchResultSelected(SearchResultSelectedEventArgs e)
 {
     var handler = SearchResultSelected;
     if (handler != null)
         handler(this, e);
 }
        private void AnounceSelectedItemAndCloseList()
        {
            var selectedItem = _resultsListBox.SelectedItem;
            if (selectedItem == null)
                return;

            var eventArgs = new SearchResultSelectedEventArgs(selectedItem);

            OnSearchResultSelected(eventArgs);

            _resultsListBox.Visibility = Visibility.Collapsed;
            _resultsListBox.SelectedItem = null;
            _searchBox.Focus(FocusState.Keyboard);
            _searchBox.QueryText = string.Empty;
        }
        private void SearchBox_SearchResultSelected(object sender, SearchResultSelectedEventArgs e)
        {
            SelectedItemTextBlock.Text = ((Person) e.SelectedItem).Name;

            Debug.WriteLine("Selected item:" + SelectedItemTextBlock.Text);
        }