this is my xaml:
<ListView Name="myListView" ItemsSource="{Binding ElementName=IndexPage, Path=SeriesCollection}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" IsSynchronizedWithCurrentItem="True" SelectionChanged="handleSelected">
<ListView.ItemsPanel >
<ItemsPanelTemplate>
<WrapPanel>
</WrapPanel>
</ItemsPanelTemplate>
</ListView.ItemsPanel>
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel >
<Image Width="214" Height="317" Source="{Binding Image}"/>
<Label Content="{Binding Name}" />
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
and this is my code behind
public void handleSelected(object sender, RoutedEventArgs args)
{
object currentSerie = myListView.Items.CurrentItem;
Console.WriteLine(currentSerie.GetType());
Console.WriteLine(currentSerie.ToString());
}
how do i work with currentSerie? how do i access the data which is stored in each Item? i cant access properties and i cant convert it to anything else then object.
also interesting, the output of the code is not "object" but "Series" so ToString() and GetType() gets the type right.
thx for any help