Beispiel #1
0
        public override void SetStyle(ButtonStyle style)
        {
            Insist.IsTrue(style is IconButtonStyle, "style must be a ImageButtonStyle");

            base.SetStyle(style);
            this.style = (IconButtonStyle)style;
            if (image != null)
            {
                UpdateImage();
            }
        }
Beispiel #2
0
        public IconButton(IconButtonStyle style) : base(style)
        {
            image     = new Image();
            iconImage = new Image();
            var stck = new Stack();

            image.SetScaling(Scaling.Fit);
            stck.Add(image);
            stck.Add(iconImage);
            Add(stck);
            SetStyle(style);
            PadLeft(style.PadLeft).PadRight(style.PadRight).PadTop(style.PadTop).PadBottom(style.PadBottom);
            SetSize(PreferredWidth, PreferredHeight);
        }