예제 #1
0
        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]);
        }
예제 #2
0
        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]);
        }