So im trying to load a different string when the user has selected a different item, my code:
void ModeSelectorSelectionChanged(object sender, SelectionChangedEventArgs e)
{
var data1 = new string[]
{
"January 2012",
"February 2012",
"March 2012",
"April 2012",
};
var data2 = new string[]
{
"Married",
"Divorced",
"Buy new house",
"Get promotion",
};
if (_Menu2.SelectedIndex == 2) {
_Menu3.ItemsSource = data1;
}
else if (_Menu2.SelectedIndex == 3)
{
_Menu3.ItemsSource = data2;
}
}
When I use just 1 string it works fine, but as soon as I try to load 2 different strings in the same drop down menu it shuts down, meaning that its not showing any string data at all. What am I doing wrong?