private void SexyOption_PointerPressed(object sender, PointerRoutedEventArgs e) { SexyOption newselect = (SexyOption)sender; if (newselect.Tag != selectedoption.Tag) { if (Convert.ToInt32(newselect.Tag) > Convert.ToInt32(selectedoption.Tag)) //select right { newselect.Gainlove(true); selectedoption.losslove(false); } else { newselect.Gainlove(false); selectedoption.losslove(true); } selectedoption = newselect; if (selectedoption.Tag.ToString() == "-1") { SubFrame.Navigate(typeof(SingersPage), null, new SuppressNavigationTransitionInfo()); } else { SubFrame.Navigate(typeof(SongsPage), selectedoption.Tag.ToString(), new SuppressNavigationTransitionInfo()); } } }
void InitOptions() { int i = -1; foreach (var optionname in options) { SexyOption option = new SexyOption(optionname) { Tag = i.ToString() }; OptionsAreas.Children.Add(option); option.PointerPressed += SexyOption_PointerPressed; i++; } selectedoption = (SexyOption)OptionsAreas.Children.First(); selectedoption.SelectIt(); SubFrame.Navigate(typeof(SingersPage)); }