Exemple #1
0
 protected override void OnParametersSet()
 {
     base.OnParametersSet();
     if (string.IsNullOrWhiteSpace(showingImage) && !string.IsNullOrWhiteSpace(Image))
     {
         showingImage = Image;
     }
     if (IsLoading)
     {
         IsDisabled = true;
     }
     cssClassBuilder = HtmlPropertyBuilder.CreateCssClassBuilder();
     if (string.IsNullOrWhiteSpace(Cls) || AppendCustomCls)
     {
         cssClassBuilder.Add($"el-button", $"el-button--{Type.ToString().ToLower()}", Cls)
         .AddIf(Size != ButtonSize.Default, $"el-button--{Size.ToString().ToLower()}")
         .AddIf(IsPlain, "is-plain")
         .AddIf(IsRound, "is-round")
         .AddIf(IsDisabled, "is-disabled")
         .AddIf(IsLoading, "is-loading")
         .AddIf(IsCircle, "is-circle");
         return;
     }
     cssClassBuilder.AddIf(!string.IsNullOrWhiteSpace(Cls), Cls);
     if (string.IsNullOrWhiteSpace(Cls))
     {
         cssClassBuilder.Add($"el-button", $"el-button--{Type.ToString().ToLower()}")
         .AddIf(Size != ButtonSize.Default, $"el-button--{Size.ToString().ToLower()}")
         .AddIf(IsPlain, "is-plain")
         .AddIf(IsRound, "is-round")
         .AddIf(IsDisabled, "is-disabled")
         .AddIf(IsLoading, "is-loading")
         .AddIf(IsCircle, "is-circle");
     }
 }
 protected override void OnParametersSet()
 {
     base.OnParametersSet();
     layoutCssBuilder = HtmlPropertyBuilder.CreateCssStyleBuilder();
     if (North != null)
     {
         layoutCssBuilder = layoutCssBuilder.AddIf(Fit, $"height:calc(100vh - {NorthHeight}px)");
     }
     else
     {
         layoutCssBuilder = layoutCssBuilder.AddIf(Fit, "height:calc(100vh)");
     }
     layoutCssBuilder = layoutCssBuilder.Add(Style);
 }