Exemplo n.º 1
0
        /// <summary>
        /// Builds the week title.
        /// </summary>
        /// <param name="builder">The builder.</param>
        private void BuildWeekTitle(RenderTreeBuilder builder)
        {
            var weekNames = typeof(DayOfWeek).GetEnumNames();

            foreach (var name in weekNames)
            {
                var week = Enum.Parse <DayOfWeek>(name);
                if (!WeekMapper.TryGetValue(week, out string?value))
                {
                    value = name;
                }


                builder.OpenComponent <TableHeader>(0);
                builder.BuildChildContentForComponent(1, value);
                builder.CloseComponent();
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Builds the week title.
        /// </summary>
        /// <param name="builder">The builder.</param>
        private void BuildWeekTitle(RenderTreeBuilder builder)
        {
            var weekNames = typeof(DayOfWeek).GetEnumNames();

            foreach (var name in weekNames)
            {
                var week = Enum.Parse <DayOfWeek>(name);
                if (!WeekMapper.TryGetValue(week, out string value))
                {
                    value = name;
                }


                builder.OpenComponent <Th>(0);
                builder.AddAttribute(10, nameof(Th.ChildContent), (RenderFragment)(th =>
                {
                    th.AddContent(0, value);
                }));
                builder.CloseComponent();
            }
        }