public void SetRectMainBg(LinearGradientBrush brush, string effectColor) { DropShadowEffect effect = new DropShadowEffect(); effect.Color = ColorUnity.HtmlToColor(effectColor); this.rectMain.Fill = brush; this.rectMain.Effect = effect; }
public void SetRectProcessBarBgByType(string type) { if (type == "1")//蓝色 { LinearGradientBrush brush = new LinearGradientBrush(); brush.StartPoint = new Point(0.5, 0); brush.EndPoint = new Point(0.5, 1); brush.GradientStops.Add(new GradientStop() { Color = ColorUnity.HtmlToColor("#FF7C96F0"), Offset = 0 }); brush.GradientStops.Add(new GradientStop() { Color = ColorUnity.HtmlToColor("#FF0362C1"), Offset = 1 }); this.rectProcessBar.Fill = brush; } if (type == "2")//红色 { LinearGradientBrush brush = new LinearGradientBrush(); brush.StartPoint = new Point(0.5, 0); brush.EndPoint = new Point(0.5, 1); brush.GradientStops.Add(new GradientStop() { Color = ColorUnity.HtmlToColor("#FFF07C7C"), Offset = 0 }); brush.GradientStops.Add(new GradientStop() { Color = ColorUnity.HtmlToColor("#FFC10303"), Offset = 1 }); this.rectProcessBar.Fill = brush; } }
private static void OnPropertyChangedCallback(DependencyObject sender, DependencyPropertyChangedEventArgs e) { MDF_MessageControl obj = sender as MDF_MessageControl; if (obj.storyShow == null) { return; } if (string.IsNullOrEmpty(obj.MsgText)) { return; } if (obj.MsgText.Contains("@")) { obj.lblMsg.Text = obj.MsgText.Substring(0, obj.MsgText.LastIndexOf("@")); } obj.storyShow.Begin(); (sender as MDF_MessageControl).Background = new SolidColorBrush(ColorUnity.HtmlToColor("#FFFFFBA3")); (sender as MDF_MessageControl).Foreground = new SolidColorBrush(Colors.Black); if (obj.State == 1) { LinearGradientBrush brush = new LinearGradientBrush(); brush.StartPoint = new Point(0.5, 0); brush.EndPoint = new Point(0.5, 1); GradientStop g1 = new GradientStop() { Color = ColorUnity.HtmlToColor("#FF1FD616"), Offset = 1 }; GradientStop g2 = new GradientStop() { Color = ColorUnity.HtmlToColor("#FF1BB914"), Offset = 1 }; GradientStop g3 = new GradientStop() { Color = ColorUnity.HtmlToColor("#FF179111"), Offset = 0.006 }; brush.GradientStops.Add(g1); brush.GradientStops.Add(g2); brush.GradientStops.Add(g3); (sender as MDF_MessageControl).Background = brush; (sender as MDF_MessageControl).Foreground = new SolidColorBrush(Colors.White); } if (obj.State == 2) { (sender as MDF_MessageControl).Background = new SolidColorBrush(Colors.Red); (sender as MDF_MessageControl).Foreground = new SolidColorBrush(Colors.White); } if (obj.State == 3) { (sender as MDF_MessageControl).Background = new SolidColorBrush(ColorUnity.HtmlToColor("#FFFFFBA3")); (sender as MDF_MessageControl).Foreground = new SolidColorBrush(Colors.Black); } }
public MDFStanderLineControl100() { this.DefaultStyleKey = typeof(MDFStanderLineControl100); ColorUnity.HtmlToColor("#FFFFFFF"); }
public void SetRectMainBgByType(string type) { if (type == "0")//需求:灰色 { LinearGradientBrush brush = new LinearGradientBrush(); brush.StartPoint = new Point(0.5, 0); brush.EndPoint = new Point(0.5, 1); brush.GradientStops.Add(new GradientStop() { Color = ColorUnity.HtmlToColor("#FFF7F7F2"), Offset = 0 }); brush.GradientStops.Add(new GradientStop() { Color = ColorUnity.HtmlToColor("#FFDED7D7"), Offset = 1 }); SetRectMainBg(brush, "#FFDCDECB"); } if (type == "1")//正常计划:绿色 { LinearGradientBrush brush = new LinearGradientBrush(); brush.StartPoint = new Point(0.5, 0); brush.EndPoint = new Point(0.5, 1); brush.GradientStops.Add(new GradientStop() { Color = ColorUnity.HtmlToColor("#FFA3F0A6"), Offset = 0 }); brush.GradientStops.Add(new GradientStop() { Color = ColorUnity.HtmlToColor("#FF0AC11B"), Offset = 1 }); SetRectMainBg(brush, "#FF5E6459"); } if (type == "2")//已完成:黄色 { LinearGradientBrush brush = new LinearGradientBrush(); brush.StartPoint = new Point(0.5, 0); brush.EndPoint = new Point(0.5, 1); brush.GradientStops.Add(new GradientStop() { Color = ColorUnity.HtmlToColor("#FFF3E8A0"), Offset = 0 }); brush.GradientStops.Add(new GradientStop() { Color = ColorUnity.HtmlToColor("#FFF7F704"), Offset = 1 }); brush.GradientStops.Add(new GradientStop() { Color = ColorUnity.HtmlToColor("#FFDED92D"), Offset = 0.507 }); SetRectMainBg(brush, "#FFDEE0CF"); } if (type == "3")//已完成:蓝色 { LinearGradientBrush brush = new LinearGradientBrush(); brush.StartPoint = new Point(0.5, 0); brush.EndPoint = new Point(0.5, 1); brush.GradientStops.Add(new GradientStop() { Color = ColorUnity.HtmlToColor("#FF88E0F9"), Offset = 0 }); brush.GradientStops.Add(new GradientStop() { Color = ColorUnity.HtmlToColor("#FF647EF0"), Offset = 1 }); SetRectMainBg(brush, "#FFDEE0CF"); } if (type == "4")//试制:棕色 { LinearGradientBrush brush = new LinearGradientBrush(); brush.StartPoint = new Point(0.5, 0); brush.EndPoint = new Point(0.5, 1); brush.GradientStops.Add(new GradientStop() { Color = ColorUnity.HtmlToColor("#FFFFC767"), Offset = 0 }); brush.GradientStops.Add(new GradientStop() { Color = ColorUnity.HtmlToColor("#FFE65B0C"), Offset = 1 }); SetRectMainBg(brush, "#FFDEE0CF"); } }
public MDFStanderUpDownLineControl() { this.DefaultStyleKey = typeof(MDFStanderUpDownLineControl); ColorUnity.HtmlToColor("#FFFFFFF"); }