Exemple #1
0
 public Button() : base()
 {
     UnderlyingElement = new AnchorElement();
     //Add Materialize Button classes
     UnderlyingJQElement.AddClass("waves-effect waves-light btn");
     Create();
     UnderlyingJQElement.Click += OnClick;
 }
Exemple #2
0
 /// <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);
 }
Exemple #3
0
 public void ApplyLayoutStyles()
 {
     switch (LayoutStyle)
     {
     case LayoutStyle.Absolute:
         UnderlyingJQElement.Css("position", "relative");
         break;
     }
 }
Exemple #4
0
        /// <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);
        }
Exemple #5
0
        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;
            }
        }
Exemple #6
0
 protected virtual void UpdateSizeLayout()
 {
     UnderlyingJQElement.Css("width", Size.Width);
     UnderlyingJQElement.Css("height", Size.Height);
 }