We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

DrawingObject doesn't obey the style colour properties

Hi,

I'm currently running a feasibility assessment of the Blazor library for our project. I have a created a subclass of the DiagramConnector class with some default properties set. When this is added the symbol palette, and dragged from there the colours and other properties are displayed correctly. However, when the same custom class is used as the DrawingObject it ignores the colours and other properties that are set.

public class ExampleConnector: DiagramConnector
    {

        public ExampleConnector() : base()
        {
            Type = Diagrams.Segments.Orthogonal;
            SourcePoint = new ConnectorSourcePoint() { X = 0, Y = 0 };
            TargetPoint = new ConnectorTargetPoint() { X = 40, Y = 40 };
            Style = new ConnectorShapeStyle()
            {
                StrokeColor = "#FF0000",
                StrokeWidth = 2,
            };
            TargetDecorator = new ConnectorTargetDecorator() { Shape = DecoratorShapes.None };
            Constraints = ConnectorConstraints.Default &
                          ~ConnectorConstraints.Drag;
        }
    }

5 Replies

NG Naganathan Ganesh Babu Syncfusion Team February 10, 2020 12:06 PM UTC

Hi Simon, 

We have created a simple sample with your code example and we are unable to replicate the reported issue at our end. please refer to the below code example and sample. However, we don’t provide a customization support for blazor diagram component. If you customize the diagram class, the add/remove functionalities of the diagram’s will not work. So could you please share us more information about your requirement such as using screenshot or video to elaborate your requirement, which will help us validate and provide a better solution? 

Code example: 

//Add a custom connector to symbbol palette... 
private void CreatePaletteConnector(string id) 
{ 
ExampleConnector diagramConnector = new ExampleConnector() 
{ 
Id = id, 
}; 
ConnectorList.Add(diagramConnector); 
} 
 
//Activate tool to draw a custom connector... 
private void Draw(MouseEventArgs args) 
{ 
drawingObject = new ExampleConnector(); 
diagram.Tool = DiagramTools.ContinuousDraw; 
} 
 
public class ExampleConnector : DiagramConnector 
{ 
 
public ExampleConnector() : base() 
{ 
Type = DiagramSegments.Orthogonal; 
SourcePoint = new ConnectorSourcePoint() { X = 0, Y = 0 }; 
TargetPoint = new ConnectorTargetPoint() { X = 100, Y = 100 }; 
Style = new ConnectorShapeStyle() 
{ 
StrokeColor = "#FF0000", 
StrokeWidth = 2, 
}; 
TargetDecorator = new ConnectorTargetDecorator() { Shape = DecoratorShapes.None }; 
Constraints = ConnectorConstraints.Default & ~ConnectorConstraints.Drag; 
} 
} 


Regards, 

Naganathan K G 



SI Simon February 10, 2020 01:02 PM UTC

Hi Naganathan,

Firstly thank you for the reply. 

The continuous draw does seem to follow the defined styles, however drawing from a node port doesn't, apologies I should have been clearer.

STR:

  1. Define a node with a port that has the PortConstraints.Draw set
  2. Add custom styling to a connector instance and set as the drawing object
  3. Drag a connector from the port created above.

P.S. When is the blazor Diagram feature scheduled to come out of preview?


GG Gowtham Gunashekar Syncfusion Team February 12, 2020 01:50 PM UTC

Hi Simon, 
 
Reported Issue : Connector stroke style does not update properly  
     
We can reproduce the issue. We have confirmed this as a defect. We have logged a defect report for this issue. We will fix this issue and provide the patch on 4th March,2020 weekly patch release.   
    
Now, you can track the status of your issue through below feedback link.   
  
   
Regards,  
Gowtham G 



SK Suganthi Karuppannan Syncfusion Team March 4, 2020 05:48 PM UTC

Hi Simon,  
  
Reported Issue : Connector stroke style does not update properly   
      
Because of some technical issues we could not able to move this issue fix to weekly NuGet release. We will include this fix on upcoming weekly NuGet release which will be scheduled on 11th march 2020. However we have provided the custom package link below.  
  
  
Regards,  
Suganthi K. 



SG Shyam G Syncfusion Team March 11, 2020 11:42 PM UTC

Hi Simon,  
 
Reported Issue :  Connector stroke style does not update properly 
 
We have fixed the reported issue and included it in our patch release (v17.4.55) which is rolled out successfully.   
   
Please upgrade to the latest version packages to resolve this issue.         
  
Regards,  
Shyam G  


Loader.
Live Chat Icon For mobile
Up arrow icon