예제 #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;
 }
예제 #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
     };
 }
예제 #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
     };
 }
예제 #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();
        }