public Button() : base() { UnderlyingElement = new AnchorElement(); //Add Materialize Button classes UnderlyingJQElement.AddClass("waves-effect waves-light btn"); Create(); UnderlyingJQElement.Click += OnClick; }
/// <summary> /// Updates the element's layout styles /// </summary> protected virtual void UpdateMarginLayout() { UnderlyingJQElement.Css("position", "absolute"); UnderlyingJQElement.Css("left", _margin.Left); UnderlyingJQElement.Css("top", _margin.Top); UnderlyingJQElement.Css("right", _margin.Right); UnderlyingJQElement.Css("bottom", _margin.Bottom); }
public void ApplyLayoutStyles() { switch (LayoutStyle) { case LayoutStyle.Absolute: UnderlyingJQElement.Css("position", "relative"); break; } }
/// <summary> /// We call the standard update size layout, but we also need to add some padding /// to the top/?bottom too???? of the button to keep it looking normal /// Also take into account the text style and size. /// </summary> protected override void UpdateSizeLayout() { base.UpdateSizeLayout(); //Add padding to the button to make it look less weird var topSpacing = Size.Height / 2 - Style.TextSize / 2; //optimal top padding UnderlyingJQElement.Css("padding-top", topSpacing); }
public virtual void UpdateStyles(object sender, string propertyName) { UnderlyingJQElement.Css("font-size", $"{Style.TextSize}pt"); switch (Style.Weight) { case FontWeight.Normal: UnderlyingJQElement.Css("font-weight", "normal"); break; case FontWeight.Bold: UnderlyingJQElement.Css("font-weight", "bold"); break; } }
protected virtual void UpdateSizeLayout() { UnderlyingJQElement.Css("width", Size.Width); UnderlyingJQElement.Css("height", Size.Height); }