public static void ApplyTheme(WpButton button, UiStyle style) { button.BackColor = style.NormalStyle.BackColor; button.ForeColor = style.NormalStyle.ForeColor; button.Font = style.NormalStyle.Font; }
static UiStyle() { DefaultStyle = new UiStyle { NormalStyle = new Style(), IsDefault = true }; DefaultHoverStyle = new UiStyle { NormalStyle = new Style(), HoverStyle = new Style { BackColor = Color.LightGray }, IsDefault = true }; }
private static UiStyle Clone(UiStyle style) { return new UiStyle { NormalStyle = style?.NormalStyle?.Clone(), HoverStyle = style?.HoverStyle?.Clone(), ClickStyle = style?.ClickStyle?.Clone(), SelectedStyle = style?.SelectedStyle?.Clone(), IsDefault = style?.IsDefault ?? false }; }
public static void SetStylForDropDowns(params WpStyledControl[] dropDowns) { if (dropDowns == null) return; var mstyle = new UiStyle { NormalStyle = new Style { BackColor = Color.Transparent, ForeColor = Color.Black, Padding = new Padding(0, 3, 0, 0), BorderColor = WpThemeColors.Teal.SetOpacity(60), BorderWidth = 1f }, HoverStyle = new Style { BackColor = Color.Transparent, ForeColor = Color.Black, Padding = new Padding(0, 3, 0, 0), BorderColor = WpThemeColors.Teal, BorderWidth = 1f, Cursor = Cursors.Hand } }; foreach (var mdropDown in dropDowns.Where(dd => dd != null)) mdropDown.Style = mstyle.Clone(); }