private void NextClick(object sender, RoutedEventArgs e) { int next = (int)Fleischart + 1; if (next > Enum.GetValues(typeof(Fleischart)).Length) { next = 0; } Fleischart = (Fleischart)next; }
private void PrevClick(object sender, RoutedEventArgs e) { int prev = (int)Fleischart - 1; if (prev < 0) { prev = Enum.GetValues(typeof(Fleischart)).Length - 1; } Fleischart = (Fleischart)prev; }