private object GetPreviousNavigationTarget() { var currentContent = this.Content; if (NavigationTargets == null || NavigationTargets.Contains(currentContent) == false) { return(null); } var index = NavigationTargets.IndexOf(currentContent) - 1; if (index < 0) { index = NavigationTargets.Count - 1; } return(NavigationTargets[index]); }
private object GetNextNavigationTarget() { var currentContent = this.Content; if (NavigationTargets == null || NavigationTargets.Contains(currentContent) == false) { return(null); } var index = NavigationTargets.IndexOf(currentContent) + 1; if (index >= NavigationTargets.Count) { index = 0; } return(NavigationTargets[index]); }