Articles in this section
Category / Section

How to override cloning of symbols?

1 min read

By default, when a symbol is dragged and dropped from symbol palette, a clone of the symbol is created using XamlWriter and XamlReader. There are some disadvantages on using Xaml Reader/Writer:

This cloning of symbols is overridden in application level and it gives full control on the object to be cloned. Refer the following code example on how to return a connector as a clone of symbol.

C#

    //Class derived from SymbolPaletteItem to override CloneContent method
 public class CustomSymbol : SymbolPaletteItem
 {
      public ConstomSymbol()
      {
      }
      public override object CloneContent()
      {
           LineConnector connector = new LineConnector();
           connector.StartPointPosition = new Point(300, 500);
           connector.EndPointPosition = new Point(300, 700);
           return connector;                   
      }
}

diagramControl - refers to the instance of DiagramControl.

 

C:\Users\Giftline\Desktop\img.jpgNote: This code shows how to override cloning of symbols, for further details on how to add this symbol in palette, refer the online help documentation.

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied