public static NavigationInfo FromMenu(MenuSchema menuItem, bool includeState = false)
        {
            var navigationInfo = new NavigationInfo
            {
                Type         = SafeParse(menuItem.Type),
                IncludeState = includeState
            };

            if (navigationInfo.Type == NavigationType.Page)
            {
                navigationInfo.TargetPage = menuItem.Target;
            }
            else
            {
                navigationInfo.TargetUri = new Uri(menuItem.Target, UriKind.Absolute);
            }

            return(navigationInfo);
        }
Exemple #2
0
        public static NavigationInfo FromMenu(MenuSchema menuItem, bool includeState = false)
        {
            var navigationInfo = new NavigationInfo
            {
                Type = SafeParse(menuItem.Type),
                IncludeState = includeState
            };

            if (navigationInfo.Type == NavigationType.Page)
            {
                navigationInfo.TargetPage = menuItem.Target;
            }
            else
            {
                navigationInfo.TargetUri = new Uri(menuItem.Target, UriKind.Absolute);
            }

            return navigationInfo;
        }
        public static NavigationInfo ToNavigationInfo(this MenuSchema menuItem, bool includeState = false)
        {
            if (menuItem == null)
            {
                return null;
            }

            var navigationInfo = new NavigationInfo
            {
                NavigationType = SafeParse(menuItem.MenuType),
                IncludeState = includeState
            };

            if (navigationInfo.NavigationType == NavigationType.Page)
            {
                navigationInfo.TargetPage = menuItem.Target;
            }
            else
            {
                navigationInfo.TargetUri = new Uri(menuItem.Target, UriKind.Absolute);
            }

            return navigationInfo;
        }
 public NavigableItem(string pageName, NavigationInfo navigationInfo)
 {
     this.PageName = pageName;
     this.NavigationInfo = navigationInfo;
 }