Beispiel #1
0
 public Link(string nombre, string ruta, NavLinkMatch match, string icono, Type pagina)
 {
     this.Nombre = nombre;
     this.Ruta   = ruta;
     this.Match  = match;
     this.Icono  = icono;
     this.Pagina = pagina;
 }
Beispiel #2
0
 public MenuItem(string text, string icon, string url, NavLinkMatch match = NavLinkMatch.Prefix, bool isSmall = true, bool isLarge = true, bool isNewWindow = false)
 {
     Text        = text;
     Icon        = icon;
     Url         = url;
     Match       = match;
     IsSmall     = isSmall;
     IsLarge     = isLarge;
     IsNewWindow = isNewWindow;
 }
        public MenuBuilder AddItem(int position, string title, string link, NavLinkMatch match = NavLinkMatch.Prefix, bool isVisible = true, bool isEnabled = true)
        {
            var menuItem = new MenuItem
            {
                Position  = position,
                Title     = title,
                Link      = link,
                Match     = match,
                IsVisible = isVisible,
                IsEnabled = isEnabled
            };

            _menuItems.Add(menuItem);

            return(this);
        }
Beispiel #4
0
        public MenuBuilder AddItem(int position, string title, string link, NavLinkMatch match = NavLinkMatch.Prefix, bool isVisible = true, bool isEnabled = true)
        {
            var menuItem = new MenuItem();

            menuItem.Position  = position;
            menuItem.Title     = title;
            menuItem.Link      = link;
            menuItem.Match     = match;
            menuItem.IsSubMenu = false;
            menuItem.IsVisible = isVisible;
            menuItem.IsEnabled = isEnabled;

            _menuItems.Add(menuItem);

            return(this);
        }
        private static string CreatePanelMenu(string currentAbsoluteUrl, NavLinkMatch match, params string[] urls)
        {
            using var ctx = new TestContext();

            ctx.Services.RemoveAll <NavigationManager>();
            ctx.Services.TryAddSingleton <NavigationManager>(new TestNavigationManager(currentAbsoluteUrl));

            var component = ctx.RenderComponent <RadzenPanelMenu>();

            component.SetParametersAndRender(parameters => parameters.Add(p => p.Match, match).AddChildContent(builder =>
            {
                foreach (var url in urls)
                {
                    builder.OpenComponent <RadzenPanelMenuItem>(0);
                    builder.AddAttribute(1, nameof(RadzenPanelMenuItem.Path), url);
                    builder.CloseComponent();
                }
            }));

            return(component.Markup);
        }
Beispiel #6
0
 public static component navLink(NavLinkMatch navLinkMatch) => (attributes, children) =>
 component <NavLink>(attributes.Prepend(new ComponentAttribute("Match", navLinkMatch)), children);
Beispiel #7
0
        public SideBarBuilder AddItem(int position, string title, string link, string icon = null, string badge = null, NavLinkMatch match = NavLinkMatch.Prefix, bool isVisible = true, bool isEnabled = true)
        {
            var menuItem = new MenuItem
            {
                Position   = position,
                Title      = title,
                Link       = link,
                Icon       = icon,
                Badge      = badge,
                BadgeValue = "0",
                Match      = match,
                IsSubMenu  = false,
                IsVisible  = isVisible,
                IsEnabled  = isEnabled
            };

            _menuItems.Add(menuItem);

            return(this);
        }
Beispiel #8
0
 public MenuItem(string text, string url, RenderFragment icon, NavLinkMatch match = NavLinkMatch.Prefix)
 {
     Text = text;
     Url  = url;
     Icon = icon;
 }