DiagramLite Programmer's Guide
DiagramBase.SerializeControl Event
See Also
 





Lets you save the attributes of controls hosted inside ControlNodes.

Namespace: MindFusion.Diagramming
Assembly: MindFusion.Diagramming.Silverlight

 Syntax

C#  Copy Code

public event EventHandler<ControlNodeEventArgs> SerializeControl

Visual Basic  Copy Code

Public Event SerializeControl As EventHandler(Of ControlNodeEventArgs)

 Event Data

SerializeControl event handlers receive an argument of type ControlNodeEventArgs. The following ControlNodeEventArgs members provide information relevant to the event:

Member name

Description

Handled

Gets or sets a value indicating whether the event is handled.

Node

Gets a reference to the ControlNode being serialized or deserialized.

XmlElement

The parent XElement where control data should be saved.

 Example

C#  Copy Code

private void OnDiagramSerializeControl(object sender, ControlNodeEventArgs e)
{
    TextBox control = e.Node.Control as TextBox;
    e.Handled = true;
    e.Context.WriteString(control.Text, &quot;Text&quot;, e.XmlElement);
}

private void OnDiagramDeserializeControl(object sender, ControlNodeEventArgs e)
{
    e.Handled = true;
    string text = e.Context.ReadString(&quot;Text&quot;, e.XmlElement);
    e.Node.Control = new TextBox() { Text = text};
}

 See Also

DiagramBase Members
DiagramBase Class
MindFusion.Diagramming Namespace