Exemplo n.º 1
0
 public DiagramMetaExtendedLine()
 {
     MetaLine.IsEndings       = false;
     MetaLine.StrokeThickness = 1;
     MetaLine.Stroke          = (Brush)LineEndings.FindResource("0ForegroundBrush");
     MetaLine.StrokeDashArray = new DoubleCollection(new double[] { 5, 3 });
 }
Exemplo n.º 2
0
        public override void Highlight()
        {
            base.Highlight();

            MetaLine.Stroke = (Brush)LineEndings.FindResource("0LightHighlightBrush");

            Panel.SetZIndex(MetaLine, 99999);
        }
Exemplo n.º 3
0
        protected virtual void UpdateLineEnds()
        {
            if (Vertex.Get("BackgroundColor:") != null)
            {
                BackgroundColor = UIWpf.GetBrushFromColorVertex(Vertex.Get("BackgroundColor:"));
            }
            else
            {
                BackgroundColor = (Brush)Line.FindResource("0BackgroundBrush");
            }

            if (Vertex.Get("ForegroundColor:") != null)
            {
                ForegroundColor = UIWpf.GetBrushFromColorVertex(Vertex.Get("ForegroundColor:"));
            }
            else
            {
                ForegroundColor = (Brush)Line.FindResource("0ForegroundBrush");
            }

            LineEndings.Stroke = ForegroundColor;
            Line.Stroke        = ForegroundColor;
            Label.Foreground   = ForegroundColor;


            string StartAnchor = (string)GraphUtil.GetValue(Vertex.Get(@"StartAnchor:"));
            string EndAnchor   = (string)GraphUtil.GetValue(Vertex.Get(@"EndAnchor:"));

            if (StartAnchor == "Straight")
            {
                LineEndings.StartEnding = LineEndEnum.Straight;
                Line.StartEnding        = LineEndEnum.Straight;
            }

            if (EndAnchor == "Straight")
            {
                LineEndings.EndEnding = LineEndEnum.Straight;
                Line.EndEnding        = LineEndEnum.Straight;
            }

            if (StartAnchor == "Arrow")
            {
                LineEndings.StartEnding = LineEndEnum.Arrow;
                Line.StartEnding        = LineEndEnum.Arrow;
            }

            if (EndAnchor == "Arrow")
            {
                LineEndings.EndEnding = LineEndEnum.Arrow;
                Line.EndEnding        = LineEndEnum.Arrow;
            }

            if (StartAnchor == "Triangle")
            {
                LineEndings.StartEnding = LineEndEnum.Triangle;
                Line.StartEnding        = LineEndEnum.Triangle;

                FillBrush          = BackgroundColor;
                HighlightFillBrush = BackgroundColor;
            }

            if (EndAnchor == "Triangle")
            {
                LineEndings.EndEnding = LineEndEnum.Triangle;
                Line.EndEnding        = LineEndEnum.Triangle;

                FillBrush          = BackgroundColor;
                HighlightFillBrush = BackgroundColor;
            }

            if (StartAnchor == "FilledTriangle")
            {
                LineEndings.StartEnding = LineEndEnum.FilledTriangle;
                Line.StartEnding        = LineEndEnum.FilledTriangle;

                FillBrush          = ForegroundColor;
                HighlightFillBrush = (Brush)LineEndings.FindResource("0LightHighlightBrush");
            }

            if (EndAnchor == "FilledTriangle")
            {
                LineEndings.EndEnding = LineEndEnum.FilledTriangle;
                Line.EndEnding        = LineEndEnum.FilledTriangle;

                FillBrush          = ForegroundColor;
                HighlightFillBrush = (Brush)LineEndings.FindResource("0LightHighlightBrush");
            }

            if (StartAnchor == "Diamond")
            {
                LineEndings.StartEnding = LineEndEnum.Diamond;
                Line.StartEnding        = LineEndEnum.Diamond;

                FillBrush          = BackgroundColor;
                HighlightFillBrush = BackgroundColor;
            }

            if (EndAnchor == "Diamond")
            {
                LineEndings.EndEnding = LineEndEnum.Diamond;
                Line.EndEnding        = LineEndEnum.Diamond;

                FillBrush          = BackgroundColor;
                HighlightFillBrush = BackgroundColor;
            }

            if (StartAnchor == "FilledDiamond")
            {
                LineEndings.StartEnding = LineEndEnum.FilledDiamond;
                Line.StartEnding        = LineEndEnum.FilledDiamond;

                FillBrush          = ForegroundColor;
                HighlightFillBrush = (Brush)LineEndings.FindResource("0LightHighlightBrush");
            }

            if (EndAnchor == "FilledDiamond")
            {
                LineEndings.EndEnding = LineEndEnum.FilledDiamond;
                Line.EndEnding        = LineEndEnum.FilledDiamond;

                FillBrush          = ForegroundColor;
                HighlightFillBrush = (Brush)LineEndings.FindResource("0LightHighlightBrush");
            }


            if (FillBrush != null)
            {
                LineEndings.Fill = FillBrush;
            }

            LineEndings.ArrowLength = 0;
            Line.ArrowLength        = 0;
            LineEndings.ArrowLength = 15;
            Line.ArrowLength        = 15;
        }