private Family getMemberSelection(int numRows)
        {
            ModernDialogForMemberSearch searchResultModernDialog = null;

            if (numRows == 0) // Search returned no results
            {
                return(null);
            }
            if (numRows == 1) // Search returned one result, we have our selectedMember
            {
                return(DbHelper.SelectedMember);
            }
            if (numRows > 1) // Search returned several results, user must choose
            {
                searchResultModernDialog = new ModernDialogForMemberSearch()
                {
                    Title   = rm.GetString("SearchResultDialogTitle"),
                    Content = new Dialogs.SearchResultDialog()
                };
                searchResultModernDialog.ShowDialog();

                if (searchResultModernDialog.Result == MessageBoxResult.OK) // User clicked Ok or Double Clicked an item
                {
                    return(DbHelper.SelectedMember);
                }
                // User clicked Cancel
                return(null);
            }
            return(null);
        }
        private void searchResultsListView_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            //ListViewItem selectedItem = getSelectedListViewItem(sender as ListView);

            if (selectedItem == null) // No item selected
            {
                return;
            }

            ModernDialogForMemberSearch parentWindow = Window.GetWindow(this) as ModernDialogForMemberSearch;

            parentWindow.OkButton.Command.Execute(MessageBoxResult.OK);
        }
        private void searchResultsListView_SelectionChanged(object sender, RoutedEventArgs e)
        {
            selectedItem = (sender as ListView).SelectedItem as ListViewItem;

            Family selectedMember = selectedItem.Content as Family;

            DbHelper.SelectedMember = selectedMember; // make selectedMember variable avaliable in other controls

            ModernDialogForMemberSearch parentWindow = Window.GetWindow(this) as ModernDialogForMemberSearch;

            if (parentWindow.OkButton.IsEnabled == false)
            {
                parentWindow.OkButton.IsEnabled = true;
            }
        }