private void OptionClicked(object sender, RoutedEventArgs e) { KinectCircleButton circleButton = sender as KinectCircleButton; string name = circleButton.Name; int selectedIndex; switch (name) { case "img1": selectedIndex = 0; break; case "img2": selectedIndex = 1; break; case "img3": selectedIndex = 2; break; case "img4": selectedIndex = 3; break; default: selectedIndex = 0; break; } OddItemSelectedEventArgs eventArgs = new OddItemSelectedEventArgs(sender, selectedIndex, OddItemSelectedEvent); this.RaiseEvent(eventArgs); }
protected virtual void OnOddItemSelected(OddItemSelectedEventArgs e) { this.RaiseEvent(e); }