Articles in this section

How to override cloning of symbols?

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 to using XamlReader/Writer:

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

C#

 // Class derived from SymbolPaletteItem to override CloneContent method
 public class CustomSymbol : SymbolPaletteItem
 {
      public CustomSymbol()
      {
      }
      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 the cloning of symbols. For further details on how to add this symbol to the palette, refer to the online help documentation.

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