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

Nested symbols from symbol model

I have created a symbol, symbol1 from a symbol model, symbolModel1. I want to nest another symbol within symbol1, based on symbolModel2. Here is how I was planning to do it. Is this approach generally OK? It seems that the diagram is clever enough to "automatically" position symbol2''s XY coordinates relative to the "parent" symbol. Is this assumption correct? Later I want to handle mouse events for symbol2 within symbol1. Is this a problem? SymbolPalette palette = paletteGroupBar.GetPalette(0); CustomSymbolModel symbolModel2 = palette.GetChild(0) as CustomSymbolModel; Symbol symbol2 = symbolModel2.CreateSymbol(); symbol2.X = 20; symbol2.Y = 40; symbol1.AppendChild(symbol2); //symbol2 now appears within symbol1, at X=20 and Y=40 relative to the top left corner of symbol1. I''ve tested this based on the Dynamic Symbol sample.

1 Reply

AD Administrator Syncfusion Team June 21, 2005 03:30 PM UTC

Hi Richard, This is not a scenario that we have tried out before. But I am not surprised that the child symbol is correctly positioned relative to it''s parent symbol, as the child symbol will function just like a regular shape node contained within a symbol, and will be positioned, scaled, moved correctly. As for mouse handling I have noticed that the Symbol class has a provision for its child nodes being CompositeNodes ie., Symbols as well, and so mouse handling should ideally trickle down to the child symbols and work correctly. But like I stated earlier, this is not something that we have tested previously and so I am not 100% certain. I am very curious to hear your findings on this issue. Thanks, Prakash Surendra Syncfusion Inc.,

Live Chat Icon For mobile
Up arrow icon