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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

DrawingObject doesn't obey the style colour properties

Thread ID:

Created:

Updated:

Platform:

Replies:

151374 Feb 9,2020 01:12 PM UTC Mar 11,2020 11:42 PM UTC Blazor 5
loading
Tags: Diagram
Simon
Asked On February 9, 2020 01:12 PM UTC

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;
        }
    }

Naganathan Ganesh Babu [Syncfusion]
Replied On 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 


Simon
Replied On 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?

Gowtham Gunashekar [Syncfusion]
Replied On 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 


Suganthi Karuppannan [Syncfusion]
Replied On 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. 


Shyam G [Syncfusion]
Replied On 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  


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon