Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic how can we apply Color and thickness property to First Element Template in shape constructor (Read 2387 times)
Chetna Tumme
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 10
Joined: Nov 28th, 2012
how can we apply Color and thickness property to First Element Template in shape constructor
Dec 11th, 2012 at 8:39am
Print Post  
var shape = new Shape(
                        new ElementTemplate[]
                    {
                        new LineTemplate(20, 20, 0, 30,Colors.Black,3),
                        new LineTemplate(0, 30, 20, 40,Colors.Black,3),
                        new LineTemplate(20, 40, 0, 30),
                        new LineTemplate(0, 30, 20, 20)
                    },
                        new ElementTemplate[]
                    {
                        new LineTemplate(70, 20, 90, 30,Colors.Black,3),
                        new LineTemplate(90, 30, 70, 40,Colors.Black,3),
                        new LineTemplate(70, 40, 90, 30),
                        new LineTemplate(90, 30,70, 20),
                    },
                    FillRule.Nonzero, "CommunicationPath",
                    new[]
                    {
                        new ShapeDecoration(
                          new ElementTemplate[]
                          {
                            new LineTemplate(0, 30, 90, 30),
                            new LineTemplate(90, 30, 0, 30)
                          },Brushes.Black,FillRule.Nonzero,new Pen(Brushes.Black,1.0,DashStyles.Dash)
                                            )
                    });
          
            var shapeNode = new ShapeNode
                                {
                                    Shape = shape,
                                    Bounds = new Rect(60, 60, 50, 50),
                                    Constraints = {KeepInsideParent = true},
                                    Name = "Node",
                                    Text = "Node",
                                    Brush = new SolidColorBrush{Color = Colors.Magenta}

                                };
            mindFusionDiagram.Nodes.Add(shapeNode);

1. the width is getting applied properly to Line Templates in Second Element Template...
2. But In First Element Template[] width is not getting applied
Please provide solution
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: how can we apply Color and thickness property to First Element Template in shape constructor
Reply #1 - Dec 11th, 2012 at 11:05am
Print Post  
The first array defines elements of the shape outline and they are rendered using the node's Stroke and StrokeThickness. You could copy the element you need to the second array, repeating it as a decoration line; that should render it using the color and thickness specified as LineTemplate arguments.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint