Hi Meera,
Thank you for responding. My issue with the model is not fitting to the size of the nodes rendered, but the fact that even when nothing is rendered the diagram size is very large and does not seem to be set to fit to the size of the model. The attached picture shows how even though the model has nothing in it, the scroll bars are setup as if there were lots of content and also the model (white area) does not fill the screen.
Regarding the second question that sample is enough to get me started. Thank you,
~Jeremy
>
Hello Jeremy,
I am sorry about this delay in responding. Please find my response provided below on your queries.
1. If your intention is to make the model size to fit to its content size, you can do this by setting the Diagram.Model.SizeToContent = true. If you are placing the node outside of the diagram model bounds and you want the model size get increased automatically to fit to its node, you need to set Diagram.Model.BoundaryConstraintsEnabled to false in addition with the Model.SizeToContent setting.
2. If your intention is to create diagram programmatically, this is demonstrated in many of the diagram samples. For e.g. please refer the Diagram Samples\Symbol Design\Palette Load sample that shows to get the Symbol Palette by deserializing the Symbol Palette file and drawing the simple flow diagram programmatically.
At present we don't have any sample demonstrating about customizing the diagram model class. However you can easily do this. Below is the sample code snippet that shows how to do this.
class MyDiagram : Diagram
{
public MyDiagram()
{
}
public override Model CreateModel()
{
return new MyModel();
}
}
public class MyModel : Model
{
public MyModel()
{
this.BackgroundStyle.Type = FillStyleType.Texture;
this.BackgroundStyle.Texture = Image.FromFile("..\\..\\syncfusion.gif");
}
}
Using the above custom diagram and custom model will let you have the diagram model with the background image.
Please let me know if you have any questions. We will be glad to assist you.
Many Thanks,
Meera.
diagram_model_view.zip