Hi am using XAML file given below.I want to Navigate Listbox selected item to another page.
You have set ItemsSource="{Binding Images}"
for your list box which means that you should not cast to Notch
in your SelectionChangedHandler
. Every item receives an image as its data context which is an element from the list Images
inside a Notch
instance.
Therefore, you can only cast to String
inside your handler.
You have a top-level listbox and each item again has its own listbox. You are tracking the selection changes for the inner list and in that case your data context is individual item for that list. You do not have access to parent scope inside it.