Hey,
I am trying to get an object from my WPF ListBox. I have a WPF usercontrol(ResultsControl) and it uses a Listbox(lbResults) to Display my custom Objects from a Win form. I am making a new WPF usercontrol(ShowInfoUserControl) to display my custom object's information. The showInfoUserControl should only become visible with the objects's information, when I press on an object in the WPF ListBox. I use Hyperlink to tick the showInfoUserControl. I have tried to lbResults.SelectedItem and lbResults.SelectedValue without luck. Could any one help me please? Every advice will be grateful.

my method to get my custom objects (code behind for ResultsControl)
public void GetResults(Result result)
{
WPFResult wpfResult = new WPFhResult(result.ObjectId, result.Header, result.Name);

searchResultsList.Add(wpfSearchResult);

lbResults.ItemsSource = resultsList;
}

private void Windows_Loaded(object sender, RoutedEventArgs e)
{
AddHandler(Hyperlink.ClickEvent, (RoutedEventHandler)Infocard_Click);
}

method to call the ShowInfoUserControl
private void Infocard_Click(object sender, RoutedEventArgs e)
{
ShowInfoUserControl infocard = new ShowInfoUserControl();
infocard.GetInfocard((Result)lbSearchResults.SelectedValues);
//infocard.GetInfocard((Result)lbSearchResults.SelectedItem);
}


These are my code behind in ShowInfoUserControl
public void GetInfocard(Result result)
{
Header.Text = result.Header;
Name.Text = result.Name;
}

my Xaml code for ShowInfoUserControl
<UserControl x:Class="WpfResultsControl.ShowInfoUserControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:svc="clr-namespace:WpfResultsControl"
Height="200" Width="200">
<Grid>
<StackPanel>
<TextBlock x:Name="Header" FontFamily="Tahoma" FontSize="8"></TextBlock>
<TextBlock x:Name="Name" FontFamily="Tahoma" FontSize="4"></TextBlock>
</StackPanel>
</Grid>
</UserControl>

many thanks in advance