Ejemplo n.º 1
0
        /// <summary>
        /// 获取SegmentSeries默认样式(Line)
        /// </summary>
        /// <returns>SegmentSeries默认样式</returns>
        public static Style GetSegmentSeriesDefaultStyle()
        {
            if (_segmentSeriesDefaultStyle == null)
            {
                var style = new Style();
                style.TargetType = typeof(Line);
                style.Setters.Add(new Setter(Line.StrokeProperty, ColorBrushHelper.GetColorByIndex(0)));
                style.Setters.Add(new Setter(Line.StrokeThicknessProperty, 2d));

                var trigger = new Trigger();
                trigger.Property = Line.IsMouseOverProperty;
                trigger.Value    = true;
                trigger.Setters.Add(new Setter(Line.StrokeThicknessProperty, 3d));
                style.Triggers.Add(trigger);
                _segmentSeriesDefaultStyle = style;
            }

            return(_segmentSeriesDefaultStyle);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取LineSeries默认样式(Path)
        /// </summary>
        /// <returns>LineSeries默认样式</returns>
        public static Style GetLineSeriesDefaultStyle()
        {
            if (_lineSeriesDefaultStyle == null)
            {
                var style = new Style();
                style.TargetType = typeof(Path);
                style.Setters.Add(new Setter(Path.StrokeProperty, ColorBrushHelper.GetColorByIndex(0)));
                style.Setters.Add(new Setter(Path.StrokeThicknessProperty, 2d));
                //style.Setters.Add(new Setter(Path.FillProperty, Brushes.White));

                var trigger = new Trigger();
                trigger.Property = Path.IsMouseOverProperty;
                trigger.Value    = true;
                trigger.Setters.Add(new Setter(Path.StrokeThicknessProperty, 3d));
                style.Triggers.Add(trigger);
                _lineSeriesDefaultStyle = style;
            }

            return(_lineSeriesDefaultStyle);
        }