Hello,
I am trying to create navigation inside a listbox menu. I load data from xml to populate a list. Each item in the list box should be a link or button. Then, I create a frame to load xaml pages in it. I tested to load pages employing button control, outside listbox with on click event and it worked well. However, I cannot make it work with list box items. I am hoping to get help from you. Any sample or ideas are highly appreciated.
Below is the code:
XAML:
 

 

 
XML:
 

 XML:



 Page 01


 Page 02


C# to initiate a click o n listbox item and get the path to page:
 private void SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)        
{
ListBoxItem lbi = ((sender as ListBox).SelectedItem as ListBoxItem);
string itemName = lbi.Content.ToString();
if ( Nav_ListBox.SelectedItem.Equals("Page01" ) )
{
ContentFrame.Source = new Uri("Pages/Page01.xaml", UriKind.RelativeOrAbsolute);
}
}

Thank you in advance.