private void PreviousCartesianOnClick(object sender, MouseButtonEventArgs e) { if (CartesianView == null) { return; } var current = CartesianExamples.IndexOf(CartesianView); current--; CartesianView = current >= 0 ? CartesianExamples[current] : CartesianExamples[CartesianExamples.Count - 1]; }
private void NextCartesianOnClick(object sender, MouseButtonEventArgs e) { if (CartesianView == null) { return; } var current = CartesianExamples.IndexOf(CartesianView); current++; CartesianView = CartesianExamples.Count > current ? CartesianExamples[current] : CartesianExamples[0]; }