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;
//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.
ADAdministrator Syncfusion Team June 21, 2005 10:30 AM
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.