Example #1
0
        protected override void RegisterClasses()
        {
            ClassMapper
            .Add(() => ClassProvider.Nav())
            .If(() => ClassProvider.NavTabs(), () => IsTabs)
            .If(() => ClassProvider.NavCards(), () => IsCards)
            .If(() => ClassProvider.NavPills(), () => IsPills)
            .If(() => ClassProvider.NavVertical(), () => IsVertical)
            .If(() => ClassProvider.NavFill(Fill), () => Fill != NavFillType.None);

            base.RegisterClasses();
        }
Example #2
0
        protected override void RegisterClasses()
        {
            ClassMapper
            .Add(() => ClassProvider.Table())
            .If(() => ClassProvider.TableFullWidth(), () => IsFullWidth)
            .If(() => ClassProvider.TableStriped(), () => IsStriped)
            .If(() => ClassProvider.TableBordered(), () => IsBordered)
            .If(() => ClassProvider.TableHoverable(), () => IsHoverable)
            .If(() => ClassProvider.TableNarrow(), () => IsNarrow)
            .If(() => ClassProvider.TableBorderless(), () => IsBorderless);

            base.RegisterClasses();
        }
Example #3
0
        protected override void RegisterClasses()
        {
            ClassMapper
            .Add(() => ClassProvider.Button())
            .If(() => ClassProvider.ButtonColor(Color), () => Color != Color.None && !IsOutline)
            .If(() => ClassProvider.ButtonOutline(Color), () => Color != Color.None && IsOutline)
            .If(() => ClassProvider.ButtonSize(Size), () => Size != ButtonSize.None)
            .If(() => ClassProvider.ButtonBlock(), () => IsBlock)
            .If(() => ClassProvider.ButtonActive(), () => IsActive)
            .If(() => ClassProvider.ButtonLoading(), () => IsLoading);

            AddonContainerClassMapper
            .If(() => ClassProvider.AddonContainer(), () => IsAddons);

            base.RegisterClasses();
        }
Example #4
0
        private IFluentSpacingWithSize WithSize(string value)
        {
            if (customRules == null)
            {
                customRules = new List <string> {
                    value
                }
            }
            ;
            else
            {
                customRules.Add(value);
            }

            ClassMapper.Dirty();

            return(this);
        }
Example #5
0
        private void HandleOpenState(bool isOpen)
        {
            if (modalBackdrop != null)
            {
                modalBackdrop.IsOpen = isOpen;
            }

            // TODO: find a way to remove javascript
            if (isOpen)
            {
                JSRunner.AddClassToBody("modal-open");
            }
            else
            {
                JSRunner.RemoveClassFromBody("modal-open");
            }

            ClassMapper.Dirty();
            StyleMapper.Dirty();
        }
        public void SelectPanel(string panelName)
        {
            if (lastSelectePanel != panelName)
            {
                lastSelectePanel = panelName;

                foreach (var child in childPanels)
                {
                    child.IsActive = child.Name == panelName;
                }

                // raise the panelchanged notification
                SelectedPanelChanged?.Invoke(panelName);

                // although nothing is actually changed we need to call this anyways or otherwise the rendering will not be called
                ClassMapper.Dirty();

                StateHasChanged();
            }
        }
Example #7
0
        /// <summary>
        /// Sets the active tab by the name.
        /// </summary>
        /// <param name="tabName"></param>
        public void SelectTab(string tabName)
        {
            if (lastSelectedTab != tabName)
            {
                lastSelectedTab = tabName;

                foreach (var child in childTabs)
                {
                    child.IsActive = child.Name == tabName;
                }

                // raise the tabchanged notification
                SelectedTabChanged?.Invoke(tabName);

                // although nothing is actually changed we need to call this anyways or otherwise the rendering will not be called
                ClassMapper.Dirty();

                StateHasChanged();
            }
        }
Example #8
0
        public IFluentSpacingOnBreakpointWithSideAndSize WithSize(SpacingSize spacingSize)
        {
            var spacingDefinition = new SpacingDefinition {
                Breakpoint = Breakpoint.None, Side = Side.All
            };

            if (!rules.ContainsKey(spacingSize))
            {
                rules.Add(spacingSize, new List <SpacingDefinition>()
                {
                    spacingDefinition
                });
            }
            else
            {
                rules[spacingSize].Add(spacingDefinition);
            }

            currentSpacing = spacingDefinition;
            ClassMapper.Dirty();
            return(this);
        }
Example #9
0
        private IFluentColumnOnBreakpointWithOffsetAndSize WithColumnSize(ColumnWidth columnSize)
        {
            var columnDefinition = new ColumnDefinition {
                Breakpoint = Breakpoint.None
            };

            if (!rules.ContainsKey(columnSize))
            {
                rules.Add(columnSize, new List <ColumnDefinition> {
                    columnDefinition
                });
            }
            else
            {
                rules[columnSize].Add(columnDefinition);
            }

            currentColumn = columnDefinition;
            ClassMapper.Dirty();

            return(this);
        }
Example #10
0
        /// <summary>
        /// Registers a child button reference.
        /// </summary>
        /// <param name="button">Button to register.</param>
        internal void Register(BaseButton button)
        {
            if (button == null)
            {
                return;
            }

            if (registeredButtons == null)
            {
                registeredButtons = new List <BaseButton>();
            }

            if (!registeredButtons.Contains(button))
            {
                registeredButtons.Add(button);

                ClassMapper.Dirty();

                if (registeredButtons?.Count >= 1)   // must find a better way to refresh dropdown
                {
                    StateHasChanged();
                }
            }
        }
 private void OnValidated(ValidatedEventArgs e)
 {
     ClassMapper.Dirty();
 }
Example #12
0
        internal void MenuChanged()
        {
            ClassMapper.Dirty();

            StateHasChanged();
        }