I am new to UWP. I have a question which already has been asked here,
However, none of the solutions really work. I have tested them out, "ElementName" can not find the Name for the parent ListView.
Restating the scenario here,
Let's say I have this skeleton. [Writing in pseudocode]
ViewModel{
Collection< TypeT > CollectionParent{}
RelayCommand_For_ChildList ChildItemClick;
}
//TypeT is a model in here.
TypeT{
Collection<string> CollectionChild{}
}
<ListView Name="ParentListView" ItemSource="CollectionParent">
<ListView.ItemTemplate>
<DataTemplate>
<ListView Name="ChildListView" Command="{Binding ChildItemClick}" ItemSource="AnotherCollectionWithinTheFirstCollection">
</ListView>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
When I would run this code, "Binding ChildItemClick" tries to find "ChildItemClick" inside TypeT , instead of ViewModel.
I want to catch this event inside a ViewModel. How can I do that, please suggest.
Thank you for reading.