I have created a SymbolViewModel to use as a source for the stencil, but i cant define the ports location as i do with NodeViewModel si not have a Port atribute.
My code is:
SymbolViewModel symbol1 = symbol_square();
(stencil.SymbolSource as SymbolCollection).Add(symbol1);
public SymbolViewModel symbol_square()
{
ResourceDictionary node_shape = (ResourceDictionary)Application.LoadComponent(new Uri(";component/Nodes_shapes.xaml", UriKind.Relative));
string nome = "symbol1";
var symbol = new Syncfusion.UI.Xaml.Diagram.Stencil.SymbolViewModel()
{
SymbolTemplate = (DataTemplate)node_shape["Rectangle"],
Symbol = (DataTemplate)node_shape["Rectangle"],
Key = nome,
};
NodePortViewModel port1 = new NodePortViewModel()
{
NodeOffsetX = 0,
NodeOffsetY = 0.5,
};
return symbol;
}