I have this listview:
<Page
x:Class="DataBase.ControlsPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
DataContext="{Binding CustomersViewModel, Source={StaticResource ViewModelLocator}}">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<ListView Name="HeaderList" ItemsSource="{Binding Customers}">
<ListView.ItemTemplate>
<DataTemplate>
<Grid>
<Border Background="Bisque">
<TextBlock Text="{Binding Name"/>
</Border>
<ListView Name="SubItemsList" ItemsSource="{Binding Project}" ItemClick="SubItemClick">
<x:String>SubItem 1</x:String>
<x:String>SubItem 2</x:String>
<x:String>SubItem 3</x:String>
</ListView>
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
<x:String>Item 1</x:String>
<x:String>Item 2</x:String>
<x:String>Item 3</x:String>
</ListView>
</Grid>
</Page>
All I want is to catch the click of a subItem(ItemClick="SubItemClick">) in my CustomersViewModel. Is that possible? I know for the sub-items list items, the data is a Project which is just a data model, it does not contain any click handler. But, how can I catch the click in the view model and not in the code-behind?
Also I'm uploading a picture to visualise what I want: