Exemplo n.º 1
0
 public static void ApplyTheme(WpButton button, UiStyle style)
 {
     button.BackColor = style.NormalStyle.BackColor;
     button.ForeColor = style.NormalStyle.ForeColor;
     button.Font = style.NormalStyle.Font;
 }
Exemplo n.º 2
0
 static UiStyle()
 {
     DefaultStyle = new UiStyle
     {
         NormalStyle = new Style(),
         IsDefault = true
     };
     DefaultHoverStyle = new UiStyle
     {
         NormalStyle = new Style(),
         HoverStyle = new Style
         {
             BackColor = Color.LightGray
         },
         IsDefault = true
     };
 }
Exemplo n.º 3
0
 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
     };
 }
Exemplo n.º 4
0
        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();
        }