I have a C# Store App and using DataTemplate Selectors to determine which type of Template to use in a ListView Control bound to an Array. Because it is templated, I cannot assign a dynamic x:Name to each ListView Row.
I need to be able to access the listview rows by Index and set the Visibility of them to On or Off. I have tried things like this, but the .ItemContainerGenerator
.ContainerFromItem(item);
return null
and I get a Nullable exception every time:
How do I access a control inside a XAML DataTemplate?
After doing some research, it appears that the above solution only works if I touch or have SelectedItem set. See here
Why does ItemContainerGenerator return null?
I need to be able to Call a Method, both on Page load(initial setting) and also on button click and modify certain rows visibility.