@namespace AntDesign @inherits AntDomComponentBase @if (Text != null || ChildContent != null) { @if (Text != null) { @Text } else { @ChildContent } } @code { [Parameter] public RenderFragment ChildContent { get; set; } [Parameter] public string Text { get; set; } [Parameter] public Boolean Plain { get; set; } = false; /// /// 'horizontal' | 'vertical' /// [Parameter] public string Type { get; set; } = "horizontal"; /// /// 'left' | 'right' | 'center' /// [Parameter] public string Orientation { get; set; } = "center"; [Parameter] public bool Dashed { get; set; } = false; private void setClass() { ClassMapper.Clear() .Add("ant-divider") .Add($"ant-divider-{this.Type}") .If("ant-divider-with-text", () => Text != null || ChildContent != null) .If($"ant-divider-with-text-{this.Orientation}", () => Text != null || ChildContent != null) .If($"ant-divider-plain", () => Plain == true || Text != null || ChildContent != null) .If("ant-divider-dashed", () => Dashed) ; } protected override void OnParametersSet() { setClass(); base.OnParametersSet(); } protected override void OnInitialized() { setClass(); base.OnInitialized(); } }