public override void SetStyle(ButtonStyle style) { Insist.IsTrue(style is TextButtonStyle, "style must be a TextButtonStyle"); base.SetStyle(style); this.style = (TextButtonStyle)style; if (label != null) { var textButtonStyle = (TextButtonStyle)style; var labelStyle = label.GetStyle(); labelStyle.Font = textButtonStyle.Font; labelStyle.FontColor = textButtonStyle.FontColor; label.SetStyle(labelStyle); } }
public void SetStyle(ImageTextButtonStyle style) { Insist.IsTrue(style is ImageTextButtonStyle, "style must be a ImageTextButtonStyle"); base.SetStyle(style); if (image != null) { UpdateImage(); } if (label != null) { var labelStyle = label.GetStyle(); labelStyle.Font = style.Font; labelStyle.FontColor = style.FontColor; label.SetStyle(labelStyle); } }
public Window SetStyle(WindowStyle style) { this.style = style; SetBackground(style.Background); var labelStyle = titleLabel.GetStyle(); labelStyle.Font = style.TitleFont ?? labelStyle.Font; labelStyle.FontColor = style.TitleFontColor; titleLabel.SetStyle(labelStyle); InvalidateHierarchy(); return(this); }